HTTP Error 500 Internal server for php pages and solution
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:
- A malformed php cgi script
- An invalid directive in an .htaccess or other config file
- Limitation imposed by file system and server software (for example php log file size set to 10Mb)
- Missing php.ini (or cannot read php.ini file)
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:
- VSFTPD cap_set_proc and dead but subsys locked errors and solution
- Upgrad: RHEL 5, PHP 5, MySQL 5
- KDE or GNOME graphical login manager hates my NIS configured automount directories
- PHP Log All Errors to a Log File to Get Detailed Information
- Humor: Writing Web Service and Pages using Bourne Shell
Discussion on This Article:
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!


I get the error message just now
thanks
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?
Was there something simple you had to add to the .htaccess file?
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
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.
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.
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.