I try to restore a database (".backup" file) with pg_restore with cmd launch with PHP code but it doesn't work.
1- I give to my PHP variable all the cmd code
$cmd="cmd /c C:/Program Files/PostgreSQL/9.1/bin/pg_restore.exe -d ".$_POST['data2']." -i -h localhost -p 5432 -U ********** D:/backup/voirie.backup";
2- I launch it
exec($cmd);
My php work without result
On my server the process is launched
Other informations
- In place of exec() I tested with system() and passthru()
- I tested to create a batchfile from my php. This batchfile, work fine when launch him on the server but not from my PHP file
- The generate code in $cmd was tested directly from CMD on the server and it works
- For other codes on this server I use this who work fine:
system("cmd /c C:/Python35-32/python.exe D:/python/serpent.py");
- I tested with this quotes without result :
$cmd='cmd /c "C:/Program Files/PostgreSQL/9.1/bin/pg_restore.exe" -d '.$_POST['data2'].' -i -h localhost -p 5432 -U ********** D:/backup/voirie.backup';