BastiaanWW BastiaanWW - 2 months ago 6
HTTP Question

Why does my script return: HTTP ERROR 500

There is a folder on my apache server containing several php scripts. All the php scripts in this folder work except for 1. All the php scripts including the script that doesn't work have the same rights.

When I run the script in my browser I get this error:

HTTP ERROR 500


Details that may be helpful:

PHP Version 7.0.11
Apache/2.2.15 (CentOS)

Answer

An Apache status code of 500 means "internal server error". Without seeing the code that is producing this error it is hard to say what is causing it but the first things to check are server configuration and your .htaccess file. Make sure your server is running properly then check your .htaccess file as a bad rule can force some types of PHP to malfunction. As @RiggsFolly stated, it is also possible that the problem is some very poorly written PHP which can be tested by replacing it with a simple program like: <?php echo "test"; ?>