Yii2高级显示空白页面

时间:2015-05-25 12:17:43

标签: yii2 yii2-advanced-app

我是yii2的新用户,当我使用“基本应用程序模板”,“带有高级应用程序模板的Yii 2”从存档中提取yii2高级内容时,当我在服务器上传时,它显示为空白页。

我检查了yii2基本它工作正常,但只有在高级模板获取空白页面的情况下。 高级模板网址如下:../advanced/frontend/web/index.php?r=site

但是收到错误:No input file specified.

在Apache Server上,收到此错误:

Not Found The requested URL advanced/backend/web/index.php was not found on this server.

我尝试从编辑器以及存档进行安装,但是在后端/ web /和前端/ web /中存在相同且没有索引文件。

修改

正如Jichao建议的那样,我尝试制作指向高级/后端/网络的子域名,但问题仍然存在。

Scrrenshot:

enter image description here

1 个答案:

答案 0 :(得分:2)

.htaccess文件添加到项目的根目录中。您应该在 yii2 安装后手动执行此操作。 .htaccess文件的简单示例:

Options -Indexes

<IfModule mod_rewrite.c>
    RewriteEngine on    
    RewriteCond %{REQUEST_URI} !^public
    RewriteRule ^(.*)$ frontend/web/$1 [L]
</IfModule>

# Deny accessing below extensions
<Files ~ "(.json|.lock|.git)">
    Order allow,deny
    Deny  from all
</Files>

# Deny accessing dot files
RewriteRule (^\.|/\.) - [F]