How to fix 500 internal server errors

Details on how to fix common problems with suPHP

IwhiC.Com

Hi we would like to give you in more detail about the suPHP being installed on the 2 new servers, this currently only effects servers Freedom and server Patriot, all servers will eventually have this installed.

Let’s start with explaining a little bit about what suPHP is. And then go into detail about what problems this can cause and how we can fix it.

We have installed suPHP on these to new server for security precautions, and to better protect the servers and your websites..

I am going to explain a little bit about what it is and why we did it..

PHP on normal default settings run as apache, this is why phishing scams, (the ebay fraud and paypal, bank fraud is so common) . The hackers or scammers will find holes in the php scripts and implement their scams on your web site..

We are trying to stop this type of abuse to better our service to you, and to the community. With PHPSUEXEC all scripts will run as the users name and not the user nobody. This is important so we can find and track down any user or account that is running malicious scripts and causing the server to crash, quickly. We will be able to track down spam being sent easier, and stop it before it gets carried away.

suPHP will also fix file ownership problems. This has been a common issue on a few sites like Joomla and WordPress.

We have been discussing this with our abuse department for months now and with the 2 new servers we felt this was the perfect time to start implementing it. So I am going to give you some things to fix problems that you may have with this, and you can pass this information on to your customers.

You will not beable to run any permissions as 777 ( you will get a 500 internal server error)

When php runs as apache (old set up) the scripts ran as the user nobody and which needed the 777 permissions (which is not very secure)

When PHP is running as CGI with suPHP enabled (new set up) you will not beable to run any permissions as 777. The max permissions you will beable to set is 755 as the scripts will now run as the users name.

With the old server set up you were able to use your .htaccess file to manipulate the PHP settings, example turning register global on or off,

With the new php settings you will not beable to do that, you will get a 500 internal error..

The work around for this is to use your php.in file.. here is an example

running suPHP you can no longer use the .htacess to change any php
All the php_flags in your .htaccess will have to be moved to php.ini, which you will have to create in your public_html directory.

Example:
.htaccess » php_flag register_globals off
php.ini » register_globals = Off

The file php.ini will handle all the extra settings you need to set in php.
So, basically you will have to move every command on .htaccess that starts with php_flag.

This is because php is no longer running as an apache module and apache will not handle those directives any longer.

Creating a php.ini file to manipulate the php settings will solve this issue.

You will need to also add this to your .htaccess file to direct it to the php.ini file.

suPHP_ConfigPath /home/username/public_html

So if you run into any of these problems with 500 internal error messegages first make sure all your permissions are correct and no 777 permissions..

If that step did not solve your problem then check your .htaccess files (all of them) and make sure there are no php values of any kind in there. If there is then just create a new php.in file and replace those values that is in your .htaccess files and put them in your php.in file.

Always check your error log to see where the problem may be, it may help narrow your search down.

I hope that this has helped clarify some of the new settings and why we have decided to implement this new set up.

At any time if these steps do not work then you can contact support for assistance.

IwhiC.Com

03/06/2008

  • 8 Users Found This Useful
Was this answer helpful?