Records of errors and solutions encountered when manually compiling and installing PHP

WBOY
Release: 2016-08-08 09:29:46
Original
1309 people have browsed it

configure error xml2-config not found. please check your libxml2 installation
centos 6.5 Install PHP 5.6 report configure error xml2-config not found. please check your libxml2 installation error

Check whether the libxm package is installed

[root@ rh-linux software]# rpm -qa |grep libxml2
libxml2-2.6.26-2.1.12
libxml2-python-2.6.26-2.1.12

Reinstall the libxml2 and libxml2-devel packages. When installing yum, if you find a new version, you will be prompted to update. If you need to update, you can update it. Don't skip it.

[root@rh-linux /]# yum install libxml2
[root@rh-linux /]# yum install libxml2-devel -y

After installation, check whether the xml2-config file exists

[root@rh-linux /] # find / -name “xml2-config”
/usr/bin/xml2-config

When compiling and installing php, I encountered virtual memory exhausted: Cannot allocate memory

Sometimes when building a website with vps, you need to install the host control panel through compilation. For VPS with large memory, it is generally not a big problem, but for VPS with small memory, such as 512MB memory, problems are likely to occur, because the compilation process is a large memory consumption action.
I have recently encountered such a problem: when compiling and installing a domestic host control panel on a VPS with a 512MB memory centos operating system, there is the following error record in the log when compiling and installing php:

virtual memory exhausted: Cannot allocate memory make :*
[ext/fileinfo/libmagic/apprentice.lo] Error 1

The solution at the beginning is to close many processes first, such as httpd, ftpd, sendmail, etc., release some memory, and then compile, still Got the same compilation error. Later, Baidu and Google searched for a long time to find a solution to the problem, and the solution was found on php.net. The original link is: https://bugs.php.net/bug.php?id=48809
You can see in the reply

Adding –disable-fileinfo to ./configure solves the problem.

According to the method of this article, add the configuration in quotes (excluding quotes) "-disable" to the php installation configuration file -fileinfo" and finally the compilation passed. Shared here for reference.

The above introduces the errors encountered during manual compilation and installation of PHP and the records of solutions, including the relevant content. I hope it will be helpful to friends who are interested in PHP tutorials.

Related labels:
source:php.cn
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
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!