I'm going to backup my database using a php script which executes a command using the system()
function. Unfortunately, my shared hosting has disabled it. I got this warning when I ran it:
Warning: system() has been disabled for security reasons in /path-to-my-file on line 162
Here is my piece of code:
$filename = 'backup/mybackupfile.sql';
$command = "mysqldump -u myuser -pmypass mydatabase > ". $filename ."";
system($command);
It is working fine on my local computer with xampp
, but it happens to be a problem on my shared hosting.
So, I need another way to run the mysqldump
command instead of using system()
. I try to avoid using cron or SELECT * OUTFILE
things.