popen() doesn't for me

This is a discussion on popen() doesn't for me within the PHP Language forums, part of the PHP Programming Forums category; popen() just won't work for me, and there is no debug info to indicate why in the server logs. ...


Go Back   Usenet Forums > PHP Programming Forums > PHP Language

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 09-18-2003
gowen
 
Posts: n/a
Default 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_mode") . "<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
Reply With Quote
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT +1. The time now is 06:15 AM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0