Debian GNU/Linux 8.4 (jessie)编译安装php.md

本文详细介绍了在Debian GNU/Linux 8.4 (jessie)环境下编译PHP的过程,包括安装php-dev,configure三步安装方法以及遇到的各种错误和解决方案。在编译过程中,可能会遇到bison版本问题、php-config参数不兼容、依赖包缺失等问题,作者提供了查找错误、解决依赖和配置问题的建议,旨在帮助读者成功完成编译。
摘要由CSDN通过智能技术生成

编译遇到的问题很多。网上的文章往往是记录遇到的报错,贴上对应的解决。
而实际的环境,如操作系统,安装的软件必然有差异,所以,更重要的是,如何找到解决方法(不担保按步骤做可以编译成功),并将过程自动化。

安装php-dev

apt-get install php5-dev

安装phpize、autoconf、php-config等configure安装需要的命令

configure 安装三步曲 (configure,make,install三步)

先进入php源码目录

  • ./buildconf --force
  • configure
  • make -j4
  • make install

    获得php原configure参数

    因为要替换包安装的的php,首先获得configure参数

    php-config --configure-options
    xxxx@xxxx:/etc/php5/apache2$ php-config --configure-options
    --prefix=/usr --with-apxs2=/usr/bin/apxs2 --with-config-file-path=/etc/php5/apache2 --with-config-file-scan-dir=/etc/php5/apache2/conf.d --build=x86_64-linux-gnu --host=x86_64-linux-gnu --sysconfdir=/etc --localstatedir=/var --mandir=/usr/share/man --disable-debug --with-regex=php --disable-rpath --disable-static --with-pic --with-layout=GNU --with-pear=/usr/share/php --enable-calendar --enable-sysvsem --enable-sysvshm --enable-sysvmsg --enable-bcmath --with-bz2 --enable-ctype --with-db4 --with-qdbm=/usr --without-gdbm --with-iconv --enable-exif --enable-ftp --with-gettext --enable-mbstring --with-onig=/usr --with-pcre-regex=/usr --enable-shmop --enable-sockets --enable-wddx --with-libxml-dir=/usr --with-zlib --with-kerberos=/usr --with-openssl=/usr --enable-soap --enable-zip --with-mhash=yes --with-system-tzdata --with-mysql-sock=/var/run/mysqld/mysqld.sock --enable-dtrace --without-mm --
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值