Share error sets and solutions when compiling PHP source code

藏色散人
Release: 2023-04-09 20:36:02
forward
3556 people have browsed it

Share error sets and solutions when compiling PHP source code

Compilation php source code error set and solution

Startup

The server Ubuntu14.04 has a post-lamp development environment , but still can't successfully compile the php source code, here is the compilation process.

Get source code and compile

Make sure git is installedsudo apt-get install git -y, because you can see the content and log information of each PHP modification and follow up with updates from the author.

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
Copy after login

The -v parameter indicates the output version number. If the php version information is output after the command is executed, the compilation is successful.

Share error sets and solutions when compiling PHP source code

Error set

Error

configure: error: xml2-config not found. Please check your libxml2 installation.
Copy after login

Solution
apt-get install libxml2-dev

Error

/usr/bin/mysql_config: No such file or directory
Copy after login

Solution
apt-get install mysql-server mysql-client libmysqlclient-dev

Error

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
Copy after login

Solution
`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`

Error

configure: WARNING: unrecognized options: --with-mysql
Copy after login

Error

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!
Copy after login

Solution
apt-get install bison

Error

configure: error: Cannot find OpenSSL's
Copy after login

Solution
apt-get install libssl-dev

Error

configure: error: Cannot find OpenSSL's libraries
Copy after login

Solution
apt -get install libssl-dev

Error

checking for BZip2 in default path… not found
configure: error: Please reinstall the BZip2 distribution
Copy after login

Solution
apt-get install libbz2-dev

Error

configure: error: Please reinstall the libcurl distribution –
easy.h should be in /include/curl/
Copy after login

Solution
apt-get install libcurl4-openssl-dev

Error

If configure fails try --with-vpx-dir=
configure: error: jpeglib.h not found.
Copy after login

Solution
apt-get install libjpeg- dev

Error

configure: error: png.h not found.
Copy after login

Solution
apt-get install libpng12-dev

Error

configure: error: freetype-config not found.
Copy after login

Solution
apt-get install libfreetype6-dev

Error

configure: error: mcrypt.h not found. Please reinstall libmcrypt.
Copy after login

Solution
apt-get install libmcrypt-dev

Error

configure: error: Cannot find pspell
Copy after login

Solution
apt-get install libpspell-dev

Error

PEAR package PHP_Archive not installed: generated phar will require PHP's phar extension be enabled.
Copy after login

Solution
pear install pear/PHP_Archive

Error

checking for recode support... yes
configure: error: Can not find recode.h anywhere under /usr /usr/local /usr /opt.
Copy after login

Solution
apt-get install librecode-dev

## Recommended learning: "

PHP Video Tutorial"

The above is the detailed content of Share error sets and solutions when compiling PHP source code. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
php
source:segmentfault.com
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!