cancel
Showing results for 
Search instead for 
Did you mean: 

Inherited php.ini, & 500 Internal Server Errors

abirhasan
Master User

This is a consolidated post and adds new information about suPHP.

First, Inherited php.ini and .htaccess:

With the new suPHP that is being installed on the servers, you will find that if you leave the php values in the .htaccess file, you get a 500 Internal Server Error.

The workaround for this is to create a new file called php.ini. This file is identical in syntax to the server's main php.ini file and houses all the customizations you want for your site. The downside is that this file is not inherited as the php values in .htaccess were, it only effects the directory it is located in.

In order to get the values in your php.ini to be inherited by all the subdirectories, you will need to add the following lines to the .htaccess file in your public_html folder:

suPHP_ConfigPath /home/username/public_html
<Files php.ini>
order allow,deny
deny from all
</Files>

This will make php look for a php.ini file in the public_html folder. It is important to leave off the trailing slash and to not specify a filename, the file must be called php.ini.  If you need different php settings in a particular folder, then simply place a php.ini file in that folder and it will override the main php.ini in the public_html folder.  The <Files> section ensures that no one can view the php.ini file from the internet. 

 

Any help?

0 REPLIES 0