Pre-Installation Preparation
Yum Groupinstall "Development tools"
Yum install-y gcc gcc-c++ autoconf libjpeg libjpeg-devel libpng libpng-devel freetype freetype-devel libpng libpng-devel LIBXML2 libxml2-devel zlib zlib-devel glibc glibc-devel glib2 glib2-devel bzip2 bzip2-devel ncurses Curl Curl-devel openss L-devel gdbm-devel db4-devel libxpm-devel libx11-devel gd-devel gmp-devel readline-devel libxslt-devel expat-devel Xmlrpc-c Xmlrpc-c-devel
Config configuration
./configure--prefix=/usr/local/php--with-apxs2=/usr/local/apache/bin/apxs--enable-fpm--with-curl--with-openssl --enable-mbregex--with-mysql--with-mysqli--with-mysql-sock--enable-pdo--with-pdo-mysql--with-pdo-sqlite-- Enable-mysqlnd--with-gd--enable-gd-native-ttf--enable-exif--with-jpeg-dir=/usr/local/jpeg--with-png-dir=/usr/ Local/png--with-freetype-dir=/usr/local/freetype--enable-gd-jis-conv--with-gettext--with-zlib--enable-zip-- with-bz2--disable-fileinfo--enable-xmlreader--enable-xmlwriter--with-xmlrpc--enable-mbstring-- Enable-inline-optimization
Copying a configuration file
CP Php.ini-development/usr/local/php/lib/php.ini
Date.timezone =asia/shanghai
The problem arises when PHP installation appears sorry, I cannot run APXS. Error resolution method
Open Apache Apxs file
Tell the first line of files #!/replace/with/path/to/perl/interpreter-w
Replace with #!/usr/bin/perl-w
Save to continue compiling
Timezone Asia/shanghai
The above describes the CentOS compilation installation php56, including the aspects of the content, I hope that the PHP tutorial interested in a friend helpful.