centos安裝php7

詳細命令:php

wget -c http://php.net/distributions/php-7.0.22.tar.gzmysql

yum install gdbm-devel libmcrypt libmcrypt-develnginx

可能缺乏的組件sql

yum -y install gcc -yvim

yum install -y libxml2*session

yum install -y ncurses-develphp7

yum install -y openssl openssl-develcurl

yum install -y libcurl-develsocket

yum install libpng -yurl

yum install libpng-devel -y

./configure --prefix=/usr/local/php7 --exec-prefix=/usr/local/php7 --bindir=/usr/local/php7/bin --sbindir=/usr/local/php7/sbin --includedir=/usr/local/php7/include --libdir=/usr/local/php7/lib/php --mandir=/usr/local/php7/php/man --with-config-file-path=/usr/local/php7/etc --with-mysql-sock=/var/lib/mysql/mysql.sock --with-mcrypt=/usr/include --with-mhash --with-mysqli=shared,mysqlnd --with-pdo-mysql=shared,mysqlnd --with-gd --with-iconv --with-zlib --enable-zip --enable-inline-optimization --disable-debug --disable-rpath --enable-shared --enable-xml --enable-bcmath --enable-shmop --enable-sysvsem --enable-mbregex --enable-mbstring --enable-ftp --enable-pcntl --enable-sockets --with-xmlrpc --enable-soap --with-pear --with-gettext --enable-session --with-curl --with-openssl --enable-opcache --enable-fpm --with-fpm-user=nginx --with-fpm-group=nginx --with-gdbm --enable-fileinfo --enable-maintainer-zts

make && make install

cp php.ini-production /usr/local/php7/etc/php.ini

安裝pthreads:

wget -c http://pecl.php.net/get/pthreads-3.1.6.tgz

/usr/local/php7/bin/phpize

./configure --with-php-config=/usr/local/php7/bin/php-config

make && make install

vim /usr/local/php7/etc/php.ini 末尾加一行extension=pthreads.so

extension=pdo_mysql.so

ln -s /usr/local/php7/bin/php /usr/local/bin/php

ln -s /usr/bin/mysql /usr/local/bin/mysql

參考文檔:http://blog.csdn.net/hxmcnu/article/details/53268951

相關文章
相關標籤/搜索