PHP can also be compiled with the source installation, and can be installed using the Package management tool, the latter is used here.
The PHP version provided by the official Debian source may be older, and if you want to use a newer version of PHP, you can fix it by modifying the apt source.
Start Running Wheezy
Connect to Debian
Input
Php–v
You can see that PHP is not installed yet
This is a newer version of PHP, provided by Dotdeb, which uses dotdeb PHP
Add the GPG key provided by Dotdeb first
wget https://www.dotdeb.org/dotdeb.gpgapt-key Add DOTDEB.GPG
Input
Vim/etc/apt/sources.list
Open APT Source configuration
Add the following two lines to the configuration file (using the php55 provided by Dotdeb)
Deb http://packages.dotdeb.org wheezy-php55 alldeb-src http://packages.dotdeb.org wheezy-php55 All
Save and exit.
Input
Apt-get Update
More package information, you can see that the php55 source provided by Dotdeb has been used
Start installing PHP55 now.
If you use apt to install PHP, the related components of Apache will be installed automatically and you can install PHP5-FPM directly to avoid this problem.
Input
Apt-cache Show PHP5-FPM
See a bunch of php5-fpm information, the top ranked first, is provided by Dotdeb
Input
Apt-get Install PHP5-FPM
Start installing PHP5-FPM
Because PHP5-FPM relies on php5 (that is, the Php5-common package), PHP5 is also installed together
You also need to install a php5-cli so that you can use the PHP command at the command line
Input
Apt-get Install PHP5-CLI
Y
Input
Php–v
You can see the version of PHP
Input
Service PHP5 Status
You can see that PHP is already running
Install a few common extensions
Input
Apt-get Install Php5-curl php5-gd php5-memcache Php5-redis
Y
Start installation
PHP installation is complete, configuration, etc. later.
The end of this article.
Build a local LNMP development environment (4)-Install PHP