June 2016
Beginner
456 pages
9h 31m
English
In this recipe, we will learn how to install PHP and set it to work alongside the Apache web server. We will install PHP binaries and then the Apache module mod_php to support PHP-based dynamic contents.
You will need access to a root account or an account with sudo privileges.
The Apache web server should be installed and working properly.
Follow these steps to serve dynamic contents with PHP:
$ sudo apt-get update $ sudo apt-get install -y php7.0 libapache2-mod-php7.0
$ php -v
index.php under the public_html directory of our site:
$ cd /var/www/example.com/public_html ...Read now
Unlock full access