Problem with my system call
Posted: Mon Aug 14, 2006 9:59 am
Hello;
I am working on an Apache environment with Windows Server 2003 as the OS. I am trying to execute a system call/program that I built.
The program is called test.exe and takes some parameters:
My code is as follows(NOTE the test.exe is debugged and working via the command line)
AND this is the output....
c:\progra~1\postgresql\8.1\bin\pg_dump -h localhost -U swanley007 focus > \\10.1.2.7\SISBACKUP\Backup-Mon-Aug-14-10-52-19-2006.backup
RETURN VAL: 0
If I run the program without any options, ie
I get the error as it would be returned from the command line. I am not sure what to do. I am somewhat unfamiliar with the system and ecxec functions in php. Also, note that I have written a batch file to call the program, and I works fine as well, so I am confident that my proble is in the php.
Thanks
Stan Swank II
I am working on an Apache environment with Windows Server 2003 as the OS. I am trying to execute a system call/program that I built.
The program is called test.exe and takes some parameters:
My code is as follows(NOTE the test.exe is debugged and working via the command line)
Code: Select all
<?php
//exec('e:\backup',$out_arr, $retval);
exec("c:\backup_program\test c:\progra~1\postgresql\8.1\bin localhost focus \\\10.1.2.7\SISBACKUP",$out_arr, $retval);
for($i = 0; $i<=sizeof($out_arr);$i++)
{
echo $out_arr[$i]."<p>";
}
echo "<p><p>RETURN VAL: " .$retval;
?>AND this is the output....
c:\progra~1\postgresql\8.1\bin\pg_dump -h localhost -U swanley007 focus > \\10.1.2.7\SISBACKUP\Backup-Mon-Aug-14-10-52-19-2006.backup
RETURN VAL: 0
If I run the program without any options, ie
Code: Select all
system('c:\backup_program\test');....Thanks
Stan Swank II