apache + php + mysql 安裝出錯

來源:互聯網
上載者:User

標籤:

今天在 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 安裝出錯

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.