Update Source list
Open "Terminal Window", enter "sudo apt-get update"-and "enter the root user's password"--return, you can. If you do not run the command, the direct installation of PHP, "there are several packages cannot be downloaded, you can run Apt-get update------" error, causing the installation cannot be installed.
Install PHP
Open "Terminal Window", enter "sudo apt-get install php5"-and enter "Y"-----the installation is complete.
Let Apache support PHP
Open "Terminal window" and enter "sudo apt-get install LIBAPACHE2-MOD-PHP5"------the installation is complete.
Installing the PHP5-GD module
Open "Terminal window" and enter "sudo apt-get install PHP5-GD"------the installation is complete.
Use Gedit to create a info.php file under "/var/www"
Open "Terminal Window", enter "sudo gedit/var/www/info.php"--Enter "<?php phpinfo ()?>" in the editor and save, the file is created successfully.
Test whether Apache can parse PHP Web pages
Enter "127.0.0.1\info.php" in Firefox and the PHP version information page appears, indicating that the PHP installation configuration was successful.
Installation and configuration of Ubuntu 14.04--php