Jul 17th, 2012
How to resolve Suexec problems with cgi scripts
How to resolve Suexec problems with cgi scripts
Run the following script:
This reads /usr/local/apache/logs/suexec_log and looks for errors and tries to fix them.
How to resolve Suexec problems with cgi scripts
Run the following script:
This reads /usr/local/apache/logs/suexec_log and looks for errors and tries to fix them.
The rebuild_phpconf script on your server allows you to udpate your server’s php.conf file (located at /usr/local/cpanel/bin/rebuild_phpconf). By doing this, you can change Apache’s PHP handler configuration, change the default version of PHP used by your server, and enable or disable the suEXEC feature.
Note: This script offers nearly the same functionality as the WHM Configure PHP and suEXEC feature. Users more comfortable with a graphical interface may prefer that method.
To see a list of all options and arguments for this script, type the following from the command line:
Cpanel Tool to configure PHP and SuExec
This tool allows you to configure the Apache PHP Handler, the default PHP version and suEXEC support.
The default PHP version determines which version of PHP is used for files with a ‘.php’ extensions when served by Apache.
Enabling suEXEC provides support for Apache to run CGI programs as the user ID of the account owner. suEXEC is not PHPSuExec.
Please refer to the documentation for a detailed explanation of how each handler functions.
Reference: http://www.cpanel.net/support/docs/ea/ea3/ea3php_php_requests.html
Enabling or disabling SuExec in WHM
SuExec is an Apache feature that gives users the ability to run CGI and SSI programs using user IDs that are different from the user ID of the calling web server. This effectively means that CGI and SSI programs will not have access to the root account or have root permissions.
To enable or disable SuExec:
1.Click on the Enable/Disable SuExec link in the Server Setup menu.
2.Click on the Enable button to enable SuExec or click on the Disable button to disable SuExec.
suEXEC is based on a setuid “wrapper” program that is called by the main Apache web server. This wrapper is called when an HTTP request is made for a CGI or SSI program that the administrator has designated to run as a userid other than that of the main server. When such a request is made, Apache provides the suEXEC wrapper with the program’s name and the user and group IDs under which the program is to execute.
PHP as a CGI script with suexec
For hosts running PHP as a CGI script with suexec you may be able to put these directives in a php.ini file in your website root directory.
Add the below to your .htaccess file in your web root directory.
The PHP documentation states that the memory_limit setting also affects file uploading.
Generally speaking, memory_limit should be larger than post_max_size.
Depending on your host, this can be done in a number of places with the most likely being php.ini or .htaccess depending on your hosting situation.
Add for example:
With root access, you can use the sed util in Linux/Unix based systems, in order to increace the memory for 64M. Don’t forget to properly locate you php.ini file!