0

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
2.7.7

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

And this is PATH environment variable.

PATH=/opt/php-5.3.14/bin:/opt/apache-httpd-2.2.22/bin:/opt/libxml2-2.7.7/bin:/usr/kerberos/sbin:/usr/kerberos/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin:/usr/lib/oracle/11.2/client64/bin

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

2.6.26

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 libxml2.so -> /opt/libxml2-2.7.7/lib/libxml2.so.2.7.7
lrwxrwxrwx  1 root root       39 Apr  4 18:59 libxml2.so.2 -> /opt/libxml2-2.7.7/lib/libxml2.so.2.7.7
-rwxr-xr-x  1 root root  1298872 Mar  5 16:56 libxml2.so.2.6.26
user1345414
  • 387
  • 1
  • 4
  • 10

1 Answers1

2

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)

Lukas
  • 1,004
  • 6
  • 14
  • 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 05 '13 at 04:18