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

分享编译php源码错误集与解决方案,第1张

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

编译PHP源码错误集与解决

起步

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

获取源码与编译

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

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

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

错误集

错误

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 43Warning: 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.4Warning: 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.3Warning: 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 76Warning: 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.5Wrote 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... invalidconfigure: WARNING: This bison version is not supported for regeneration of the Zend/PHP parsers (found: none, min: 204, excluded: ).checking for re2c... noconfigure: 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 foundconfigure: 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... yesconfigure: error: Can not find recode.h anywhere under /usr /usr/local /usr /opt.

解决
apt-get install librecode-dev

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

总结

以上是内存溢出为你收集整理的分享编译php源码错误集与解决方案全部内容,希望文章能够帮你解决分享编译php源码错误集与解决方案所遇到的程序开发问题。

如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。

欢迎分享,转载请注明来源:内存溢出

原文地址: http://outofmemory.cn/langs/1159776.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-06-01
下一篇 2022-06-01

发表评论

登录后才能评论

评论列表(0条)

保存