I try running a php script on a external server and hosting. I selected byethost because it’s a free service. All my system run excellent, except this script. I search information and i not found anything.
exec('mysqldump -u useronserver -ppasswordonserver clinicasbv >' . RESPALDOS_DB_L . date('Y_m_d_g_i_s', time() - (21600 - 3600)) . '_clinicasbv_backup.sql');
This code working perfect on my virtual host in my machine, but not work in byethost.
So, i need a root privileges or anything for running this script in a
external server? I need this script working on a external server, it’s all
2
Answers
To do this, the connecting host will preferably need a static IP address otherwise you’ll need to re-do this guide each time their dynamic IP address from their ISP changes.
You can allow access from cPanel for MySQL itself. We’ll also need to setup an allow rule through the firewall which is covered here.
It is very likely that the hosting provider has blocked your ability to run the "exec()" function. It is technically a security risk to allow it. You should find another way to get the MySQL dump, i.e. connecting remotely using a MySQL system or using the PHP MySQLi functions.