php7安装配置

php 7

yum install epel-release -y
yum -y install gcc gcc-c++ autoconf libjpeg libjpeg-devel libpng libpng-devel freetype freetype-devel libxml2 libxml2-devel zlib zlib-devel glibc glibc-devel glib2 glib2-devel bzip2 bzip2-devel ncurses ncurses-devel curl curl-devel e2fsprogs e2fsprogs-devel krb5 krb5-devel libidn libidn-devel openssl openssl-devel openldap openldap-devel nss_ldap openldap-clients openldap-servers  mysql-devel  perl-CPAN      gd-devel gd  iconv libmcrypt


echo "usr/local/lib"  >> /etc/ld.so.conf

ldconfig


wget -c http://cn.php.net/distributions/php-7.1.8.tar.xz


 ./configure    --prefix=/usr/local/webserver7/php   --with-config-file-path=/usr/local/webserver7/php/etc   --enable-mysqlnd   --with-pdo-mysql   --with-mysqli=/usr/bin/mysql_config   --with-iconv=/usr/local   --with-freetype-dir   --with-jpeg-dir   --with-png-dir   --with-zlib   --with-libxml-dir=/usr   --enable-xml   --disable-rpath   --enable-bcmath   --enable-shmop   --enable-sysvsem   --enable-inline-optimization   --with-curl   --enable-mbregex   --enable-fpm   --enable-mbstring   --with-mcrypt   --with-gd   --enable-gd-native-ttf   --with-openssl   --enable-opcache   --with-mhash   --enable-pcntl   --enable-sockets   --with-ldap   --with-ldap-sasl   --with-xmlrpc   --enable-zip   --enable-soap   --without-pear   --with-fpm-user=www   --with-fpm-group=www


make && make install 


安装rabbitmq

https://github.com/alanxz/rabbitmq-c/releases/download/v0.7.1/rabbitmq-c-0.7.1.tar.gz

tar xf rabbitmq-c-0.7.1.tar.gz
autoreconf -i --force
./configure  --prefix=/usr/local/rabbitmq-c  &&  make  && make install


安装amqp

/usr/local/webserver7/php/bin/phpize  &&  ./configure --with-php-config=/usr/local/webserver7/php/bin/php-config --with-amqp --with-librabbitmq-dir=/usr/local/rabbitmq-c


安装mongo扩展

  wget  https://pecl.php.net/get/mongo-1.6.14.tgz
  tar xf mongo-1.6.14.tgz && cd   mongo-1.6.14
  /usr/local/webserver7/php/bin/phpize
    ./configure --with-php-config=/usr/local/webserver7/php/bin/php-config 
   make && make instal

安装redis扩展
 wget https://pecl.php.net/get/redis-3.1.3.tgz
 tar xf redis-3.1.3.tgz 
 cd redis-3.1.3
  /usr/local/webserver7/php/bin/phpize
./configure --with-php-config=/usr/local/webserver7/php/bin/php-config
  make
 make install

安装yaf扩展
yaf3 以上只支持 php7
php6 使用 yaf2 版本

 php7 编译 yaf
#http://pecl.php.net/get/yaf-3.0.tgz
# tar xf yaf-3.0.tgz 
# cd yaf-3.0/
# /usr/local/webserver7/php/bin/phpize 
#./configure --with-php-config=/usr/local/webserver7/php/bin/php-config 
#make && make install

安装swoole 扩展

# git clone https://github.com/swoole/swoole-src.git
# cd swoole-src/
# /usr/local/webserver7/php/bin/phpize
# ./configure --with-php-config=/usr/local/webserver7/php/bin/php-config
#make && make install
 
配置文件里加入扩展模块


 #cp /usr/src/php-7.18/php.ini-production /usr/local/webserver7/php/etc/php.ini
 # 在php.ini 加入以下内容
extension=amqp.so
extension=difeye.so
extension=msgpack.so
extension=redis.so
extension=swoole.so
extension=yaf.so
 
[opcache]

zend_extension=opcache.so

opcache.enable=1​

 

查看扩展
 /usr/local/webserver7/php/bin/php -m