Re: [PHP] system() call in PHP5 on win2003

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]



On 7/10/07, Xiaogang <xiaogangz@xxxxxxx> 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:

    $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


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

[Index of Archives]     [PHP Users]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [Postgresql]     [PHP Books]     [PHP Databases]     [PHP SOAP]
  Powered by Linux