I have no background in PHP, I don't have a public IP address nor a domain, but I want to create a website; to install LAMP I followed the instructions here, but my script does not seem to work.
I have tried adding a little space after the parenthesis symbol, but I get the error as the one on the image.
libapache2-mod-php5
installed? Have you restarted Apache after installing php? Or reloaded:sudo service apache2 reload
? – Benjamin Maurer Jan 29 '16 at 08:44/var/www/html
. That corresponds to127.0.0.1
. If you put the file in say/var/www/html/phptest
you'll need to go to127.0.0.1/phptest/phpinfo.php
. – kos Jan 29 '16 at 09:01Testing PHP5 and MySQL In order to test PHP script you need to create simple PHP script in directory /var/www/html. in this case I’ll create phpinfo.php:
sudo touch /var/www/html/phpinfo.php sudo nano /var/www/html/phpinfo.php Add the following line into file /var/www/html/phpinfo.php
Save and Test the php script you have made from web browser by typing in address bar http://ip_address/phpinfo.php. It will appear like screenshot on below.
– Ken Sandoval Jan 29 '16 at 09:02sudo service apache2 restart
please and try it again – Benjamin Maurer Jan 29 '16 at 09:11sudo apache2ctl -M | grep php
give ya? Trying to find out if php5_module was loaded. My suspicion: apache2ctl -M won't list php5_module. I think the tutorial is bogus. If php5_module wasn't installed automatically, it can't work. See this tutorial, where they install it: https://www.digitalocean.com/community/tutorials/how-to-install-linux-apache-mysql-php-lamp-stack-on-ubuntu-14-04 – Benjamin Maurer Jan 29 '16 at 09:23127.0.1.1 UBUNTUSERVER
in/etc/host
to suppress the message from the first screenshot - http://askubuntu.com/questions/811098/when-i-run-a-sudo-command-it-says-unable-to-resolve-host/811113#811113 – pa4080 Dec 09 '16 at 16:13