编译 php7,编译PHP7

环境准备:centos7

安装扩展源:

sudo yum install -y release

安装基础支持

sudo yum install -y freetype-devel libevent libevent-devel libxml2 libxml2-devel ncurses ncurses-devel openssl openssl-devel libjpeg libjpeg-devel libpng libpng–devel zlib-devel bzip2 bzip2-devel libmcrypt libmcrypt-devel

configure

./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=/usr/local/mysql/mysql.sock --with-mcrypt=/usr/include --with-mhash --with-openssl --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-gd-native-ttf --enable-pcntl --enable-sockets --with-xmlrpc --enable-soap --without-pear --with-gettext --enable-session --with-curl --with-jpeg-dir --with-freetype-dir --enable-fpm --with-fpm-user=nginx --with-fpm-group=www --without-gdbm --disable-fileinfo --enable-opcache

make

make

安装(make install)

sudo make install

配置

复制php.ini文件

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

sudo vi /usr/local/php7/etc/php.ini

复制fpm配置文件

cd /usr/local/php7/etc

sudo mv php-fpm.conf.default php-fpm.conf

sudo mv php-fpm.d/www.conf.defualt php-fpm.d/www.conf

服务管理和开机启动

cd /usr/src/php-7.0.0/sapi/fpm

ls

# centos7 systemctl 管理

sudo php-fpm.service /usr/lib/systemd/system/

sudo systemctl enable php-fpm.service

sudo systemctl start php-fpm.service

# centos6 chkconfig 管理

sudo cp init.d.php-fpm /etc/init.d/php-fpm

sudo chmod +x /etc/init.d/php-fpm

sudo chkconfig --add php-fpm

sudo chkconfig php-fpm on

这样,就可以通过sevice php-fpm start将服务启动,然后ps -ef | grep php检查下进程试试。

相关链接

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值