PHP displays 500 Internal Server Error ?

1 like 0 dislike
asked Mar 11, 2016 in Website Issues by Jyson4u (750 points)
My website is showing "500 Internal Server Error" . How to fix this issue ?

1 Answer

0 like 0 dislike
answered Mar 11, 2016 by philip2013 (1,550 points)
selected Mar 11, 2016 by Jyson4u
Best answer
If you are running a PHP-based script on your site and are receiving a 500 and/or 404 errors on your pages, it is likely you have one or more of the following occurring:

1. You are attempting to access PHP files through the temp-URL ****://server-ip/~username. PHP on our servers requires a fully qualified domain name. You may wait until your domain has been pointed and resolves here .

2. The permissions on some of the folders or files are 777 or 666. If this is the case, change them to either 755 or 644 in Cpanel's File Manager (or using your local FTP client).

3. Your .htaccess file has php_values or php_flags in it. This causes a 500 Internal server error when attempting to execute the script.

The php_values and php_flags will need to be removed from your .htaccess file (please make a backup of the .htaccess by copying its contents and saving it on your desktop as htaccess.txt). Take the contents removed from .htaccess and place it into a file you create called php.ini. Remember to remove the php_flag and php_value part before the directives as php.ini files do not require those in front of the values.

Because php.ini values are not shared across directories, you would need a separate php.ini file in each folder that has .htaccess or that requires the php_values or php_flags. In order to avoid doing this, you can place a line in the .htaccess file in your public_html folder to have all values in your public_html php.ini to be shared across all folder. This line would be the following:

suPHP_ConfigPath /home/username/public_html

Related questions

Welcome to, where you can ask questions and receive answers from other members of the community.