【发布时间】:2014-06-09 10:16:45
【问题描述】:
我正在尝试在实时服务器上设置我的第一个 Live 站点,我使用的是共享主机帐户,因此我无法将我的 DocumentRoot 更改为指向网站 。
不过,我确实遵循了here: 的建议,并在站点的根目录中创建了两个文件;
index.php 和一个 .htaccess
不幸的是,我的网站完全空白;什么都没有被渲染。因此,我想知道是否还需要做其他事情来渲染类。
这是我的 index.php 文件
define('RUNNING_FROM_ROOT', true);
include 'public/index.php';
这是我的 .htaccess 文件
SetEnv APPLICATION_ENV production
RewriteEngine On
RewriteRule ^\.htaccess$ - [F]
RewriteCond %{REQUEST_URI} =""
RewriteRule ^.*$ /public/index.php [NC,L]
RewriteCond %{REQUEST_URI} !^/public/.*$
RewriteRule ^(.*)$ /public/$1
RewriteCond %{REQUEST_FILENAME} -f
RewriteRule ^.*$ - [NC,L]
RewriteRule ^public/.*$ /public/index.php
【问题讨论】:
-
您如何将站点托管为子域或主域或子文件夹访问,子文件夹访问在共享托管中不起作用,因为对 zf2 的所有引用都来自 / [root]
-
白页通常表示php错误。尝试将
ini_set("display_errors", 1);添加到您的 index.php 文件中以查看实际情况
标签: zend-framework2