Phase 26 20180731 php5 install PHP7 Install

Source: Internet
Author: User
Tags bz2 install openssl soap mcrypt

July 31 Task

11.10/11.11/11.12 installation PHP5
11.13 Installing PHP7
What exactly is mysql,mysqli,mysqlnd,pdo in PHP http://blog.csdn.net/u013785951/article/details/60876816
View compilation Parameters http://ask.apelearn.com/question/1295



Install the PHP5 on the aming1.

The installation order is there is an arrangement, first MySQL after PHP

  1. To the src directory, download, unzip. bz2 file Extract command,tar-xvf

  2. cd PHP directory, and then execute the Configure command to compile:/configure--prefix=/usr/local/php--with-apxs2=/usr/local/apache2/bin/apxs-- With-config-file-path=/usr/local/php/etc--with-mysql=/usr/local/mysql--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-exif. The front is mainly Apache module installation, followed by PHP

    An error occurred while executing the compilation.

    Is that OpenSSL can not find, yum find, actually need to install is yum install OpenSSL openssl-devel. Continue compiling.

    Next comes another mistake, the solution yum install Bzip2-devel

    Next, there was a mistake, libpng missing, installed with this command. Yum Install Libjpeg-devel

    No accident, there is a mistake. , yum install Freetype-devel

    A new error appears,. Because this package belongs to the Epel extension library, you need to install the Epel extension Library in advance if necessary. Then yum install Libmcrypt-devel.

    Compilation succeeded.

  3. Next is the Make,make install. The location of the installation is/usr/local/php

  4. You can see that there is a. so file, which is a combination of PHP and Apache files.

  5. View the commands for the static modules loaded under PHP. bin/under Php-m. In fact, PHP is a module of httpd exists.

  6. PHP information can be viewed via/usr/local/php/bin/php-i

  7. Copy the configuration file to/php/etc. Cp/usr/local/src/php-5.6.32/php.ini-production/usr/local/php/etc/php.ini






CentOS7 installed in Aming1

Note that there is no--with-mysql at the time of translation

./configure--prefix=/usr/local/php--with-apxs2=/usr/local/apache2/bin/apxs--with-config-file-path=/usr/local/ Php/etc--with-mysql=/usr/local/mysql--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-exif 


Make


Make install


Complete the installation. But the thing to know is that an Apache can only call one PHP at a time, so specify which PHP to use

As you can see, loads of several php,5 and 7 are loaded.


How to choose which one to use? To the configuration file.

Vim/usr/local/apache2/conf/httpd.conf

You will find two PHP modules and comment out the unwanted one.


Phase 26 20180731 php5 install PHP7 Install

Related Article

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.