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/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:
=> /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 ;)TwitterFacebookGoogle+PDF versionFound an error/typo on this page? Help us!
- 30 Cool Open Source Software I Discovered in 2013
- 30 Handy Bash Shell Aliases For Linux / Unix / Mac OS X
- Top 30 Nmap Command Examples For Sys/Network Admins
- 25 PHP Security Best Practices For Sys Admins
- 20 Linux System Monitoring Tools Every SysAdmin Should Know
- 20 Linux Server Hardening Security Tips
- Linux: 20 Iptables Examples For New SysAdmins
- Top 20 OpenSSH Server Best Security Practices
- Top 20 Nginx WebServer Best Security Practices
- 20 Examples: Make Sure Unix / Linux Configuration Files Are Free From Syntax Errors
- 15 Greatest Open Source Terminal Applications Of 2012
- My 10 UNIX Command Line Mistakes
- Top 10 Open Source Web-Based Project Management Software
- Top 5 Email Client For Linux, Mac OS X, and Windows Users
- The Novice Guide To Buying A Linux Laptop