TroodoN-Mike
TroodoN-Mike

Reputation: 16185

How to fix error with xml2-config not found when installing PHP from sources?

When I try to install php 5.3 stable from source on Ubuntu (downloading compressed installation file from http://www.php.net/downloads.php) and I run ./configure I get this error:

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

Upvotes: 230

Views: 188825

Answers (6)

silver
silver

Reputation: 1703

I had the same issue when I used a DockerFile. My Docker is based on the php:5.5-apache image.

I got that error when executing the command RUN docker-php-ext-install soap

I have solved it by adding the following command to my Dockerfile:

RUN apt-get update && apt-get install -y libxml2-dev

Upvotes: 12

O. Kasule
O. Kasule

Reputation: 21

OpenSuse

"sudo zypper install libxml2-devel"

It will install any other dependencies or required packages/libraries

Upvotes: 0

Dmitry Leiko
Dmitry Leiko

Reputation: 4412

Ubuntu, Debian:

sudo apt install libxml2-dev

Centos:

sudo yum install libxml2-devel

Upvotes: 5

Diego Padilla
Diego Padilla

Reputation: 1

this solution it gonna be ok on Redhat 8.0

sudo yum install libxml2-devel

Upvotes: 0

For the latest versions it is needed to install libxml++2.6-dev like that:

apt-get install libxml++2.6-dev

Upvotes: 14

TroodoN-Mike
TroodoN-Mike

Reputation: 16185

All you need to do instal install package libxml2-dev for example:

sudo apt-get install libxml2-dev

On CentOS/RHEL:

sudo yum install libxml2-devel

Upvotes: 481

Related Questions