Bug 210193 - PHP function popen (and others) doesn't work with Apache
PHP function popen (and others) doesn't work with Apache
Status: CLOSED NOTABUG
Product: Red Hat Enterprise Linux 5
Classification: Red Hat
Component: httpd (Show other bugs)
5.0
i686 Linux
medium Severity urgent
: ---
: ---
Assigned To: Joe Orton
David Lawrence
: SELinux
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2006-10-10 14:12 EDT by Yaroslav
Modified: 2008-04-09 14:26 EDT (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2006-12-14 11:59:33 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Yaroslav 2006-10-10 14:12:18 EDT
Description of problem:
PHP function popen (and others) doesn't work with Apache

Version-Release number of selected component (if applicable):
PHP 5.1.4
Apache 2.2.3

How reproducible:
just try to run next scripts in your browser
<?
$fp = popen("/bin/ls /var/www/html", "r");
fpassthru($fp);
pclose($fp);
?>
OR
<?
$fp = proc_open("/bin/ls
/var/www/html",array(0=>array("pipe","r"),1=>array("pipe","w"),2=>array("pipe","w")),$pipes);
fpassthru($pipes[1]);
fclose($pipes[0]);
fclose($pipes[1]);
fclose($pipes[2]);
proc_close($fp);
?>


Steps to Reproduce:
1. start a browser
2. put in address the URL of PHP script

  
Actual results:
nothing

Expected results:
index.html
index.php (or something)

Additional info:
Comment 1 Yaroslav 2006-10-16 02:17:53 EDT
The same happens to perl - no output from scripts under Apache
Comment 2 Joe Orton 2006-12-14 11:59:33 EST
This is prevented by the default SELinux policy.  Try:

  setsebool httpd_ssi_exec=1

(and pass the -P flag to setsebool to make the policy change permanent)

Note You need to log in before you can comment on or make changes to this bug.