PHP   发布时间:2022-04-04  发布网站:大佬教程  code.js-code.com
大佬教程收集整理的这篇文章主要介绍了无法将php作为apache2模块大佬教程大佬觉得挺不错的,现在分享给大家,也给大家做个参考。

ubuntu服务器@R_668_9382@,我到了需要将PHP作为apache2模块启用的地步.我尝试运行sudo a2enmod PHP5,但返回错误:模块PHP5不存在!

经过一番搜索,我偶然发现了Gerard的这个技巧:

如果sudo a2enmod PHP5返回“ $该模块不存在!”,则应清除(而不只是删除)libapache2-mod-PHP5软件包并重新安装.
在再次测试您的网站之前,请确保清除浏览器的缓存.”

运行sudo apt-get –purge删除libapache2-mod-PHP5,但是,返回的软件包libapache2-mod-PHP5没有安装,因此未删除.自然地,我尝试使用sudo apt-get install libapache2-mod-PHP5安装它,但是我得到了:

    Some packages Could not be installed. This may mean that you have
    requested an impossible situation or if you are using the unstable
    diStribution that some required packages have not yet been created
    or been moved out of Incoming.
    The following information may Help to resolve the situation:

    The following packages have unmet dependencies.
    libapache2-mod-PHP5 : Depends: libxml2 (>= 2.8.0) but 2.7.8.dfsg-5.1ubuntu4.6 is to be installed
    Recommends: PHP5-cli but it is not going to be installed
    E: Unable to correct problems, you have Held broken packages.

我试图更新&&升级,希望libxml2得到更新,但是没有发生.我也尝试安装PHP5-cli,但是得到了:

    The following packages have unmet dependencies.
    PHP5-cli : Depends: libxml2 (>= 2.8.0) but 2.7.8.dfsg-5.1ubuntu4.6 is to be installed
               Depends: libedit2 (>= 2.11-20080614-4) but 2.11-20080614-3ubuntu2 is to be installed
    E: Unable to correct problems, you have Held broken packages.

在这一点上我迷路了.运行PHP -v表示PHP正在运行,但是:

    PHP 5.4.17 (cli) (built: Aug  7 2013 11:40:38) 
    Copyright (C) 1997-2013 The PHP Group
    Zend ENGIne v2.4.0, Copyright (C) 1998-2013 Zend Technologies

解决方法:

您不能在Ubuntu 12.04下安装PHP 5.4.17,因为必需的libxml2库> = v2.8.0仅在Ubuntu 12.10(Quantal quetzal)或更高版本中可用.
解决方案:获取较新版本的Ubuntu.

大佬总结

以上是大佬教程为你收集整理的无法将php作为apache2模块全部内容,希望文章能够帮你解决无法将php作为apache2模块所遇到的程序开发问题。

如果觉得大佬教程网站内容还不错,欢迎将大佬教程推荐给程序员好友。

本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。
标签: