system() call in PHP5 on win2003

From: Date: Tue, 10 Jul 2007 02:38:39 +0000
Subject: system() call in PHP5 on win2003
Groups: php.general php.install php.windows 
Request: Send a blank email to php-general+get-258528@lists.php.net to get a copy of this message
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

« previous php.general (#258528) next »