LunarPages空間500錯誤原因及解決辦法

 我們在使用LunarPages空間時,有時在安裝程序時可能經常出現500錯誤這一般是由於服務器內部出現的錯誤引起的,那麼導致500錯誤原因有哪些呢?又該如何解決呢?下面來說說500錯誤常見原因及解決辦法?

1、上傳的文件權限設置不正確,如某些文件夾或文件權限是777或666,如果是這種情況,可能需要更改它們屬性爲755或644。我們可以通過控制面板中的文件管理器或者使用FTP客戶端軟件進行權限設置。

2、查看.htaccess文件參數設置是否正確,在.htaccess文件中不能包含php_values和php_flags,否則會出現500錯誤,需要移動到php.ini文件中,最後在.htaccess文件中添加"suPHP_ConfigPath/home/username/public_html"語句。

3、數據庫參數是否正確,如果使用Access數據庫,可以查看連接路徑以及ODBC驅動程序有沒有設置正確,如果使用MYSQL數據庫,查看數據庫是否正確連接,當然可以藉助web.config文件顯示詳細錯誤信息。

4、程序自身錯誤,出現500錯誤,有可能是程序自身編寫錯誤,因此我們必須對程序進行檢查,確保程序代碼完整性和正確性。

5、其它未知錯誤,如果按照上述方法設置後,仍然不能解決出現的問題,可以查看錯誤日誌上出現的具體錯誤或者聯繫官方客服檢查。

以下是LunarPages官方關於500錯誤的回覆內容:

Hello!

At Lunarpages, our servers are setup to use suPHP to parse php pages as CGI instead of an Apache module. If you are running a PHP-based script on your site and are receiving a 500 and/or 404 errors on your pages, it is likely you have one or more of the following occurring:

1. The permissions on some of the folders or files are 777 or 666. If this is the case, change them to either 755 or 644 in Cpanel's File Manager (or using your local FTP client).

2. The files and/or folders are not owned by you. Certain applications having been run under php as an apache module may have files owned by the apache user of nobody. An indication that you don't own the files would be if you are unable to change their file permissions. To correct this, please provide your username or domain name, and provide the location of the folder or files that need to have your ownership.

3. Your .htaccess file has php_values or php_flags in it. This causes a 500 Internal server error when attempting to execute the script. The php_values and php_flags will need to be removed from your .htaccess file (please make a backup of the .htaccess by copying its contents and saving it on your desktop as htaccess.txt). Take the contents removed from .htaccess and place it into a file you create called php.ini. Remember to remove the php_flag and php_value part before the directives as php.ini files do not require those in front of the values. You can always make the changes and ask us if the changed files are correct. Because php.ini values are not shared across directories, you would need a separate php.ini file in each folder that has .htaccess or that requires the php_values or php_flags. In order to avoid doing this, you can place a line in the .htaccess file in your public_html folder to have all values in your public_html php.ini to be shared across all folder. This line would be the following: suPHP_ConfigPath /home/username/public_html.

Please let us know if you have any questions or require further assistance. Daniel McCall Lunarpages Support [email protected].

以上就是Lunarpages空間常見500錯誤原因及解決辦法,僅供廣大新站長朋友參考,更多知識,可以訪問美國主機偵探進行交流學習。

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章