Bug #69077 [Opn->Spm]: system() and exec() functions

From: Date: Thu, 19 Feb 2015 07:23:08 +0000
Subject: Bug #69077 [Opn->Spm]: system() and exec() functions
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-190799@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=69077&edit=1 ID: 69077 Updated by: requinix@php.net Reported by: postmaster at angosso dot net Summary: system() and exec() functions -Status: Open +Status: Spam Type: Bug Package: Built-in web server Operating System: Linux (Redhat) PHP Version: 5.6.5 Block user comment: N Private report: N Previous Comments: ------------------------------------------------------------------------ [2015-02-19 07:21:37] postmaster at angosso dot net Description: ------------ LiveAPI System - The exec() Method The exec() method executes a cPanel tag Test script: --------------- exec() and system() /etc/php.ini/ php_admin_value <?php echo '<?xml version="1.0"?>'; ?> // Execute the feature tag. $cpanel->exec(feature,1); Enable system() and exec() functions on hosting? Expected result: ---------------- <?php echo '<Access the cgi-bin location in the root of my website cd /home/cpanel-user/public-html/cgi-bin php.ini to it cp /usr/local/lib/php.ini /home/angosson/public_html/cgi-bin vi php.ini create php.fcgi file to load the custom php.ini in /home/angosson/public_html/cgi-bin with the following code #!/bin/sh export PHP_FCGI_CHILDREN=1 export PHP_FCGI_MAX_REQUESTS=10 exec /usr/local/cpanel/cgi-sys/php5 /etc/httpd/conf/php.conf Correct the ownership and permssion of the files chown -R user.user /home/cpanel-user/public_html/cgi-bin/ chmod 755 /home/angosson/public_html/cgi-bin/php.fcgi .htaccess file in the root to point to php.fcgi wrapper cd /home/cpanel-user/public_html vi .htaccess AddHandler php5-fastcgi .php Action php5-fastcgi /cgi-bin/php.fcgi # Fastcgi configuration for PHP5 LoadModule fcgid_module modules/mod_fcgid.so MaxRequestsPerProcess 500 AddHandler fcgid-script .php5 .php4 .php .php3 .php2 .phtml Action php5-fastcgi /cgi-bin/php.fcgi AddType application/x-httpd-php .php FCGIWrapper /usr/local/cpanel/cgi-sys/php5 .php5 FCGIWrapper /usr/local/cpanel/cgi-sys/php5 .php4 FCGIWrapper /usr/local/cpanel/cgi-sys/php5 .php FCGIWrapper /usr/local/cpanel/cgi-sys/php5 .php3 FCGIWrapper /usr/local/cpanel/cgi-sys/php5 .php2 FCGIWrapper /usr/local/cpanel/cgi-sys/php5 .phtml rebuild the apache configurations /usr/local/cpanel/bin/apache_conf_distiller –update /scripts/rebuildhttpdconf /etc/init.d/httpd restart'>; // Outputs all the result of shellcommand "ls", and returns // the last output line into $last_line. Stores the return value // of the shell command in $retval. $last_line = system('ls', $retval); // Printing additional info echo ' </pre> <hr />Last line of the output: ' . $last_line . ' <hr />Return value: ' . $retval; ?> ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=69077&edit=1

« previous php.bugs (#190799) next »