We used to use php 4 on our web server on win2000, and use the system()
to call some DOS programs. That how we call it:
$cmd = "c:\\Inetpub\\wwwroot\\test.exe";
$last_line = system($cmd, $retval);
print ("<br>\nretval =\"". $retval. "\"<br>\n");
It was working perfectly for years.
However, recently we moved to a win2003 server, and install the php
5.2.3, and now the system() no longer works as expected:
1. It no longer work in the web, the only result returned
to the web browser is "retval =-1";
2. It still works if tested in DOS commandline (use the
command such as "php test.php");
3. Even change the $cmd to "type test.txt" or "dir", the
result is the same: works in DOS prompt window, but
not web browser (received only "retval =-1").
I have checked the permissions on all those files/folders, even tried
giving read/execute permission to "everyone", still no help.
In our configuation, the safe mode is off.
Any clue? Thanks in advance.
Xiaogang
[Index of Archives]
[PHP Users]
[PHP Home]
[PHP on Windows]
[Kernel Newbies]
[PHP Classes]
[Postgresql]
[PHP Books]
[PHP Databases]
[PHP SOAP]