obay Posted February 13, 2008 Share Posted February 13, 2008 Hi! I use the following function to create a backup of my database and save it automatically to a file named "dump.sql". function createDump($db_username,$db_password,$db_name) { $pathToMysqlDump = "c:\xampplite\mysql\bin\mysqldump.exe"; $file = "dump.sql"; $query = "$pathToMysqlDump --allow-keywords --opt -u$db_username $db_password $db_name > $file"; shell_exec($query); } It uses the mysqldump.exe stored on my PC. The problem is it doesn't work when I upload it to the web server. What do I replace "c:\xampplite\mysql\bin\mysqldump.exe" with? and in what folder should I place a copy of mysqldump.exe on my web server? Can I put it on the same folder as the function above? Any help appreciated.. thanks! Link to comment https://forums.phpfreaks.com/topic/90819-execute-mysqldumpexe-on-web-server-through-php/ Share on other sites More sharing options...
toplay Posted February 13, 2008 Share Posted February 13, 2008 It doesn't work because your web server is probably some form of UNIX/Linux and it doesn't run .exe files. Check with your web host provider if you're allowed to do it and where the path is. Good luck. Link to comment https://forums.phpfreaks.com/topic/90819-execute-mysqldumpexe-on-web-server-through-php/#findComment-465488 Share on other sites More sharing options...
obay Posted February 13, 2008 Author Share Posted February 13, 2008 oh! yes my web server is Linux! oh my.. okay thanks for the help!!!! Link to comment https://forums.phpfreaks.com/topic/90819-execute-mysqldumpexe-on-web-server-through-php/#findComment-465489 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.