![在实时服务器上添加 PHP5 的 CLI](https://linux22.com/image/568023/%E5%9C%A8%E5%AE%9E%E6%97%B6%E6%9C%8D%E5%8A%A1%E5%99%A8%E4%B8%8A%E6%B7%BB%E5%8A%A0%20PHP5%20%E7%9A%84%20CLI.png)
我想在我的服务器上添加对 PHP5 的命令行支持。运行时aptitude install php5-cli
我收到一条消息,提示我的 PHP 模块/包有未满足的依赖关系。
以下是遭受这些“未满足的依赖关系”困扰且需要升级的软件包列表:
- php5-gd
- php5-curl
- php5-mysql
- php5-cgi
它们都依赖于 php5-common。
我是否可以按照 aptitude 的建议升级软件包而不会对实时网站造成任何干扰?
aptitude 的输出
Reading package lists... Done
Building dependency tree
Reading state information... Done
Reading extended state information
Initialising package states... Done
The following packages are BROKEN:
libapache2-mod-php5 php5-cgi php5-curl php5-gd php5-mysql
The following NEW packages will be installed:
php5-cli
The following packages will be upgraded:
php5-common
1 packages upgraded, 1 newly installed, 0 to remove and 123 not upgraded.
Need to get 3,511kB of archives. After unpacking 7,803kB will be used.
The following packages have unmet dependencies:
php5-gd: Depends: php5-common (= 5.3.3-1ubuntu12~lucid) but 5.3.5-1ubuntu7.2ppa1~lucid is to be installed.
php5-curl: Depends: php5-common (= 5.3.3-1ubuntu12~lucid) but 5.3.5-1ubuntu7.2ppa1~lucid is to be installed.
php5-mysql: Depends: php5-common (= 5.3.3-1ubuntu12~lucid) but 5.3.5-1ubuntu7.2ppa1~lucid is to be installed.
php5-cgi: Depends: php5-common (= 5.3.3-1ubuntu12~lucid) but 5.3.5-1ubuntu7.2ppa1~lucid is to be installed.
libapache2-mod-php5: Depends: php5-common (= 5.3.3-1ubuntu12~lucid) but 5.3.5-1ubuntu7.2ppa1~lucid is to be installed.
The following actions will resolve these dependencies:
Upgrade the following packages:
libapache2-mod-php5 [5.3.3-1ubuntu12~lucid (now) -> 5.3.5-1ubuntu7.2ppa1~lucid (lucid)]
php5-cgi [5.3.3-1ubuntu12~lucid (now) -> 5.3.5-1ubuntu7.2ppa1~lucid (lucid)]
php5-curl [5.3.3-1ubuntu12~lucid (now) -> 5.3.5-1ubuntu7.2ppa1~lucid (lucid)]
php5-gd [5.3.3-1ubuntu12~lucid (now) -> 5.3.5-1ubuntu7.2ppa1~lucid (lucid)]
php5-mysql [5.3.3-1ubuntu12~lucid (now) -> 5.3.5-1ubuntu7.2ppa1~lucid (lucid)]
Score is 340
答案1
我的答案是或许! ;-)
PHP 5.3.3 到 5.3.5 应该没什么问题。除非 Ubuntu/Debian 做了一些特别疯狂的事情。但小版本(例如 5.3.x 到 5.3.y)不应该破坏任何功能集。
也就是说,希望您没有进行疯狂的黑客攻击,例如依赖 5.3.3 中的错误,而这些错误已在 5.3.5 中修复,因此会导致回归。测试此问题的最简单方法是启动测试 VM,看看您的网站是否正常工作(或者更好的是:您的测试套件运行)。
另一个技巧是尝试安装 5.3.3 – 这是一个想法(请注意,我的版本不同):
# apt-cache showpkg php5-cli
Package: php5-cli
Versions:
5.2.10.dfsg.1-2ubuntu6.10
...
(我截断了输出。)
然后安装:
# apt-get install php5-cli=5.2.10.dfsg.1-2ubuntu6.10
...
高血压
答案2
您正在使用 Nginx PPA,Aptitude 会尝试更新软件包以获取较新版本。如果您想从 Ubuntu 存储库安装 php5-cli,则必须使用aptitude install php5-cli=5.3.3-1ubuntu12~lucid
。