Solving Internal Server Errors

From HelioHost Wiki
Jump to: navigation, search

If you are constantly receiving Internal Server Errors on your site, then there might be something you can do to make Internal Server Errors very rare. Whether you get Internal Server Errors always or occasionally, there could be a reason why these are happening.

Contents

High server load

If the Internal Server Errors appear occasionally, then it could be due to high server load. If your script requires lots of server resources, then your script may fail to run correctly at certain times of the day. By looking in the top right corner of the HelioNet website (for your convenience, the server loads are also at the bottom of this page and the Wiki home page), you can see how high the server load is at that moment in time. The higher the server load, the slower the server and the more common are Internal Server Errors. The server is at it's best when it is below 20.00.

Incorrect permissions

If PHP scripts are always showing Internal Server Errors, then you may have a permission error with your directory. To check, select the folder your script contains, and click on 'Change permissions'. Make sure that the permissions for the folder are 755. Also check that your public_html permissions are 755. Also make sure the file's permissions are set at 644. If the folder(s) is not 755, and the file itself is not 644, then change them and try running your script again.

Too many processes

At HelioHost, each user is limited to 7 processes. Each time an action is performed on your site (eg. run script, check mail) then a new process is created. However, if all processes are being used, then you will receive an Internal Server Error (or 'Server is busy'). If, for example, you constantly use Web Disk, then this can hog around 3 processes. Also, if you constantly check mail using a service such as imap, then lots of processes may pop up.

WSGI(django) Applications

When WSGI applications encounter an error, they write the output to apache's error_log. Unfortunately, cPanel does not allow you to view the error, so you must use this code instead:

<highlightSyntax> try:

   #Old dispatch.wsgi code goes here (make sure it's tabbed in!).
   

except:

   import traceback
   
   trace = traceback.format_exc()
   
   def application(environ, start_response):
   
       status = '500 Internal Server Error'
       output = trace
                       
       response_headers = [('Content-type', 'text/plain'),
                       ('Content-Length', str(len(output)))]
       start_response(status, response_headers)
               
       return [output]

</highlightSyntax>

server_load_s.gif server_load_j.gif server_load_t.gif

server_uptime_s.gif server_uptime_j.gif server_uptime_t.gif

Monitor

Personal tools
Namespaces

Variants
Actions
Navigation
Toolbox
Google AdSense