Php

無法在 FreeBSD 9.3 上安裝 PHP

  • April 17, 2015

我嘗試按照教程在剛剛獲得的 FreeBSD 伺服器上安裝 Php5。

所以首先我做了

cd /usr/ports/lang/php5

然後

make config

沒有改變任何選項,最後我做到了

make install

但它給了我一些錯誤。

root@ns******:/usr/ports/lang/php5 # make install
===>   php5-5.4.39 depends on file: /usr/local/bin/autoconf-2.69 - not found
===>    Verifying install for /usr/local/bin/autoconf-2.69 in /usr/ports/devel/autoconf
===>   autoconf-2.69 depends on executable: gm4 - found
===>   autoconf-2.69 depends on executable: help2man - not found
===>    Verifying install for help2man in /usr/ports/misc/help2man
===>   help2man-1.43.3_1 depends on package: p5-Locale-gettext>=0 - not found
===>    Verifying install for p5-Locale-gettext>=0 in /usr/ports/devel/p5-Locale-gettext
===>  Installing for p5-Locale-gettext-1.05_4
===>   p5-Locale-gettext-1.05_4 depends on file: /usr/local/bin/perl5.16.3 - found
===>   p5-Locale-gettext-1.05_4 depends on shared library: libintl.so - found (/usr/local/lib/libintl.so)
===>  Checking if p5-Locale-gettext already installed
===>   Registering installation for p5-Locale-gettext-1.05_4 as automatic
pkg-static: lstat(/usr/ports/devel/p5-Locale-gettext/work/stage/usr/local/lib/perl5/site_perl/mach/5.16/auto/Locale/gettext/gettext.so): No such file or directory
pkg-static: lstat(/usr/ports/devel/p5-Locale-gettext/work/stage/usr/local/lib/perl5/site_perl/mach/5.16/Locale/gettext.pm): No such file or directory
pkg-static: lstat(/usr/ports/devel/p5-Locale-gettext/work/stage/usr/local/lib/perl5/site_perl/man/man3/Locale::gettext.3.gz): No such file or directory
*** [fake-pkg] Error code 74

Stop in /usr/ports/devel/p5-Locale-gettext.
*** [build-depends] Error code 1

Stop in /usr/ports/misc/help2man.
*** [install] Error code 1

Stop in /usr/ports/misc/help2man.
*** [build-depends] Error code 1

Stop in /usr/ports/devel/autoconf.
*** [build-depends] Error code 1

Stop in /usr/ports/lang/php5.
*** [install] Error code 1

Stop in /usr/ports/lang/php5.

因此,我從 gnu 站點下載了 autoconf-2.69,然後找不到 libtool22。也下載了它,“修復”它。但隨後又出現了一個錯誤。

我不在我的電腦上,所以我不能在這裡發布錯誤,但要恢復,它允許我拒絕使用 autoconf 並且 chmod 不起作用(我的朋友告訴我至少要使用的命令)!

如果有幫助,我通過 bitvise ssh 上傳了這些東西。這是一個專用伺服器,我有 root 訪問權限,在 kimsufi 上得到它。

我怎樣才能解決這個問題?謝謝。

gettext埠已拆分為兩個不同的埠,因此您擁有應在安裝之前更新的過時軟體。

首先,更新您的埠樹:

portsnap fetch update

可能還要等一下。

然後你必須安裝一些工具portmaster

make -C /usr/ports/ports-mgmt/portmaster install clean

然後你必須檢查你的埠是否處於一致狀態:

portmaster --check-depends 
portmaster --check-port-dbdir 
portmaster -y --clean-distfiles

然後你必須解除安裝舊的gettext

pkg delete -f gettext

現在您可能想要安裝www/mod_php5之前lang/php5- apache 模組現在是單獨的埠,而 CLI/FPM 仍然在舊位置。

make -C /usr/ports/www/mod_php5 install clean
make -C /usr/ports/lang/php5 install clean
make -C /usr/ports/lang/php5-extensions install clean

Freshgettext將作為依賴項自動安裝,以及許多其他新埠。

雖然您的主機有點過時,但出於安全原因,您需要更新所有埠:

portmaster -atd

您可能會遇到另一個依賴錯誤,因此只需解除安裝相應的埠(就像gettext是),然後portmaster -aRtd一次又一次地啟動,直到所有問題都得到解決。如果仍然出現一些奇怪的消息,您可以通過以下方式一次重新安裝所有埠portmaster -aftd

PS 你應該只從埠/包安裝軟體以避免不可預見的後果。

引用自:https://serverfault.com/questions/683525