I found a cool MySQL backup script. It's working fine on some hosting companies. Now I'm trying it on a different host running PHP Version 5.2.8.
I have a php.ini file that contains this (in both root dir and current dir):
disable_functions =.
I'm getting these warnings, and it seems like they are more than warnings.
If exec()
doesn't run, the database is not backed-up.
Undefined variable: output in /home/nealsent/public_html/backups/backup_dbs.php on line 21
Undefined variable: res in /home/nealsent/public_html/backups/backup_dbs.php on line 210
exec() has been disabled for security reasons in /home/nealsent/public_html/backups/backup_dbs.php on line 210
The code is the following one.
// dump db
unset($output);
// Line 210:
exec("$MYSQL_PATH/mysqldump $db_auth --opt $db 2>&1 >$BACKUP_TEMP/$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.