標籤:
今天在 linux 14.04 上搭建 LAPM 環境,安裝完 Apache2 之後,再去安裝 PHP5,會出現如下錯誤:
[email protected]:/home/adu# apt-get install php5 libapache2-mod-php5
Reading package lists... Done
......
apache2_invoke: Enable module php5
Action ‘configtest‘ failed.
The Apache error log may have more information.
apache2_reload: Your configuration is broken. Not restarting Apache 2
Setting up php5 (5.5.9+dfsg-1ubuntu4.11) ...
此時去 restart Apache,會出現如下錯誤:
[email protected]:/home/adu# /etc/init.d/apache2 restart
* Restarting web server apache2 [fail]
* The apache2 configtest failed.
Output of config test was:
apache2: Syntax error on line 140 of /etc/apache2/apache2.conf: Syntax error on line 1 of /etc/apache2/mods-enabled/php5.load: Cannot load /usr/lib/apache2/modules/libphp5.so into server: /usr/lib/apache2/modules/libphp5.so: symbol xmlOutputBufferGetSize, version LIBXML2_2.9.0 not defined in file libxml2.so.2 with link time reference
Action ‘configtest‘ failed.
The Apache error log may have more information.
以為是 libxml2.so.2 版本不對,跑去升級,還造成了其他錯誤。經過一下午的折騰和找資料,最後發現是由於 linux 版本混亂導致的。執行下面命令就可以了:
[email protected]:/usr/local/lib# rm /usr/local/lib/libxml2.so*
這期間還發生了一些其他錯誤,如
[email protected]:/usr/local/lib# sudo apt-get dist-upgrade
Reading package lists... Done
Building dependency tree
Reading state information... Done
Calculating upgrade... Done
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
156 not fully installed or removed.
After this operation, 0 B of additional disk space will be used.
Do you want to continue? [Y/n] y
Setting up shared-mime-info (1.2-0ubuntu3) ...
update-mime-database.real: /usr/local/lib/libxml2.so.2: no version information available (required by update-mime-database.real)
Warning: program compiled against libxml 209 using older 207
也可以通過上述操作解決。
apache + php + mysql 安裝出錯