XAMPP + Wordpress:500内部服务器错误

时间:2018-03-11 18:11:19

标签: php wordpress xampp internal-server-error

我目前正在尝试使用本教程设置运行Wordpress网站的XAMPP网络服务器:https://code.tutsplus.com/articles/how-to-setup-a-wordpress-development-environment-for-windows--wp-23365

一切顺利完成后,在完成最后一步后,我的wordpress模板的核心HTML加载,但所有样式表和帖子都无法打开。通过localhost加载index.php后,我得到以下内容:

screenshot of the page

经过一番搜索,我检查了Apache错误日志,发现了以下内容:

[Sun Mar 11 00:49:27.099600 2018] [ssl:warn] [pid 9888:tid 552] AH01909: www.example.com:443:0 server certificate does NOT include an ID which matches the server name
[Sun Mar 11 00:49:27.145220 2018] [core:warn] [pid 9888:tid 552] AH00098: pid file C:/xampp/apache/logs/httpd.pid overwritten -- Unclean shutdown of previous Apache run?
[Sun Mar 11 00:49:27.150665 2018] [ssl:warn] [pid 9888:tid 552] AH01909: www.example.com:443:0 server certificate does NOT include an ID which matches the server name
[Sun Mar 11 00:49:27.178739 2018] [mpm_winnt:notice] [pid 9888:tid 552] AH00455: Apache/2.4.29 (Win32) OpenSSL/1.1.0g PHP/7.2.2 configured -- resuming normal operations
[Sun Mar 11 00:49:27.178739 2018] [mpm_winnt:notice] [pid 9888:tid 552] AH00456: Apache Lounge VC15 Server built: Nov  3 2017 10:30:36
[Sun Mar 11 00:49:27.178739 2018] [core:notice] [pid 9888:tid 552] AH00094: Command line: 'c:\\xampp\\apache\\bin\\httpd.exe -d C:/xampp/apache'
[Sun Mar 11 00:49:27.199797 2018] [mpm_winnt:notice] [pid 9888:tid 552] AH00418: Parent: Created child process 20752 AH00548: NameVirtualHost has no effect and will be removed in the next release C:/xampp/apache/conf/extra/httpd-vhosts.conf:2
[Sun Mar 11 00:49:27.783347 2018] [ssl:warn] [pid 20752:tid 620] AH01909: www.example.com:443:0 server certificate does NOT include an ID which matches the server name
[Sun Mar 11 00:49:27.829470 2018] [ssl:warn] [pid 20752:tid 620] AH01909: www.example.com:443:0 server certificate does NOT include an ID which matches the server name
[Sun Mar 11 00:49:27.856542 2018] [mpm_winnt:notice] [pid 20752:tid 620] AH00354: Child: Starting 150 worker threads.
[Sun Mar 11 00:49:36.078032 2018] [core:error] [pid 20752:tid 1828] [client 127.0.0.1:62660] AH00124: Request exceeded the limit of 10 internal redirects due to probable configuration error. Use 'LimitInternalRecursion' to increase the limit if necessary. Use 'LogLevel debug' to get a backtrace., referer: http://127.0.0.1/wp-vs-494/wp-admin/
[Sun Mar 11 00:49:36.078534 2018] [core:error] [pid 20752:tid 1828] [client 127.0.0.1:62660] AH00124: Request exceeded the limit of 10 internal redirects due to probable configuration error. Use 'LimitInternalRecursion' to increase the limit if necessary. Use 'LogLevel debug' to get a backtrace., referer: http://127.0.0.1/wp-vs-494/wp-admin/

请注意,最后两行表示超出了10个内部重定向的限制,可能是由于配置错误。之后,同样的消息继续被重复多种类型。

不幸的是,我没有任何设置本地Web服务器的经验,所以我不知道该怎么做。我查看了多个stackoverflow建议并浏览了所有文件,但我迷路了。有没有其他人经历过这个或有人知道我能做什么?提前干杯

编辑:经过一番搜索,我发现人们大多都在修改他们的.htaccess文件,这是我的:

# BEGIN WordPress
<IfModule mod_rewrite.c>    
RewriteEngine On    
RewriteBase /wp_vs_494/ 
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f 
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /wp_vs_494/index.php [L]
</IfModule>
# END WordPress

此外,这是我的C:/ xampp / htdocs /文件夹的目录结构:

C:/xampp/htdocs/ structure

1 个答案:

答案 0 :(得分:0)

经过进一步调查,我找到了一个修复该问题的.htaccess文件配置。第二行代码&#34; RewriteBase /&#34;修好了。

RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]

# uploaded files
RewriteRule ^([_0-9a-zA-Z-]+/)?files/(.+) wp-includes/ms-files.php?file=$2 [L]

# add a trailing slash to /wp-admin
RewriteRule ^([_0-9a-zA-Z-]+/)?wp-admin$ $1wp-admin/ [R=301,L]

RewriteCond %{REQUEST_FILENAME} -f [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^ - [L]
RewriteRule ^([_0-9a-zA-Z-]+/)(wp-(content|admin|includes).*) $2 [L]
RewriteRule ^([_0-9a-zA-Z-]+/)(.*\.php)$ $2 [L]
RewriteRule . index.php [L]

但是,现在我遇到了一个新问题,即当我尝试使用/ wp-admin url扩展名登录并填写我的凭据时,我会被重定向到同一页面。