php源码编译安装无敌篇

php源码编译安装

系统 Centos8.2

下载最新的php包

https://www.php.net/downloads

解压后进入包的目录进行一些php配置

./configure --prefix=/usr/local/php \
--with-config-file-path=/usr/local/php/etc \
--enable-inline-optimization \
--disable-debug \
--disable-rpath \
--enable-shared \
--enable-opcache \
--enable-fpm \
--with-fpm-user=www \
--with-fpm-group=www \
--with-mysqli=mysqlnd \
--with-pdo-mysql=mysqlnd \
--with-gettext \
--with-iconv \
--with-mhash \
--with-openssl \
--enable-bcmath \
--enable-soap \
--enable-pcntl \
--enable-shmop \
--enable-sysvmsg \
--enable-sysvsem \
--enable-sysvshm \
--enable-sockets \
--with-curl \
--with-zlib \
--with-bz2 \
--with-readline \
--without-sqlite3 \
--without-pdo-sqlite \
--with-pear \
--enable-maintainer-zts \
--enable-dtrace 
  • –prefix=/usr/local/php 指定php安装路径
  • –with-config-file-path=/usr/local/php/etc 指定自己的php.ini路径 然后从源码里面 cp过去php.ini 源码里面有个php.ini-development和php.ini-production 如果不是本地调试模式的 选择后者。
  • –enable-fpm 运行php-fpm
  • –with-fpm-user=www 运行用户

报错

  • configure: error: Cannot find sys/sdt.h which is required for DTrace support

解决:

yum install -y systemtap systemtap-devel systemtap-sdt-devel

  • configure: error: Package requirements (libxml-2.0 >= 2.7.6) were not met

解决:

yum install -y libxml2-devel

  • configure: error: Package requirements (openssl >= 1.0.1) were not met

解决

yum -y install openssl openssl-devel

  • configure: error: Please reinstall the BZip2 distribution

解决

yum -y install bzip2 bzip2-devel

  • configure: error: Package requirements (libcurl >= 7.15.5) were not met

解决

yum -y install curl-devel

  • checking for oniguruma... no configure: error: Package requirements (oniguruma) were not met

解决

  • configure: error: Please reinstall readline - I cannot find readline.h

解决

yum -y install readline-devel

安装

make && make install

  • 1
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值