I write some code with PHP to backup database.
Here my code:
exec("mysqldump --opt -h localhost -u root test > mydb.sql");
But I get 0-byte in my file (mydb.sql). I also run with passthru(), system(), but it still gets 0-byte.
I try to use command. It works.
I use the lastest XAMPP for my localhost.
So, how can I do to make it works correctly?