I have a command working fine on a server. Now I'm trying it on a server from a different hosting service. I have a php.ini
file that contains this (in both root dir and current dir):
disable_functions =.
I'm getting this warning, and exec()
doesn't run.
exec() has been disabled for security reasons in /home/nealsent/public_html/backups/backup_dbs.php on line 210
The code is the following:
exec("mysqldump --opt db 2>&1 > db.sql", $output, $res);
Many hosts disable certain functions, and do not allow overriding them in custom php.ini's (just because PHP offers the ability to have a custom php.ini, does not mean that all PHP setups are necessarily configured to allow you to change that option via such).
Chances are that host simply doesn't allow exec() period. Not much you can really do about that.