php mysql 安装错误_apache + php + mysql 安装出错

今天在 linux 14.04 上搭建 LAPM 环境,安装完 Apache2 之后,再去安装 PHP5,会出现如下错误:

root@ubuntu:/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,会出现如下错误:

root@ubuntu:/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 版本混乱导致的。执行下面命令就可以了:

root@ubuntu:/usr/local/lib# rm /usr/local/lib/libxml2.so*

这期间还发生了一些其他错误,如

root@ubuntu:/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

也可以通过上述操作解决。

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值