Build a local LNMP development environment (4)-Install PHP

Source: Internet
Author: User
Tags gpg

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.