Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I have been following this tutorial

http://www.howtoforge.com/installing-apache2-with-php5-and-mysql-support-on-ubuntu-12.04-lts-lamp

And I have got to the part where I am running a simple test to determine whether php has been installed properly

the installation went fine, I installed php5 using the following command apt-get install php5 libapache2-mod-php5 and I then restarted the server.

to see whether php5 has been installed I did the following

created a file vi /var/www/info.php

edited the file <?php phpinfo(); ?>

after trying to run it on my server I get a 404 Not Found error. What could be the problem?

share|improve this question
    
Try changing the permission of files under /var/www and check localhost/info.php –  devav2 Sep 5 '12 at 14:50
    
@devav2 Im not running the server on my computer I can't use local host, but I'll look into changing permissions –  mk_89 Sep 5 '12 at 14:52
    
okay got you :) –  devav2 Sep 5 '12 at 14:54
    
If the apache place holder worked for you but the php info did not try sudo chown -R www-data:www-data /var/www –  damien Sep 6 '12 at 2:42
add comment

1 Answer

If it is a permission problem it should return 403, not 404. Check the files in /etc/apache2/sites-enabled/ . There is probably only one file (000-default) if you didn't create any new hostnames yourself. Does it say 'DocumentRoot /var/www' ? And does it say:

<Directory /var/www/>
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Order allow,deny
allow from all
</Directory>`

Somewhere?

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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