Linux Learning Summary (32) Lamp PHP Installation

Source: Internet
Author: User

PHP official website www.php.net
Current mainstream version is 5.6/7.1

cd /usr/local/src/ wget http://cn2.php.net/distributions/php-5.6.30.tar.gztar zxf php-5.6.30.tar.gzcd php-5.6.30./configure --prefix=/usr/local/php --with-apxs2=/usr/local/apache2.4/bin/apxs --with-config-file-path=/usr/local/php/etc  

The lengthy troubleshooting process starts below

Yum provides xml2-config
Yum install-y libxml2-devel

Yum list |grep-i OpenSSL
Yum I Nstall-y OpenSSL openssl-devel

Yum install-y bzip2-devel

Yum install-y libjpeg-devel

Yum Install -y libpng-devel

Yum install-y freetype-devel

Yum install-y epel-release
Yum install-y Libmcrypt-devel
continue./configure.
Make && make install
CP php.ini-production/usr/local/php/etc/php.ini//copy config file
After the installation is complete, we look for the PHP module we want libphp5.so
Ls/usr/local/apache2.4/modules/libphp5.so can find
Du-sh!$ see its size, found around 36M
This shows that we have successfully installed PHP
PHP7 installation
method is the same as PHP5, that is./configure when you change the installation path, and the configuration file path

cd /usr/local/src/ wget http://cn2.php.net/distributions/php-7.1.6.tar.bz2tar zxf php-7.1.6.tar.bz2cd php-7.1.6./configure --prefix=/usr/local/php7 --with-apxs2=/usr/local/apache2.4/bin/apxs --with-config-file-path=/usr/local/php7/etc  --with-pdo-mysql=/usr/local/mysql --with-mysqli=/usr/local/mysql/bin/mysql_config --with-libxml-dir --with-gd --with-jpeg-dir --with-png-dir --with-freetype-dir --with-iconv-dir --with-zlib-dir --with-bz2 --with-openssl --with-mcrypt --enable-soap --enable-gd-native-ttf --enable-mbstring --enable-sockets --enable-exifmake && make install

ls/usr/local/apache2.4/modules/libphp*


CP Php.ini-production/usr/local/php7/etc/php.ini
Finally, we summarize the packages to be downloaded:

 yum install -y libxml2-devel yum install -y openssl openssl-devel yum install -y bzip2-devel yum install -y libjpeg-devel yum install -y libpng-devel yum install -y freetype-devel yum install -y epel-release yum install -y libmcrypt-devel

Linux Learning Summary (32) Lamp PHP Installation

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.