How To Fix HTTP Error Code
How To Fix HTTP Error Code
server error”
https://www.1and1.com/cloud-community/learn/web-server/server-
management/how-to-fix-http-error-code-500-internal-server-error/
Introduction
Learn how to fix the HTTP error code “500 internal server error.” This error means there is a
problem on the server side. It is an all-purpose error, which means a serious problem is
preventing your website from functioning.
If you have multiple websites hosted on your server, they will likely have their own error logs.
The location of these log files will be specified in the site's Apache configurations. Typically
If the error log is large, it can be difficult to find the correct line. If you know that a particular
script is causing the error, you can search the file for this script name by using the command:
This will return any lines which have the file name in them.
If you are not sure what is causing the error, you can follow the error log in one window and
watch it being generated. First, in your SSH session, use the command:
tail -f /var/log/httpd/error_log
Without closing the SSH session, go to a web browser and refresh the page to generate the
500 error again. You should see the error appear in the log file.
You can also view the last 10 lines in the error log with the command:
tail -20 /var/log/httpd/error_log
Once you find the error, copying and pasting it into Google will often yield helpful results.
Check Permissions
An HTTP 500 error can be caused by a permissions problem with your website’s files or
folders. Check the permissions on all of your main folders and scripts. Most Perl and CGI files
To check the permissions of files on a Linux system, connect via SSH to your server and go to
the directory where the files are kept. Use the 11 command to list all files and file details.
The first block of letters lists the file's permissions. There are three permission levels:
•Read (r)
•Write (w)
•Execute (x)
The permissions are shown in groups of three:
•Group 1: Owner
•Group 2: Group
•Group 3: World (everyone)
In the above example, the first file ( test.cgi ) has read/write/execute permissions for the
owner, but only read/write permissions for group and world (755).
The second file ( test.py ) has read/write/execute permissions for owner, group, and world
(777).
Changing Permissions
To change the permissions for a file, you need to use the chmod command, along with the
numerical value of the permissions level you want to set. The most common permissions
levels are:
•7: Read, write, and execute (rwx)
•5: Read and execute (r-x)
•0: None (---)
Most scripts will require read/write/execute permissions for the owner, and read/execute
permissions for group and world. To set this on a file, use the command:
If you are still receiving an error when you run your script, try setting it to global
read/write/execute permissions for testing purposes. To set this on a file, use the command:
This permissions level can be risky, because it allows anyone to rewrite your file. Once you
have finished troubleshooting, be sure to set the file back to the correct permissions.
Now set appropriate permissions for the WordPress directory.