In Ubuntu 12.04 LTS, use
sudo apt-get install PHP5-FPM
The PHP version installed is PHP5.3, if you want to use the YII2 or laravel framework, the PHP version is at least 5.4+, so upgrade.
Upgrade steps
Initialize the operation:
sudo apt-get updatesudo apt-get install python-software-properties
Update the PPA Source:
sudo add-apt-repository ppa:ondrej/php5
If you just want to upgrade to 5.4, execute the following command:
sudo add-apt-repository ppa:ondrej/php5-oldstable
Next, perform updates and upgrades:
sudo apt-get updatesudo apt-get dist-upgrade
Executing the command php-v will find that the update was successful.
Note 1
If the previous Nginx configured listening 9000 port to process PHP, then to listen to the UNIX socket, otherwise the PHP page will not be opened correctly. Upcoming
Fastcgi_pass 127.0.0.1:9000;
Change into
Fastcgi_pass Unix:/var/run/php5-fpm.sock;
NOTE 2
The difference between upgrade and Dist-upgrade:
Dist-upgrade will identify and deal with situations where dependency changes are made, and upgrade does not deal with this situation.