Php

PHP Woes - 500 內部伺服器錯誤(全新伺服器)

  • November 21, 2012

有人見過這些錯誤,或者類似的東西嗎?

/usr/bin/php: error while loading shared libraries: libcom_err.so.2: failed to map segment from shared object: Cannot allocate memory

[warn] UID of script "/usr/local/apache/htdocs/index.PHP" is smaller than min_uid

[info] Executing "/home/mysite/public_html/index.php" as UID 501, GID 501

我真的不確定解決方法是什麼,但我假設我在 WHM/Cpanel 中有一些記憶體設置設置不佳?

    • 更新:

使用下面答案中所述的命令,這是我在載入使用者的索引頁面時看到的內容(我已經屏蔽了我的伺服器的 IP 和使用者名):

==> /usr/local/apache/logs/error_log <==
[Sat Apr 23 17:37:18 2011] [error] [client IPADDRESS] /usr/bin/php: error while loading shared libraries: libcom_err.so.2: failed to map segment from shared object: Cannot allocate memory
[Sat Apr 23 17:37:18 2011] [error] [client IPADDRESS] Premature end of script headers: index.php
[Sat Apr 23 17:37:18 2011] [error] [client IPADDRESS] File does not exist: /home/username/public_html/500.shtml

==> /usr/local/apache/logs/suphp_log <==
[Sat Apr 23 17:37:18 2011] [info] Executing "/home/username/public_html/index.php" as UID 501, GID 501

此外,當我直接訪問我的 IP 地址時(我剛剛在 index.php 中將一個簡單的 PHP 重定向到我的域名…),這些是我得到的錯誤:

==> /usr/local/apache/logs/access_log <==
IPADDRESS - - [23/Apr/2011:17:40:58 -0400] "GET /index.PHP HTTP/1.1" 404 -

==> /usr/local/apache/logs/error_log <==
[Sat Apr 23 17:40:58 2011] [error] [client IPADDRESS] SoftException in Application.cpp:357: UID of script "/usr/local/apache/htdocs/index.PHP" is smaller than min_uid
[Sat Apr 23 17:40:58 2011] [error] [client IPADDRESS] Premature end of script headers: index.PHP
[Sat Apr 23 17:40:58 2011] [error] [client IPADDRESS] File does not exist: /usr/local/apache/htdocs/500.shtml

==> /usr/local/apache/logs/suphp_log <==
[Sat Apr 23 17:40:58 2011] [warn] UID of script "/usr/local/apache/htdocs/index.PHP" is smaller than min_uid

最後……這些是空的:

  • modsec_audit.log
  • modsec_debug_log

我在 suexec.log 中看到:

: uid: (501/username) gid: (501/username) cmd: redirect.cgi

以及更多與已經說明的相同的錯誤……

我一直在尋找答案並想出了這個:

將文件的所有權設置為nobody。那是

chown 沒有人:沒有人 index.php

現在我沒有收到錯誤。

希望您可能正在使用 Suphp 執行 Cpanel 伺服器。從錯誤來看,這似乎是權限/所有權問題,表明 PHP 文件的所有者被呼叫不正確,或者權限高於 suphp.conf 中允許的權限。

您可以查看日誌以獲取有關錯誤的更多詳細資訊:

tail -fvn0 /usr/local/apache/logs/*log

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