4

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.

4
  • Check your logs for helpful detail: tail -f /var/log/apache2/error.log Nov 11, 2012 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 127.0.0.1] PHP Parse error: syntax error, unexpected 'version' (T_STRING) in /var/www/index.php on line 1 " Nov 11, 2012 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. Nov 11, 2012 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! Nov 11, 2012 at 6:33

3 Answers 3

8

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.

1

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

1
  • It turns out it was a stupid mistake by me in the document. Thank you for your thoughts! Nov 11, 2012 at 6:34
0

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

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .