Page 1 of 2 | 1 | 2 | > | >> | All |
Posted By: tidus on January 24, 2012, 6:08 am | Post: 1 |
Quote From : Nube January 23, 2012, 9:34 pm Hi :-)
I need your help once again.. i try to backup my db using a php script but always get an error.. here the code i use: PHP Code
i always get "1" as value into $retval.. what's wrong with my code? thanks for the help Hi, If you are trying to take Backup of scripts installed by Softaculous, why don't you use Softaculous Backup Feature. http://ampps.com/wiki/How_to_Backup_an_Installation ----------------------- Follow AMPPS on, Twitter : https://twitter.com/AMPPS_Stack Facebook : http://www.facebook.com/softaculousampps Google+ : https://plus.google.com/+AmppsStack |
Posted By: Nube on January 24, 2012, 12:38 pm | Post: 2 |
what i am trying to do with that code is to backup a db that i created.. but i don't know why it always return me "BackuP Failed" |
Posted By: tidus on January 24, 2012, 12:45 pm | Post: 3 |
Quote From : Nube January 24, 2012, 12:38 pm what i am trying to do with that code is to backup a db that i created.. but i don't know why it always return me "BackuP Failed" Hi, Create a temp.bat file and insert your mysql dump command into it. Then run that batch file with exec command of PHP. ----------------------- Follow AMPPS on, Twitter : https://twitter.com/AMPPS_Stack Facebook : http://www.facebook.com/softaculousampps Google+ : https://plus.google.com/+AmppsStack |
Posted By: tidus on January 24, 2012, 1:35 pm | Post: 5 |
Quote From : Nube January 24, 2012, 1:10 pm ok, so i have to copy my php code into a text file and rename the file as a "bat file" and then run the bat file from a php file using the comand exec? i understand well?? No, you got it wrong. Create a file temp.bat from PHP with fopen function and insert your mysql dump command with fwrite function. Then run that created temp.bat file with exec function of php. All your php code will be in your script and not in bat file. ----------------------- Follow AMPPS on, Twitter : https://twitter.com/AMPPS_Stack Facebook : http://www.facebook.com/softaculousampps Google+ : https://plus.google.com/+AmppsStack |
Posted By: tidus on January 29, 2012, 3:08 pm | Post: 9 |
Hi,
$file is handler in your code. Use file path instead of handler. $filepath = '../../t6/backup/temp.bat'; exec($filepath); ----------------------- Follow AMPPS on, Twitter : https://twitter.com/AMPPS_Stack Facebook : http://www.facebook.com/softaculousampps Google+ : https://plus.google.com/+AmppsStack |
Posted By: tidus on February 2, 2012, 5:54 am | Post: 12 |
Hi,
I am afraid i won't be able to help you much with PHP code. You should take help from other PHP forums. If you need more information about AMPPS or if you're facing any problem with the AMPPS Package feel free to contact us. temp.bat is actually a batch file which you are creating. Set of commands are executed. Learn more from Google. Executing the batch file with the proper command in it should work. Confirm that your command is correct by Code echo $command; ----------------------- Follow AMPPS on, Twitter : https://twitter.com/AMPPS_Stack Facebook : http://www.facebook.com/softaculousampps Google+ : https://plus.google.com/+AmppsStack |
Posted By: tidus on February 2, 2012, 1:42 pm | Post: 14 |
Hi,
I have written a code, this worked for me. exec function of php doesn't work for me too, it gives empty .sql file. PHP Code
----------------------- Follow AMPPS on, Twitter : https://twitter.com/AMPPS_Stack Facebook : http://www.facebook.com/softaculousampps Google+ : https://plus.google.com/+AmppsStack |