在實時伺服器上新增 PHP5 的 CLI

在實時伺服器上新增 PHP5 的 CLI

我想在我的伺服器上新增對 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 中修復),因此會導致回歸。測試這一點的最簡單方法是啟動測試虛擬機器並查看您的網站是否正常運作(或更好:您的測試套件是否運行)。

另一個技巧是嘗試安裝 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.

相關內容