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
To the src directory, download, unzip. bz2 file Extract command,tar-xvf
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.
Next is the Make,make install. The location of the installation is/usr/local/php
You can see that there is a. so file, which is a combination of PHP and Apache files.
View the commands for the static modules loaded under PHP. bin/under Php-m. In fact, PHP is a module of httpd exists.
PHP information can be viewed via/usr/local/php/bin/php-i
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