224

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.
kenorb
  • 155,785
  • 88
  • 678
  • 743
TroodoN-Mike
  • 15,687
  • 15
  • 55
  • 78
  • Related: [How to fix PHP installation when xml2-config is missing?](http://superuser.com/questions/740399/how-to-install-php5-3-instead-of-php5-5-in-linux) – kenorb Nov 12 '14 at 14:30

6 Answers6

473

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
radtek
  • 34,210
  • 11
  • 144
  • 111
TroodoN-Mike
  • 15,687
  • 15
  • 55
  • 78
13

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

apt-get install libxml++2.6-dev
11

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
rink.attendant.6
  • 44,500
  • 61
  • 101
  • 156
silver
  • 1,633
  • 1
  • 20
  • 32
5

Ubuntu, Debian:

sudo apt install libxml2-dev

Centos:

sudo yum install libxml2-devel
Dmitry Leiko
  • 3,970
  • 3
  • 25
  • 42
0

this solution it gonna be ok on Redhat 8.0

sudo yum install libxml2-devel

0

OpenSuse

"sudo zypper install libxml2-devel"

It will install any other dependencies or required packages/libraries

O. Kasule
  • 21
  • 1
  • 1