php5.6.22

Disable firewall command:

service iptables stop[stop|start|restart]
Copy the code

View environment variables:

echo $PATH
Copy the code
  1. Resolving dependencies

    To http://ftp.riken.jp/Linux/fedora/epel/ to download epel – release – the latest – 6. Noarch. RPM

   rpm -ivh epel-release-latest-6.noarch.rpm

   yum groups mark install "Development Tools"
   yum groups mark convert "Development Tools"
   yum groupinstall "Development Tools"
   yum -y install libmcrypt libmcrypt-devel mhash mhash-devel mcrypt
   yum -y install libevent libevent-devel
   yum -y install gd gd-devel  libjpeg libjpeg-devel libpng libpng-devel freetype freetype-devel
   yum -y  install libxml2 libxml2-devel
   yum install -y bzip2 bzip2-devel
   yum install -y libcurl libcurl-devel
   yum install openssl openssl-devel
Copy the code
  1. Decompress compile install
The tar ZXVF PHP - 5.6.22. Tar. GzcdPHP - 5.6.22Copy the code
   ./configure --prefix=/usr/local/php 
Copy the code
--with-mysql=mysqlnd \ --with-mysqli=mysqlnd \ --with-pdo-mysql=mysqlnd \ --with-openssl \ --enable-fpm \ --enable-gd-native-ttf \ --enable-soap \ --enable-sockets \ --enable-sysvshm \ --enable-mbstring \ --with-freetype-dir \  --with-jpeg-dir \ --with-png-dir \ --with-zlib-dir \ --with-gd \ --with-libxml-dir=/usr/ \ --enable-xml \ --with-mhash \ --with-mcrypt \ --with-bz2 \ --with-curl \ --with-fpm-user=php \ --with-fpm-group=php \ --with-config-file-path=/etc \  --with-config-file-scan-dir=/etc/php.dCopy the code
   make
   make install
Copy the code

The default php.ini directory is /usr/local/php.lib

Create directory mkdir -p /usr/local/php.lib/php

  1. PHP startup script
   cp sapi/fpm/init.d.php-fpm /etc/init.d/php-fpm
   chmod +x /etc/init.d/php-fpm
Copy the code
  1. The configuration file
   cp php.ini-production /etc/php.ini
   cd /usr/local/ PHP cp /etc/php-fpm.conf. default /etc/php-fpm. conf vi /etc/php-fpm. conf modify user = nginx group = nginxCopy the code
  1. Zend-loader-php extension installed
The tar - ZXVF zend loader - php5.6 - Linux - x86_64. Tar. GzcdZend loader - php5.6 - Linux - x86_64 cp ZendGuardLoader. So/usr /local/php/lib/php/
Copy the code
Configure download edit php.ini and finally add: [Zend]Copy the code
	zend_extension=/usr/local/php/lib/php/ZendGuardLoader.so
Copy the code
  1. Swoole extended installation
Wget https://github.com/swoole/swoole-src/archive/swoole-1.7.6-stable.tar.gz 1 tar ZXVF swoole - 1.7.6 - stable. Tar. Gzcd/configure make && make installCopy the code

If you can’t find phpize, go to the bin folder in your PHP installation location and run phpize.

/configure –with-php-config=/usr/local/ PHP /bin/php-config /configure –with-php-config=/usr/local/ PHP /bin/php-config

  1. PHP installation zip extension
   wget http://pecl.php.net/get/zip
   tar -zvxf zip
   cdZip-1.14.0 phpize./configure make make installCopy the code

/configure –with-php-config=/usr/local/ PHP /bin/php-config Libzip is missing.

Wget https://nih.at/libzip/libzip-1.2.0.tar.gz tar - ZXVF libzip - 1.2.0. Tar. GzcdLibzip-1.2.0./configure make make installCopy the code

If ‘zipconf.h’ is not found when installing libzip./configure, or the file variable is not defined, because the header file is not found.

find /usr/local -iname 'zipconf.h' 
Copy the code

After finding this file;

   ln -s /usr/local/lib/libzip/include/zipconf.h /usr/local/include
Copy the code

And then compile it;

Finally, modify php.ini to add post-compile extensions and restart php-fpm.

  1. Configuring self-start
   chkconfig --add php-fpm
   chkconfig php-fpm on
Copy the code