Hello everyone
I referred to you for database backup using mysqldump ans system() function to execute it.
So far iam able to create backup file, but my backup file is empty. When i use mysqldump from command line, it works.
But from php it doesnt work what could be the problem?
My password is blank, so i did not supply the password. Moreover i have globaly registered the environment variable for mysqldump and i can use it from any directory. And also the .sql is being created but its blank. but when i create it from command line it gets created successfully.
Thanx for sharing different ideas. but now i will give you some more information.
1) I am using Windows XP.
2) I am using WAMP server.
3) I registered environment variable for mysqldump in Windows, so that i can run mysqldump from any directory.
4) today when i opened my Apache error log (apache_error), i noticed this
'[Sat Dec 25 18:21:08 2010] [error] [client 127.0.0.1] File does not exist: C:/wamp/www/favicon.ico
'mysqldump' is not recognized as an internal or external command,
operable program or batch file.'.
5) It means Apache is giving this error, but when i use the Command line , it works fine.
6) What could Apache possibly have to do with judging whether mysqldump is a command or not. Windows should judge.
7) I tried running 'cmd' and 'ping localhost' from php and they worked.
This is the situation. Please send some ideas on what could be happening.
Regards
Yes. In Wamp server the absolute path is
C:\wamp\bin\mysql\mysql5.0.51b\bin
I have added it in User variables as well as System Variables under the name PATH.
And im successful in running mysqldump from any directory from command prompt. but not using PHP.
I tried it
it is now showing this on my browser
"Invalid File'mysqldump' is not recognized as an internal or external command, operable program or batch file."
I did it. Special thanx to VladSun.
I simply did this
$command="C:\wamp\bin\mysql\mysql5.0.51b\bin\mysqldump -h localhost -u root nigamkota > database/backup.sql";
system($command);
It means there is some problem in PATH environment variable. I will see it.
Thanx