I have found a question very similar to this, which I thought would solve my problem.

However, after changing my .htaccess file, with index.php on the end of the list, and then index.php as the only entry, I still cannot get index.php to display. Every other page works fine, but I don't know how to fix this. Thanks.

  • Check your logs for helpful detail: tail -f /var/log/apache2/error.log – Lars Rohrbach Nov 11 '12 at 5:52
  • @LarsRohrbach Upon starting Apache2, it says this: "PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib/php5/20100525/msql.so' - /usr/lib/php5/20100525/msql.so: cannot open shared object file: No such file or directory in Unknown on line 0." As well as this for when I try to load index.php: "[Sat Nov 10 21:54:04 2012] [error] [client] PHP Parse error: syntax error, unexpected 'version' (T_STRING) in /var/www/index.php on line 1 " – Jacob Larson Nov 11 '12 at 5:56
  • The contents of index.php itself may be the problem -- you may have a quoting issue on line 1, or perhaps left off the ; at the end. – Lars Rohrbach Nov 11 '12 at 6:18
  • @LarsRohrbach Ah, that was the issue. I simply copy and paste the basic layout for new sites I make, and I accidentally had an invalid, old screw-up. I feel stupid for not looking there before, so thank you for the help! – Jacob Larson Nov 11 '12 at 6:33

With a 500 error, you'll always want to start with checking your logs, in this case:

tail -f /var/log/apache2/error.log

You commented that the error log indicated:

PHP Parse error: syntax error, unexpected 'version' (T_STRING) in /var/www/index.php on line 1

This indicates that the content of index.php itself is likely the problem. Check line 1 for either a quoting issue of some sort (wrong number of quotes?) or perhaps the ; was left off the end of the line.


I think there may be any mistake at .htaccess file

The following resources may help you to resolve the issue

EDIT : I think you also check @Lars Rohrbach comment

tail -f /var/log/apache2/error.log

  • It turns out it was a stupid mistake by me in the document. Thank you for your thoughts! – Jacob Larson Nov 11 '12 at 6:34

Add HttpProtocolOptions Unsafe to your apache config file and restart the apache server. It shows the error details.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.