升級 php - 遇到錯誤

升級 php - 遇到錯誤

運行 debian 4.0
嘗試

$ apt-get install php5

我明白了

Reading package lists... Done
Building dependency tree... Done
php5 is already the newest version.
0 upgraded, 0 newly installed, 0 to remove and 4 not upgraded.
4 not fully installed or removed.
Need to get 0B of archives.
After unpacking 0B of additional disk space will be used.
Setting up apache2.2-common (2.2.3-4+etch11) ...
chown: `www-data': invalid user
dpkg: error processing apache2.2-common (--configure):
 subprocess post-installation script returned error exit status 1
dpkg: dependency problems prevent configuration of apache2-mpm-prefork:
 apache2-mpm-prefork depends on apache2.2-common (= 2.2.3-4+etch11); however:
  Package apache2.2-common is not configured yet.
dpkg: error processing apache2-mpm-prefork (--configure):
 dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of libapache2-mod-php5:
 libapache2-mod-php5 depends on apache2-mpm-prefork (>> 2.0.52) | apache2-mpm-itk; however:
  Package apache2-mpm-prefork is not configured yet.
  Package apache2-mpm-itk is not installed.
 libapache2-mod-php5 depends on apache2.2-common; however:
  Package apache2.2-common is not configured yet.
dpkg: error processing libapache2-mod-php5 (--configure):
 dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of php5:
 php5 depends on libapache2-mod-php5 (>= 5.2.0+dfsg-8+etch16) | libapache-mod-php5 (>= 5.2.0+dfsg-8+etch16) | php5-cgi (>= 5.2.0+dfsg-8+etch16); however:
  Package libapache2-mod-php5 is not configured yet.
  Package libapache-mod-php5 is not installed.
  Package php5-cgi is not installed.
dpkg: error processing php5 (--configure):
 dependency problems - leaving unconfigured
Errors were encountered while processing:
 apache2.2-common
 apache2-mpm-prefork
 libapache2-mod-php5
 php5
E: Sub-process /usr/bin/dpkg returned an error code (1)

可能是什麼問題呢 ?

答案1

www-data有人已從系統中刪除該使用者。您已將 Apache 重新配置為使用不同的用戶,這很好,但這www-data是 Debian 軟體包可能假定存在的核心系統用戶集的一部分,即使您沒有使用它。 apache2.2-common 套件的腳本postinst正在將某些檔案的所有權變更給該使用者並假設它存在,如果不存在則失敗。

這似乎已在 Debian 6.0 的 Apache 軟體包中修復。 Debian 4.0 已經很老了。但立即的解決方法是重新建立www-data使用者。

相關內容