分享编译php源码错误集与解决方案

藏色散人
发布: 2021-03-26 17:54:16
转载
3739人浏览过

分享编译php源码错误集与解决方案

编译php源码错误集与解决

起步

服务器Ubuntu14.04已后lamp开发环境,却还是没有不能顺利编译php源码,在此整理编译过程。

获取源码与编译

确保已安装了gitsudo apt-get install git -y,因为这可以看到PHP每次修改的内容及日志信息和跟进作者的更新。

git clone https://github.com/php/php-src.git
cd php-src
sudo apt-get install build-essential
./buildconf
./configure --disable-all # 为了尽快得到可以测试的环境,我们仅编译一个最精简的PHP
make
./sapi/cli/php -v
登录后复制

-v参数表示输出版本号,如果命令执行完后看到输出php版本信息则说明编译成功。

立即学习PHP免费学习笔记(深入)”;

1bccdb69ac82e663b588de791c76528.png

错误集

错误

configure: error: xml2-config not found. Please check your libxml2 installation.
登录后复制

解决
apt-get install libxml2-dev

错误

/usr/bin/mysql_config: No such file or directory
登录后复制

解决
apt-get install mysql-server mysql-client libmysqlclient-dev

错误

Warning: Declaration of PEAR_Installer::download() should be compatible with & PEAR_Downloader::download($params) in phar:///root/php7/php-src/pear/install-pear-nozlib.phar/PEAR/Installer.php on line 43

Warning: Declaration of PEAR_PackageFile_Parser_v2::parse() should be compatible with PEAR_XMLParser::parse($data) in phar:///root/php7/php-src/pear/install-pear-nozlib.phar/PEAR/PackageFile/Parser/v2.php on line 113
[PEAR] Archive_Tar - installed: 1.3.13
[PEAR] Console_Getopt - installed: 1.3.1
[PEAR] Structures_Graph- installed: 1.0.4

Warning: Declaration of PEAR_Task_Replace::init() should be compatible with PEAR_Task_Common::init($xml, $fileAttributes, $lastVersion) in phar:///root/php7/php-src/pear/install-pear-nozlib.phar/PEAR/Task/Replace.php on line 31
[PEAR] XML_Util - installed: 1.2.3

Warning: Declaration of PEAR_Task_Windowseol::init() should be compatible with PEAR_Task_Common::init($xml, $fileAttributes, $lastVersion) in phar:///root/php7/php-src/pear/install-pear-nozlib.phar/PEAR/Task/Windowseol.php on line 76

Warning: Declaration of PEAR_Task_Unixeol::init() should be compatible with PEAR_Task_Common::init($xml, $fileAttributes, $lastVersion) in phar:///root/php7/php-src/pear/install-pear-nozlib.phar/PEAR/Task/Unixeol.php on line 76
[PEAR] PEAR - installed: 1.9.5
Wrote PEAR system config file at: /root/php7/usr/etc/pear.conf
登录后复制

解决
`You may want to add: /root/php7/usr/lib/php to your php.ini include_path
/root/php7/php-src/build/shtool install -c ext/phar/phar.phar /root/php7/usr/bin`

错误

configure: WARNING: unrecognized options: --with-mysql
登录后复制

错误

checking for bison version... invalid
configure: WARNING: This bison version is not supported for regeneration of the Zend/PHP parsers (found: none, min: 204, excluded: ).
checking for re2c... no
configure: WARNING: You will need re2c 0.13.4 or later if you want to regenerate PHP parsers.
configure: error: bison is required to build PHP/Zend when building a GIT checkout!
登录后复制

解决
apt-get install bison

错误

configure: error: Cannot find OpenSSL's
登录后复制

解决
apt-get install libssl-dev

错误

configure: error: Cannot find OpenSSL's libraries
登录后复制

解决
apt-get install libssl-dev

错误

checking for BZip2 in default path… not found
configure: error: Please reinstall the BZip2 distribution
登录后复制

解决
apt-get install libbz2-dev

错误

configure: error: Please reinstall the libcurl distribution –
easy.h should be in /include/curl/
登录后复制

解决
apt-get install libcurl4-openssl-dev

错误

If configure fails try --with-vpx-dir=
configure: error: jpeglib.h not found.
登录后复制

解决
apt-get install libjpeg-dev

错误

configure: error: png.h not found.
登录后复制

解决
apt-get install libpng12-dev

错误

configure: error: freetype-config not found.
登录后复制

解决
apt-get install libfreetype6-dev

错误

configure: error: mcrypt.h not found. Please reinstall libmcrypt.
登录后复制

解决
apt-get install libmcrypt-dev

错误

configure: error: Cannot find pspell
登录后复制

解决
apt-get install libpspell-dev

错误

PEAR package PHP_Archive not installed: generated phar will require PHP's phar extension be enabled.
登录后复制

解决
pear install pear/PHP_Archive

错误

checking for recode support... yes
configure: error: Can not find recode.h anywhere under /usr /usr/local /usr /opt.
登录后复制

解决
apt-get install librecode-dev

推荐学习:《PHP视频教程》

以上就是分享编译php源码错误集与解决方案的详细内容,更多请关注php中文网其它相关文章!

PHP速学教程(入门到精通)
PHP速学教程(入门到精通)

PHP怎么学习?PHP怎么入门?PHP在哪学?PHP怎么学才快?不用担心,这里为大家提供了PHP速学教程(入门到精通),有需要的小伙伴保存下载就能学习啦!

下载
相关标签:
来源:segmentfault网
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系admin@php.cn
最新问题
开源免费商场系统广告
热门教程
更多>
最新下载
更多>
网站特效
网站源码
网站素材
前端模板
关于我们 免责申明 意见反馈 讲师合作 广告合作 最新更新
php中文网:公益在线php培训,帮助PHP学习者快速成长!
关注服务号 技术交流群
PHP中文网订阅号
每天精选资源文章推送
PHP中文网APP
随时随地碎片化学习
PHP中文网抖音号
发现有趣的

Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号