ubuntu14.0.4 php7的编译安装

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

相关文章
相关标签/搜索