popen() doesn't for me

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • gowen

    popen() doesn't for me


    popen() just won't work for me, and there is no debug info to
    indicate why in the server logs. Can anyone shed some light on this?
    Any suggestions for debugging? Ways to get more info out of "Resource
    #2" as shown in the script below?

    Safe mode is set to off (verified with php_info, shown via ini_get
    below). The server is not chrooted (I can stat the exe in question, as
    shown below).

    PHP version is 4.3.3 with the following configure line:

    ../configure --disable-safe-mode --with-imap --with-imap-ssl \
    --with-kerberos --with-dom --with-mcrypt --with-zlib --with-apxs

    Running as an apache 1.3.27 module under RedHat 7.2.

    Any help is appreciated. Thanks!


    Test script:

    <?PHP
    echo "safe_mode is set to " . ini_get("safe_m ode") . "<br>\n";
    $size = stat("/bin/ls");
    echo $size[7] . "<br>\n";
    $fp = popen("/bin/ls", "r");
    echo "'$fp'; " . gettype($fp) . "<br>\n";
    while ($s = fgets($fp,1024) ) {
    echo $s;
    }
    echo "s is #$s#<br>\n";
    pclose($fp);
    ?>


    Output:

    safe_mode is set to 0<br>
    45948<br>
    'Resource id #2'; resource<br>
    s is ##<br>


    Verification of /bin/ls size:

    $ ls -l /bin/ls
    -rwxr-xr-x 1 root root 45948 Aug 9 2001 /bin/ls*


    --
    gowen -- Greg Owen -- gowen-news at swynwyr.com
    79A7 4063 96B6 9974 86CA 3BEF 521C 860F 5A93 D66D
Working...