nixCraft Poll

Topics

HTTP Error 500 Internal server for php pages and solution

Posted by Vivek Gite [Last updated: October 24, 2006]

You get "500 - Internal server error" error message when a user tries to access your Apache or Lighttpd based dynamic php application (such as forum or blog software).

Generally, to solve this problem you need to take help of log files located at following location:
=> /var/log/message
=> /var/log/httpd/error_logs (/var/log/lighttpd/error_log or /var/log/httpd/error_log)

So you may be wondering why your PHP script throws an Internal Server Error 500.

This error only occurs because of web server software. However after looking through logs you may not find many details. This problem may be caused by:

In most case it is an invalid .htaccess directive. However recently I came across a web server w/o /etc/php.ini file. A long time ago I setup this server )Apache chrooted jail). So you need to maintain two files one outside jail and another inside jail:
=> /etc/php.ini
=> /chroot/etc/php.ini <-- this file was missing

Many scripts open this file on fly to get correct configuration directives. If this file not found you get error 500. It took some time to figure out this problem. Finally strace helped me out to debug this problem.

For me it was another day with another interesting problem ;)

Want to stay up to date with the latest Linux tips, news and announcements? Subscribe to our free e-mail newsletter or RSS feed to get all updates. You can Email this page to a friend.

You may also be interested in other helpful articles:

Discussion on This Article:

  1. kankan Says:

    I get the error message just now
    thanks

  2. courtney Says:

    i got this same error on my motorola phone and i was curious if there was a way i could get rid of the problem. can you help me out?

  3. UKMoneyPot Says:

    Was there something simple you had to add to the .htaccess file?

  4. cpmresc Says:

    Hello there!
    Please help me solve http 500 internal server error.
    I use Dell Inspiron 6000, Windows Media Center Version 2005.
    The machine was configured to run default web services (on the same machine both server and client) with IIS 5.1. Ran some asp scripts; later php5 is also run and machine’s operation has been satisfactory.
    In the last week of April, an anti virus (corporate licensed version) Kaspersky 6.0.2.678 is intalled. I didn’t use the machine immediately for my php5 / asp work.
    Subsequently the default web server never worked and every time it displayed the above error. Besides, ‘the windows audio tune’ one listens while logging on and off also did not come. all audio stopped working.
    As per advise of some experts, Kspersky Anti Virus has been de-installed/removed–no change; the error persisted.
    The Windows XP Prof is re-installed. The audio has come back but the default web server didn’t.
    Throughout this period the internet web browsing isn’t affected.
    Please let me have your valued help.
    Thanks–cpmresc

  5. Joe Apache Says:

    I had a 500 result code from a GET of a simple PHPinfo .php file on my Windows Vista install of Apache 2.0 and PHP5. Everything in php.ini, httpd.conf was fine. The error log for httpd complained about:
    “PHP Warning: Unknown: failed to open stream: Permission denied in Unknown on line 0:” trying to open php.ini or something.
    So it’s a permissions problem… but it’s Vista so what to do. Here is what worked after 4 hours of hacking. Open Services control panel, right click on Apache2 service, and change how the service starts/logs on to your Windows logon user. That made PHP module finally click with Apache2. Also, I changed the owner of c:/php to the same user (me) that I changed the httpd service to. Hope this helps save some time for some of you.

  6. gilbert Says:

    hi guys if you could help me when i try to go to poetry.com to see the poem i wrote the http 500 error comes out do you think this is a problem of mine or is the website,s problem thanx.

  7. Shivakumar BM Says:

    Please help me in solving this probelm:
    Am using Dell server with 2003 OS, and Mozilla 1.8.20080.40413 version, I getting 500 Internal Server Error can’t pin point the problem as either refreshing the page or hitting back then clicking on the link again usually makes it appear.

Leave a Reply

We encourage your comments, and suggestions. But please stay on topic, be polite, and avoid spam. Thank you very much for stopping by our site!

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

*
To prove you're a person (not a spam script), type the security word shown in the picture. Click on the picture to hear an audio file of the word.
Click to hear an audio file of the anti-spam word

Copyright © 2004-2008 nixCraft. All rights reserved - TOS/Disclaimer - Privacy policy - Sitemap - Powered by Open source software.