Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I've already asked same question in stackoverflow.I need some more help.

I’m trying to upgrade libxml2 from 2.6.26 to 2.7.7 on CentOS5.5

I installed libxml2-2.7.7 in /opt/libxml2-2.7.7/bin/

I'd already installed 2.6.26 in /usr by yum install libxml2 libxml2-devel.

When I configur PHP5.3 --with-libxml-dir=/opt/libxml2-2.7.7/bin message shows.

checking whether to enable LIBXML support... yes
checking libxml2 install dir... /opt/libxml2-2.7.7/bin
checking for xml2-config path... /usr/bin/xml2-config

PHP’s configure can’ t find xml2-config file in /opt/libxml2-2.7.7/bin

I don’t want PHP configure looks /usr/bin/xml2-config so that installed PHP use libxml2-2.6.26.

So,I have two different version of libxml2 NOW

#/opt/libxml2-2.7.7/bin/xml2-config --version

# /usr/bin/xml2-config --version

And this is PATH environment variable.


I think /opt/libxml2-2.7.7/bin is prior to /usr/bin.

But if I type xml2-conifg without path it is one under /usr/bin.

# xml2-config --version


Is there another settings to make xml2-config work under /opt/libxml2-2.7.7/bin?

I also changed symbolic link .

ls -la|grep libxml
-rw-r--r--  1 root root  2071024 Mar  5 16:56 libxml2.a
lrwxrwxrwx  1 root root       39 Apr  4 11:47 -> /opt/libxml2-2.7.7/lib/
lrwxrwxrwx  1 root root       39 Apr  4 18:59 -> /opt/libxml2-2.7.7/lib/
-rwxr-xr-x  1 root root  1298872 Mar  5 16:56
share|improve this question
up vote 2 down vote accepted

Try to configure PHP with --with-libxml-dir=/opt/libxml2-2.7.7.
The /bin suffix will be added automatically.
See the PHP manual. It contains a vague description, but I verified it in the configure script:

The location ([DIR]) specified with --with-libxml-dir ([DIR]=/bin/xml2-config)

share|improve this answer
I tried and message was checking libxml2 install dir... /opt/libxml2-2.7.7 checking for xml2-config path... /opt/libxml2-2.7.7/bin/xml2-config I HAVE TO --with-libxml-dir=/opt/libxml2-2.7.7 DON’T SET -with-libxml-dir=/opt/libxml2-2.7.7/bin Thank you. I understand. – user1345414 Apr 5 '13 at 4:18

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.