Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/redis/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
yii中的内部服务器错误_Yii - Fatal编程技术网

yii中的内部服务器错误

yii中的内部服务器错误,yii,Yii,事实上,我的网站是在localhost中工作的,为什么我会在live中收到内部服务器错误? 我已将我的.htaccess文件附加到此处,其中是否有错误 Options +FollowSymLinks IndexIgnore */* RewriteEngine on # Make backend accessible via url: RewriteRule ^sysadmin& backend.php # if a directory

事实上,我的网站是在localhost中工作的,为什么我会在live中收到
内部服务器错误
? 我已将我的
.htaccess
文件附加到此处,其中是否有错误

    Options +FollowSymLinks
    IndexIgnore */*
    RewriteEngine on

    # Make backend accessible via url: 
    RewriteRule ^sysadmin& backend.php

    # 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 [L]

只需尝试在htaccess中添加以下规则:

RewriteBase /

您应该检查您的apache日志。我也有同样的问题,我检查了错误日志。有一个错误,无效的命令“RewriteEngine”,这意味着重写模块被禁用。您必须启用它。对于linux:

在Apache 2+下,您只需执行以下操作:

sudo a2enmod rewrite && sudo service apache2 restart
or
sudo a2enmod rewrite && sudo /etc/init.d/apache2 restart 

您是否更改了index.php文件上的Yii文件夹引用?您的托管提供商是否允许您使用.htaccess文件?如果允许,是否安装了mod_rewrite?“内部服务器错误”太普遍了,请尝试使用您可以使用的最默认的东西,以便更容易找到问题所在。我们无法帮助您了解这个广泛的通用错误消息。您应该查看Apache的错误日志文件。它将包含有关错误的更详细信息。胡乱猜测:您的服务器上可能缺少
mod_rewrite
。请保持调试“打开”,并查看Yii的日志文件<代码>已定义('yi_DEBUG')或定义('yi_DEBUG',true)日志文件,位于:
/runtime/application.Log