[ Linux ] CentOS6 に PHP5.4 のインストールでエラー ( Please check your libxml2 installation )

Pocket

CentOS6(さくらVPS)にPHP5.4.10をインストールしようとすると以下のようなエラーが発生しましたので、備忘録としてその対処法を残しておきます。

結論から言うと、「libxml2 がインストールされていないのでインストールしろ」とのことです。

スポンサーリンク

PHP の configure でエラー

configure を実行すると、次のようにエラーとなってしまいました。

# ./configure --prefix=/usr/local/php5 \
              --with-apxs2=/usr/local/apache2/bin/apxs \
              --enable-sigchild --with-zlib --enable-mbstring --with-libmbfl \
              --with-mysql=/usr/local/mysql \
              --with-mysqli=shared,mysqlnd --with-pdo-mysql=shared,mysqlnd \
              --with-openssl --with-pdo-sqlite=shared
              
(省略)              
              
checking whether to enable LIBXML support... yes
checking libxml2 install dir... no
checking for xml2-config path...
configure: error: xml2-config not found. Please check your libxml2 installation.

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

libxml2のインストール

libxml2 を yum でインストールします。

[root@masao php-5.4.10]# yum install libxml2-devel
Loaded plugins: fastestmirror, security
Loading mirror speeds from cached hostfile
epel/metalink                                            | 3.8 kB     00:00
 * base: mirror.fairway.ne.jp
 * epel: ftp.riken.jp
 * extras: mirror.fairway.ne.jp
 * updates: mirror.fairway.ne.jp

(省略)

Total download size: 1.1 M
Installed size: 8.6 M
Is this ok [y/N]: y       <--- 確認が求められる
Downloading Packages:
(1/2): libxml2-devel-2.7.6-8.el6_3.4.x86_64.rpm          | 1.1 MB     00:01
(2/2): zlib-devel-1.2.3-27.el6.x86_64.rpm                |  44 kB     00:00
--------------------------------------------------------------------------------
Total                                           648 kB/s | 1.1 MB     00:01
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
  Installing : zlib-devel-1.2.3-27.el6.x86_64                               1/2
  Installing : libxml2-devel-2.7.6-8.el6_3.4.x86_64                         2/2
  Verifying  : libxml2-devel-2.7.6-8.el6_3.4.x86_64                         1/2
  Verifying  : zlib-devel-1.2.3-27.el6.x86_64                               2/2

Installed:
  libxml2-devel.x86_64 0:2.7.6-8.el6_3.4

Dependency Installed:
  zlib-devel.x86_64 0:1.2.3-27.el6

Complete!

lib2xml のインストール完了後、再度 PHP の configure を実行するとエラーとなることなく、メイクファイルを作成することができました。

 

スポンサーリンク


Pocket

Leave a Comment

Your email address will not be published. Required fields are marked *