0

I was learning how to configure LAMP server on Ubuntu machine. I was following the given website

https://www.digitalocean.com/community/tutorials/how-to-install-linux-apache-mysql-php-lamp-stack-on-ubuntu

I created the info.php file using

 sudo nano /var/www/info.php

to contain the following lines

<?php
phpinfo();
?>

Then having restarted the apache2 service using

sudo service apache2 restart

I used the ifconfig command to find the inet address. The line in the output was

inet addr:192.168.64.129  Bcast:192.168.65.255  Mask:255.255.254.0

So, as per the instructions on the link, I typed the following in the address bar of Mozilla browser

http://192.168.64.129/info.php

The tutorial says the a web page similar to

https://assets.digitalocean.com/tutorial_images/HCQEu.png

should open but in my case, the page could not be loaded. The error I received is

The requested URL /info.php was not found on this server.
Apache/2.4.7 (Ubuntu) Server at 192.168.64.129 Port 80

Where am I missing out on?

closed as unclear what you're asking by Jeff Schaller, PersianGulf, dr01, MelBurslan, jimmij Jun 6 '16 at 15:22

Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, it’s hard to tell exactly what you're asking. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.

  • Did you add php as an index file too? – Jeff Schaller Jun 5 '16 at 13:37
  • no...it wasn't there in the instructions – Upendra Pratap Singh Jun 5 '16 at 17:11
  • "After you answer yes to the prompt twice, PHP will install itself. It may also be useful to add php to the directory index, to serve the relevant php index files: sudo nano /etc/apache2/mods-enabled/dir.conf Add index.php to the beginning of index files." – Jeff Schaller Jun 5 '16 at 17:55
1

I believe the default DocumentRoot for apache is /var/www/html, so try moving your php file there by doing:

 sudo mv /var/www/info.php /var/www/html/

If apache then complains that it cannot read the file, try sudo chmod a+r /var/www/html/info.php.

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