Bug 210193

Summary: PHP function popen (and others) doesn't work with Apache
Product: Red Hat Enterprise Linux 5 Reporter: Yaroslav <slavas>
Component: httpdAssignee: Joe Orton <jorton>
Status: CLOSED NOTABUG QA Contact: David Lawrence <dkl>
Severity: urgent Docs Contact:
Priority: medium    
Version: 5.0Keywords: SELinux
Target Milestone: ---   
Target Release: ---   
Hardware: i686   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2006-12-14 16:59:33 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Yaroslav 2006-10-10 18:12:18 UTC
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 06:17:53 UTC
The same happens to perl - no output from scripts under Apache

Comment 2 Joe Orton 2006-12-14 16:59:33 UTC
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)