阿里云/万网云虚拟主机,处理Internal Server Error内部服务器500错误问题的建议

前端之家收集整理的这篇文章主要介绍了阿里云/万网云虚拟主机,处理Internal Server Error内部服务器500错误问题的建议前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。

网站上传到阿里云/万网云虚拟主机,运行了一段时间以后,出现了 Internal Server Error 的错误查询了一下阿里云/万网上的文档,给出如下解决思路:

1 .htaccess文件写入错误代码

在.htaccess文件中,可能因为添入了一些与源文件冲突的代码,可以建议将服务器上的.htaccess文件备份后,删除测试。(.htaccess文件以“.”开头,在Linux中是隐藏文件,可以通过FTP工具设置显示隐藏文件查看)

(概述来说,.htaccess文件是Apache服务器中的一个配置文件,它负责相关目录下的网页配置。通过.htaccess文件,可以帮我们实现:网页301重定向自定义404错误页面、改变文件扩展名、允许/阻止特定的用户或者目录的访问、禁止目录列表、配置默认文档等功能。)

2 文件权限设置错误

后台目录和文件权限默认为755,二图片文字等html文件应该是644,刚上传文件后出现500,应该主要检查文件权限。可以通过ftp修改文件权限。

3 安装wordpress出现500 Internal Server Error

安装新版本wordpress出现500 Internal Server Error的问题:

./wp-includes/class-http.PHP的291行,改成

Crayon-5c891c9344e58853566520" class="Crayon-Syntax Crayon-theme-classic Crayon-font-monaco Crayon-os-pc print-yes notranslate" data-settings=" minimize scroll-mouSEOver" style=" margin-top: 12px; margin-bottom: 12px; font-size: 12px !important; line-height: 15px !important;">
Crayon-toolbar" data-settings=" mouSEOver overlay hide delay" style="font-size: 12px !important;height: 18px !important; line-height: 18px !important;">Crayon-title">
Crayon-tools" style="font-size: 12px !important;height: 18px !important; line-height: 18px !important;">
Crayon-button Crayon-nums-button" title="Toggle Line Numbers">
Crayon-button-icon">
Crayon-button Crayon-plain-button" title="Toggle Plain Code">
Crayon-button-icon">
Crayon-button Crayon-wrap-button" title="Toggle Line Wrap">
Crayon-button-icon">
Crayon-button Crayon-expand-button" title="Expand Code">
Crayon-button-icon">
Crayon-button Crayon-copy-button" title="Copy">
Crayon-button-icon">
Crayon-button Crayon-popup-button" title="Open Code In New Window">
Crayon-button-icon">
Crayon-language">PHP
Crayon-info" style="min-height: 16.8px !important; line-height: 16.8px !important;">
Crayon-plain-wrap">
Crayon-main" style="">Crayon-table">Crayon-row">
Crayon-nums " data-settings="show">
Crayon-nums-content" style="font-size: 12px !important; line-height: 15px !important;">
Crayon-num" data-line="Crayon-5c891c9344e58853566520-1">1
Crayon-code">
Crayon-pre" style="font-size: 12px !important; line-height: 15px !important; -moz-tab-size:4; -o-tab-size:4; -webkit-tab-size:4; tab-size:4;">
Crayon-line" id="Crayon-5c891c9344e58853566520-1">Crayon-v">$request_orderCrayon-h"> Crayon-o">=Crayon-h"> Crayon-e">apply_filtersCrayon-sy">(Crayon-h"> Crayon-s">'http_api_transports'Crayon-sy">,Crayon-h"> Crayon-t">arrayCrayon-sy">(Crayon-h"> Crayon-s">'streams'Crayon-h"> Crayon-sy">)Crayon-sy">,Crayon-h"> Crayon-v">$argsCrayon-sy">,Crayon-h"> Crayon-v">$urlCrayon-h"> Crayon-sy">)Crayon-sy">;

也就是去掉’curl’这几个字符。

注意:部分wordpess程序可能不是291行,那请搜索

