PHP exec has no responding

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • datactrl
    New Member
    • Jul 2008
    • 51

    #1

    PHP exec has no responding

    The following function is used to execute pg_dump but have no responding at all. And I found there is no output. While the exactly command string executing on server desktop does work. And I have another function to execute a program saved in somewhere rather than "program files" and it works. php safe_mode is off.

    Code:
    function create_new_csn_schema($xfrom_schema, $xtoschema){
    	$cmd ="\"c:\\program files\\PostgreSQL\\9.0\\bin\\pg_dump.exe\" --file=c:\\temp\my1.sql --host=localhost --username=xyz --port=5111 --table=$xfrom_schema.* --schema=$xfrom_schema --schema-only mydb";
    	$WshShell = new COM("WScript.Shell");
    	$exec = $WshShell->Run($cmd, 0, true);
    }
  • Dormilich
    Recognized Expert Expert
    • Aug 2008
    • 8694

    #2
    question: is your live server also on Windows? do you have all necessary read/write/execute permissions there? is COM installed at all?

    Comment

    • datactrl
      New Member
      • Jul 2008
      • 51

      #3
      Thanks a lot. I found the problem is I installed apache as services and login as system on my Windows 2003. Services won't allow to prompt for password. Now I save a pgpass.conf in system/application data, then it works.

      Comment

      Working...