Re: system() call in PHP5 on win2003
| From: | Tijnema | Date: | Tue, 10 Jul 2007 10:49:02 +0000 |
| Subject: | Re: system() call in PHP5 on win2003 | ||
| References: | 1 | Groups: | php.general php.install php.windows |
| Request: | Send a blank email to php-general+get-258533@lists.php.net to get a copy of this message | ||
On 7/10/07, Xiaogang <xiaogangz@acm.org> wrote:
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:Are you sure PHP does actually read the config file? Check if safe_mode is really off using phpinfo(); like this: <?php phpinfo(); ?> Tijnema -- Vote for PHP Color Coding in Gmail! -> http://gpcc.tijnema.info$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 returnedto the web browser is "retval =-1";2. It still works if tested in DOS commandline (use thecommand such as "php test.php");3. Even change the $cmd to "type test.txt" or "dir", theresult 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