【发布时间】:2013-12-13 00:52:31
【问题描述】:
我刷了很多教程,但都导致我出现相同的错误 - 错误 500 - 服务器过载或 CGI 脚本中存在错误。
我在 Windows 上使用 xampp 并像这样配置 httpd.conf
<Directory />
Options FollowSymLinks
AllowOverride All
Order deny,allow
Allow from all
</Directory>
在 yii main.php 中修改
'urlManager'=>array(
'urlFormat'=>'path',
'showScriptName'=>false,
'caseSensitive'=>false,
'rules'=>array(
'' => 'site/index',
'<controller:\w+>/<id:\d+>'=>'<controller>/view',
'<controller:\w+>/<action:\w+>/<id:\d+>'=>'<controller>/<action>',
'<controller:\w+>/<action:\w+>'=>'<controller>/<action>',
),
),
并在根文件夹(受保护文件夹的同一级别)中添加 .htaccess
Options +FollowSymLinks
IndexIgnore */*
RewriteEngine on
RewriteBase /tests/
# if a directory or a file exists, use it directly
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
# otherwise forward it to index.php
RewriteRule . index.php
但无论我在 .htaccess 中写什么,我都会收到此错误。当我全部注释掉时,yii 的链接生成正常(没有 index.php),但是由于服务器配置错误,我有 404 错误。
编辑:
还有error.log最后几条记录:
[2013 年 11 月 27 日星期三 11:32:31.100063] [core:alert] [pid 9520:tid 1572] [client ::1:58620] C:/Users/kristineg/xamps/htdocs/xampp/tests/。 htaccess:此处不允许的选项 [2013 年 11 月 27 日星期三 11:32:31.372163] [core:alert] [pid 9520:tid 1572] [client ::1:58621] C:/Users/kristineg/xamps/htdocs/xampp/tests/.htaccess: 选项这里不允许 [2013 年 11 月 27 日星期三 11:32:34.674379] [core:alert] [pid 9520:tid 1572] [client ::1:58622] C:/Users/kristineg/xamps/htdocs/xampp/tests/.htaccess: 选项这里不允许 [2013 年 11 月 27 日星期三 11:32:36.587084] [core:alert] [pid 9520:tid 1572] [client ::1:58623] C:/Users/kristineg/xamps/htdocs/xampp/tests/.htaccess: 选项这里不允许 [2013 年 11 月 27 日星期三 11:32:54.899832] [core:alert] [pid 9520:tid 1572] [client ::1:58624] C:/Users/kristineg/xamps/htdocs/xampp/tests/.htaccess: 选项这里不允许 [2013 年 11 月 27 日星期三 11:54:14.056192] [core:alert] [pid 9520:tid 1572] [client ::1:59297] C:/Users/kristineg/xamps/htdocs/xampp/tests/.htaccess: 选项这里不允许 [2013 年 11 月 27 日星期三 11:54:14.687425] [core:alert] [pid 9520:tid 1572] [client ::1:59298] C:/Users/kristineg/xamps/htdocs/xampp/tests/.htaccess: 选项这里不允许 [Wed Nov 27 15:53:27.459885 2013] [ssl:warn] [pid 11320:tid 308] AH01909:为 www.example.com:443 配置的 RSA 证书不包含与服务器名称匹配的 ID [2013 年 11 月 27 日星期三 15:53:27.525911] [core:warn] [pid 11320:tid 308] AH00098: pid 文件 C:/Users/kristineg/xamps/apache/logs/httpd.pid 被覆盖 -- 以前的不干净关闭阿帕奇运行? [Wed Nov 27 15:53:27.588934 2013] [ssl:warn] [pid 11320:tid 308] AH01909:为 www.example.com:443 配置的 RSA 证书不包含与服务器名称匹配的 ID [2013 年 11 月 27 日星期三 15:53:27.625947] [mpm_winnt:notice] [pid 11320:tid 308] AH00455: Apache/2.4.4 (Win32) OpenSSL/1.0.1e PHP/5.5.1 已配置 -- 恢复正常操作 [2013 年 11 月 27 日星期三 15:53:27.625947] [mpm_winnt:notice] [pid 11320:tid 308] AH00456:服务器构建时间:2013 年 2 月 23 日 12:42:00 [2013 年 11 月 27 日星期三 15:53:27.625947] [core:notice] [pid 11320:tid 308] AH00094:命令行:'c:\users\kristineg\xamps\apache\bin\httpd.exe -d C:/用户/kristineg/xamps/apache' [2013 年 11 月 27 日星期三 15:53:27.627948] [mpm_winnt:notice] [pid 11320:tid 308] AH00418: Parent: Created child process 4472 [2013 年 11 月 27 日星期三 15:53:27.998083] [ssl:warn] [pid 4472:tid 336] AH01909:为 www.example.com:443 配置的 RSA 证书不包含与服务器名称匹配的 ID [Wed Nov 27 15:53:28.143138 2013] [ssl:warn] [pid 4472:tid 336] AH01909:为 www.example.com:443 配置的 RSA 证书不包含与服务器名称匹配的 ID [2013 年 11 月 27 日星期三 15:53:28.186154] [mpm_winnt:notice] [pid 4472:tid 336] AH00354:子级:启动 150 个工作线程。 [2013 年 11 月 27 日星期三 15:53:38.827074] [core:alert] [pid 4472:tid 1640] [client ::1:61797] C:/Users/kristineg/xamps/htdocs/xampp/tests/.htaccess: 选项这里不允许 [2013 年 11 月 27 日星期三 15:53:39.614364] [core:alert] [pid 4472:tid 1652] [client ::1:61796] C:/Users/kristineg/xamps/htdocs/xampp/tests/.htaccess: 选项这里不允许 [2013 年 11 月 27 日星期三 15:53:39.958491] [core:alert] [pid 4472:tid 1640] [client ::1:61798] C:/Users/kristineg/xamps/htdocs/xampp/tests/.htaccess: 选项这里不允许 [2013 年 11 月 27 日星期三 15:53:40.295616] [core:alert] [pid 4472:tid 1652] [client ::1:61799] C:/Users/kristineg/xamps/htdocs/xampp/tests/.htaccess: 选项这里不允许 [2013 年 11 月 27 日星期三 16:32:32.894114] [core:alert] [pid 4472:tid 1640] [client ::1:62407] C:/Users/kristineg/xamps/htdocs/xampp/tests/.htaccess: 选项这里不允许
【问题讨论】: