無法在 Debian 伺服器上重新啟動 apache2 - “無法將 /usr/local/apache2/modules/libphp5.so 載入到伺服器中”

無法在 Debian 伺服器上重新啟動 apache2 - “無法將 /usr/local/apache2/modules/libphp5.so 載入到伺服器中”

好吧...我在伺服器方面還是個初學者,並且在 Debian Web 伺服器上重新啟動 apache 時遇到了一些問題。

我剛剛運行了以下命令:

aptitude install apache2 openssl

之後我立即嘗試重新啟動 apache 並收到以下錯誤訊息:

IS-13902:/usr/local/apache2/modules# /etc/init.d/apache restart
httpd: Syntax error on line 55 of /usr/local/apache2/conf/httpd.conf: Cannot load /usr/local/apache2/modules/libphp5.so into server: libidn.so.11: cannot open shared object file: No such file or directory

我運行 ldd /usr/local/apache2/modules/libphp5.so 並得到以下輸出

linux-gate.so.1 =>  (0xb76f6000)
libcrypt.so.1 => /lib/i686/cmov/libcrypt.so.1 (0xb6d78000)
librt.so.1 => /lib/i686/cmov/librt.so.1 (0xb6d6f000)
libmysqlclient.so.16 => /usr/local/mysql/lib/libmysqlclient.so.16 (0xb6a3d000)
libpng12.so.0 => /usr/lib/libpng12.so.0 (0xb6a19000)
libz.so.1 => /usr/lib/libz.so.1 (0xb6a04000)
libjpeg.so.62 => /usr/lib/libjpeg.so.62 (0xb69e5000)
libm.so.6 => /lib/i686/cmov/libm.so.6 (0xb69bf000)
libdl.so.2 => /lib/i686/cmov/libdl.so.2 (0xb69bb000)
libnsl.so.1 => /lib/i686/cmov/libnsl.so.1 (0xb69a1000)
libcurl.so.4 => /usr/local/lib/libcurl.so.4 (0xb6948000)
libxml2.so.2 => /usr/lib/libxml2.so.2 (0xb680f000)
libc.so.6 => /lib/i686/cmov/libc.so.6 (0xb66b4000)
libpthread.so.0 => /lib/i686/cmov/libpthread.so.0 (0xb669b000)
/lib/ld-linux.so.2 (0xb76f7000)
libidn.so.11 => not found
libssh2.so.1 => not found
libssl.so.0.9.8 => /usr/lib/i686/cmov/libssl.so.0.9.8 (0xb6652000)
libcrypto.so.0.9.8 => /usr/lib/i686/cmov/libcrypto.so.0.9.8 (0xb64ff000)
libldap_r-2.4.so.2 => /usr/lib/libldap_r-2.4.so.2 (0xb64bc000)
liblber-2.4.so.2 => /usr/lib/liblber-2.4.so.2 (0xb64ad000)
libresolv.so.2 => /lib/i686/cmov/libresolv.so.2 (0xb6499000)
libsasl2.so.2 => /usr/lib/libsasl2.so.2 (0xb6482000)
libgnutls.so.26 => /usr/lib/libgnutls.so.26 (0xb63e5000)
libtasn1.so.3 => /usr/lib/libtasn1.so.3 (0xb63d5000)
libgpg-error.so.0 => /usr/lib/libgpg-error.so.0 (0xb63d0000)
libgcrypt.so.11 => /usr/lib/libgcrypt.so.11 (0xb6368000)

有人可以幫忙嗎?

答案1

安裝libidn11-dev包:

# apt-get install libidn11-dev

然後再試一次。

答案2

我在 FreeBSD 中遇到了你的問題。
你的版本libidn與你的 PHP 不相容。您需要apt-get update,然後刪除您的php modulesphp本身並刪除mod_php,然後安裝phpmod_php及其模組。
不要忘記php -m

相關內容