Zend Project上传后无法在真实服务器上运行

时间:2011-07-31 10:37:21

标签: zend-framework

我刚刚使用zend框架完成了工作现场。这是我使用Zend框架的第一个项目。该网站几乎在localhost中完成,我试图将其上传到真实服务器进行测试。我把我的文件放在真实服务器的public_html文件夹下。我注意到项目的根文件夹(即public_html)中没有任何文件“index.php”。它实际上位于public_html内的公共文件夹中。我很困惑。我试图在根文件夹中创建index.php并输入“require_once('public / index.php'),但是没有用。我现在该怎么办?

感谢。

3 个答案:

答案 0 :(得分:2)

假设typical project directory structure,您的public文件夹应该进入服务器的public_html文件夹,所有其他Zend项目文件夹应该升级到一级,如下所示:

/application
    // application files
/library
    // library and vendor files
/public (aka public_html, htdocs etc)
    index.php
    .htaccess
    /css
    /images
    /js

答案 1 :(得分:1)

如果可以,请在服务器上配置vhost,并使其指向应用程序的“public”文件夹。

您还应该启用apache的重写模块,并确保您的vhost接受.htaccess文件(在您的vhost中指令AllowOverride All)。

答案 2 :(得分:1)

我这样做的方法是从公共目录中升级index.php.htacess 1并相应地更改index.php中定义的路径。

e.g

set_include_path(implode(PATH_SEPARATOR, array( realpath(APPLICATION_PATH . '/../library'), get_include_path(), )));

相关问题