1.下載php7.0.7的源碼包,解壓 cd php-7.0.7php
2. ./configure --with-mysql=mysqlnd --with-mysqli=mysqlnd --with-pdo-mysql=mysqlnd --enable-fpm --with-gd --with-config-file-path=/usr/local/php7/etc --prefix=/usr/local/php7 --with-mcrypt --enable-mbstring --with-openssl html
3.報錯 not found libxml ,解決方式:http://www.xmlsoft.org/downloads.html 下載libxm包.編譯安裝 mysql
4.再次執行第2步redis
5.make (編譯);sql
6.sudo make install vim
7.下面配置一下swoole
sudo cp php.ini-production /usr/local/php7/etc/php.ini php7
cd /usr/local/php7/etccurl
sudo cp php-fpm.conf.default php-fpm.conf socket
sudo cp php-fpm.d/www.conf.default www.conf
cd php-fpm.d
sudo vim www.conf
把user 和 group 都改成www-data
8.啓動php-fpm
cd /usr/local/php7/sbin
sudo ./php-fpm
9.一些必要的擴展的安裝
安裝phpredis
下載源碼 cd phpredis
/usr/local/php7/bin/phpize
./configure --with-php-config=/usr/local/php7/bin/php-config
make
sudo make install
配置文件添加擴展
extension=redis.so
extension=swoole.so
extension_dir=/usr/local/php7/lib/php/extensions/no-debug-non-zts-20151012/
2016/11/4 我又嘗試編譯一次,此次的配置
./configure --enable-fpm \--enable-mbstring --disable-pdo --with-curl --disable-debug --disable-rpath \--enable-inline-optimization --with-zlib --enable-sockets \--enable-sysvsem --enable-sysvshm --enable-pcntl --enable-mbregex \--enable-zip --with-pcre-regex --with-mysql --with-mysqli \--with-gd --with-jpeg-dir --with-mysql=mysqlnd --with-mysqli=mysqlnd --with-pdo-mysql=mysqlnd --enable-fpm --with-gd --with-config-file-path=/usr/local/php/etc --prefix=/usr/local/php --enable-mbstring --with-openssl --enable-pdo