Error 500 - Internal Server Error - PHP

This can be due to several factors. The first thing to check is that the permissions on the file and all relative files to it are set to 755 which you can set in your FTP client or in SSH via chmod.

When multiple files are selected for a permission change in some ftp programs, the ftp program will not set all files to that change if just one of the scripts is already set to 755. Verify each file is set to 755 and set each individually if necessary.

An executable .php file which has its' permission set to 755 may not be placed in a folder permission set to 777.

The next thing is to make sure all the path configurations within the file are correct.

Also often, an FTP client will upload a file in binary instead of ascii when it is set to auto. Force the program to upload the file in ascii then try again. Or binary if you are uploading PHP Zend or Ioncube compiled files for example.

Often you can find a forum or faq on the scripts website assisting you with common errors like this one.

Another common cause is a .htaccess file with lines that don't agree with the server. A quick way to see if that is the issue is to rename the file to .htaccess.bak. If the error goes away you can then troubleshoot which section in the file is causing the issue by placing a # at the beginning of each line. We run PHP on our servers in CGI mode for security so you may need to run a command differently or via your own php.ini file in its directory.

To track down the issue you may find a file called "error_log" in the directory. By viewing the last lines of the file you should be able to locate the problem and troubleshoot it from there.

A command within a PHP file that does not work with PHP in CGI mode may also cause this error and you may need to simply change a line to be more clean and secure for it.

What modules does the script require? If a module is not available this can trigger a 500. Check the website or with the develop for the requirements of the script.

Turn on debug mode in the script and/or check the error_log file for it to help track the issue further.

If your script requires an older version of PHP or a different requirements from our default, you may change your php setup via your hosting control panel and the Select PHP Version icon. 

  • 462 Users Found This Useful

Was this answer helpful?

Related Articles

I am having problems with a script I wrote.

PHP suexec is running on all of our shared servers. If you are running code that is insecure or...

Warning: system() has been disabled for security reasons

system is a feature of php which is disabled by default. To change this if needed for a...

Error: SoftException in Application.cpp:303 UID of script is small than min_uid

Error: SoftException in Application.cpp:303 UID of script is small than min_uid when going...

What is the path to PHP5?

We are currently running the latest stable version of PHP5. /usr/bin/php

Running a PHP file with a cron job

To run a PHP file from cron, use the "cron jobs" section of your control panel. Use the following...