Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I've successfully installed LAMP and created some virtual hosts. Everything is working fine except index.php files.

When I try access them, browser returns 500 Error, regardless of their content. All other PHP files are working fine, index.html files can be opened without any errors. Please, help me to resolve this problem. I guess something wrong with server configuration, but I didn't find what exactly.

share|improve this question

closed as too localized by Jorge Castro, James Feb 25 '12 at 13:41

This question is unlikely to help any future visitors; it is only relevant to a small geographic area, a specific moment in time, or an extraordinarily narrow situation that is not generally applicable to the worldwide audience of the internet. For help making this question more broadly applicable, visit the help center.If this question can be reworded to fit the rules in the help center, please edit the question.

Please add the fullpath to where your index.php file is located and also the output of the shell command ls -l /fullpath/to/index.php . Press ctrl+alt+t to open a terminal. Also add the content of the index.php file you are trying. – lpanebr Nov 21 '11 at 22:55
Try open a shell and type php foo.php and php -l foo.php. You may also check your settings with the script <?php phpinfo(); ?>. – Anonymous Nov 21 '11 at 23:14
The fullpath of my index file is: /home/stas/projects/dreamsblock/index.php – Stas Nov 22 '11 at 0:16
Here is the result of ls - l command: -rw------- 1 stas stas 241 2011-11-21 13:31 – Stas Nov 22 '11 at 0:18
The contents of index.php file is simply: <?php echo 'test'; ?>. I checked the settings with phpinfo(); but they seems ok. Could you suggest me what exact setting I should check? – Stas Nov 22 '11 at 0:23
up vote 2 down vote accepted

I've solved this issue. The problem was with CHMOD of my virtual host directory. I set chmod value to 755 and it began to work :)). Sorry for bothering with such stupid question.

share|improve this answer

I think you should check Apache error log:

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

That would give you some hints

share|improve this answer

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