PHPSuExec , .htaccess and php.ini
January 26th, 2007 by admin
A lot of hosting providers are switching now to the PHPSuExec module on their servers. The users that depended on the configuration in the .htaccess file are panicking because their site is not working anymore. This is not really a reason to panic but for people with a lot of sites this becomes an inconvenience.
What can you do in this situation is simple. Try to move as much configurations from your .htaccess file to the php.ini file. The php.ini is a simple text file that can be places in every directory from your server. It will affect only that directory and not the entire site.
Enabling the SuExec module is a security issue. Before this, the php user was “nobody” no matter what. So a reseller account could cause a lot of problems , because everyone could have access to the php files of another user. When the new module is installed every user is logged with it’s unique name.
The most common problem you will noticed is that some page on your site will display a Internal Server Errors (Error 500).
There are two main things in the .htaccess file that might generate problems.
1.MIMETypes
You might want your html pages to run as php. In the .htaccess file this line used to look like this :
AddType application/x-httpd-php .php .htm .html
This will not work anymore. You have to use an option from your host CPanel. Use Apache Handlers and add the following
Extension: html (or htm)
Handler: application/x-httpd-php
Problem solved.
2.Mod_rewrite
If you used some redirects with commands like
RewriteEngine On
RewriteRule …
you don’t have to change anything. This lines can stay in your .htaccess file and they will work with no changes required. The only thing is the .htaccess might not be visible on your FTP server. This file can be created/edited from your Cpanel - > File Manager.
If the SuExec module is not configure right you might have another problem. Some core.xxx files are created. They are log files and are made each time a page on your site is opened. They are big in size and can take over all the space you reserved for an account. All you have to do is delete the files and create a default php.ini file ( empty ). Put this file in all your directories and the log file won’t be saved anymore.