Crayon-5c891c9344e63769461236" class="Crayon-Syntax Crayon-theme-classic Crayon-font-monaco Crayon-os-pc print-yes notranslate" data-settings=" minimize scroll-mouSEOver" style=" margin-top: 12px; margin-bottom: 12px; font-size: 12px !important; line-height: 15px !important;">
Crayon-toolbar" data-settings=" mouSEOver overlay hide delay" style="font-size: 12px !important;height: 18px !important; line-height: 18px !important;">Crayon-title">
Crayon-tools" style="font-size: 12px !important;height: 18px !important; line-height: 18px !important;">
Crayon-button Crayon-nums-button" title="Toggle Line Numbers">
Crayon-button-icon">
Crayon-button Crayon-plain-button" title="Toggle Plain Code">
Crayon-button-icon">
Crayon-button Crayon-wrap-button" title="Toggle Line Wrap">
Crayon-button-icon">
Crayon-button Crayon-expand-button" title="Expand Code">
Crayon-button-icon">
Crayon-button Crayon-copy-button" title="Copy">
Crayon-button-icon">
Crayon-button Crayon-popup-button" title="Open Code In New Window">
Crayon-button-icon">
Crayon-language">PHP
Crayon-info" style="min-height: 16.8px !important; line-height: 16.8px !important;">
Crayon-plain-wrap">
Crayon-main" style="">Crayon-table">Crayon-row">
Crayon-nums " data-settings="show">
Crayon-nums-content" style="font-size: 12px !important; line-height: 15px !important;">
Crayon-num" data-line="Crayon-5c891c9344e63769461236-1">1
Crayon-code">
Crayon-pre" style="font-size: 12px !important; line-height: 15px !important; -moz-tab-size:4; -o-tab-size:4; -webkit-tab-size:4; tab-size:4;">
Crayon-line" id="Crayon-5c891c9344e63769461236-1">Crayon-v">$request_orderCrayon-h"> Crayon-o">=Crayon-h"> Crayon-e">apply_filtersCrayon-sy">(Crayon-h"> Crayon-s">'http_api_transports'Crayon-sy">,Crayon-h"> Crayon-t">arrayCrayon-sy">(Crayon-h"> Crayon-s">'curl'Crayon-sy">,Crayon-h"> Crayon-s">'streams'Crayon-h"> Crayon-sy">)Crayon-sy">,Crayon-v">$urlCrayon-h"> Crayon-sy">)Crayon-sy">;

然后将这一句代码替换为

Crayon-5c891c9344e65835588826" class="Crayon-Syntax Crayon-theme-classic Crayon-font-monaco Crayon-os-pc print-yes notranslate" data-settings=" minimize scroll-mouSEOver" style=" margin-top: 12px; margin-bottom: 12px; font-size: 12px !important; line-height: 15px !important;">
Crayon-toolbar" data-settings=" mouSEOver overlay hide delay" style="font-size: 12px !important;height: 18px !important; line-height: 18px !important;">Crayon-title">
Crayon-tools" style="font-size: 12px !important;height: 18px !important; line-height: 18px !important;">
Crayon-button Crayon-nums-button" title="Toggle Line Numbers">
Crayon-button-icon">
Crayon-button Crayon-plain-button" title="Toggle Plain Code">
Crayon-button-icon">
Crayon-button Crayon-wrap-button" title="Toggle Line Wrap">
Crayon-button-icon">
Crayon-button Crayon-expand-button" title="Expand Code">
Crayon-button-icon">
Crayon-button Crayon-copy-button" title="Copy">
Crayon-button-icon">
Crayon-button Crayon-popup-button" title="Open Code In New Window">
Crayon-button-icon">
Crayon-language">PHP
Crayon-info" style="min-height: 16.8px !important; line-height: 16.8px !important;">
Crayon-plain-wrap">
Crayon-main" style="">Crayon-table">Crayon-row">
Crayon-nums " data-settings="show">
Crayon-nums-content" style="font-size: 12px !important; line-height: 15px !important;">
Crayon-num" data-line="Crayon-5c891c9344e65835588826-1">1
Crayon-code">
Crayon-pre" style="font-size: 12px !important; line-height: 15px !important; -moz-tab-size:4; -o-tab-size:4; -webkit-tab-size:4; tab-size:4;">
Crayon-line" id="Crayon-5c891c9344e65835588826-1">Crayon-v">$request_orderCrayon-h"> Crayon-o">=Crayon-h"> Crayon-e">apply_filtersCrayon-sy">(Crayon-h"> Crayon-s">'http_api_transports'Crayon-sy">,Crayon-h"> Crayon-v">$urlCrayon-h"> Crayon-sy">)Crayon-sy">;

然后覆盖到wp-includes文件夹下,覆盖前,为了防止出错,请备份下原文件

4 虚拟主机安装wordpress时,在连接数据库配置后提示 “500 Internal Server Error ”,此问题是由于PHP版本过低导致,需要登陆cp.hichina.com控制面板,点击页面左侧高级环境配置—PHP版本设置可以切换PHP版本,将PHP 切换5.3以上版本即可。

5 服务器资源超载同一时间内处理器有太多进程需要处理,会出现500。

猜你在找的wordpress相关文章