如何解决在goDaddy.com上发布zend网站问题
| 我正在尝试将zend应用程序从本地移动到远程。将所有文件夹上传到GoDaddy主机后,这是我的文件夹结构:/html
/application
/configs
/controllers
/models
/views
bootstrap.php
/library
/public
/css
/images
/js
.htaccess
index.php
我的index.php:
// Define path to application directory
defined(\'APPLICATION_PATH\')
|| define(\'APPLICATION_PATH\',realpath(dirname(__FILE__) . \'/../application\'));
// Define application environment
defined(\'APPLICATION_ENV\')|| define(\'APPLICATION_ENV\',(getenv(\'APPLICATION_ENV\') ? getenv(\'APPLICATION_ENV\'): \'production\'));
//add library directory to include path
set_include_path(implode(PATH_SEPARATOR,array(
dirname(dirname(__FILE__)) . \'/library\',dirname(dirname(__FILE__)) .
\'/application/models\',dirname(dirname(__FILE__)) .
\'/application/forms\',dirname(dirname(__FILE__)) . \'/application/views/scripts\',get_include_path())));
/** Zend_Application */
require_once \'Zend/Application.php\';
// Create application,bootstrap,and run
$application = new Zend_Application(
APPLICATION_ENV,APPLICATION_PATH . \'/configs/application.ini\');
$application->bootstrap()->run();
现在,如果我尝试输入以下URL:\“ www.mysite.com/public/index/index \”,则会收到此错误:
The requested URL /public/index/index/ was not found on this server.
Additionally,a 404 Not Found error was encountered while trying
to use an ErrorDocument to handle the request.
如果我只输入:\“ www.mysite.com/public/ \”,则会收到此警告:
Warning: require_once(/home/content/66/6902756/html/application/Bootstrap.php
[function.require-once]: failed to open stream: No such file or directory
in /home/content/66/6902756/html/library/Zend/Application.php on line 320
Fatal error: require_once() [function.require]: Failed opening
required \'/home/content/66/6902756/html/application/Bootstrap.php\'
(include_path=\'/home/content/66/6902756/html/application/../library:
/home/content/66/6902756/html/library:
/home/content/66/6902756/html/application/models:
/home/content/66/6902756/html/application/forms:
/home/content/66/6902756/html/application/views/scripts:
.:/usr/local/php5/lib/php\')
in /home/content/66/6902756/html/library/Zend/Application.php on line 320
在当地,一切正常
更新
在我的index.php中,我尝试了:
//it output \"exists\"
echo file_exists( \'/home/content/66/6902756/html/application/Bootstrap.php\' )?\'exists\':\'no file found\';
//where \'/home/content/66/6902756/html\' is my absolute hosting path
谢谢
解决方法
我敢打赌,您的问题的主要部分是您在包含路径中使用了“ 5”。尝试将它们替换为常数replacing6ѭ。就个人而言,我会摆脱所有那些
dirname(dirname(__FILE__))
。而是使用内置的APPLICATION_PATH
:
set_include_path(implode(PATH_SEPARATOR,array(
dirname( APPLICATION_PATH ) . DIRECTORY_SEPARATOR . \'library\',//note one exception
APPLICATION_PATH. DIRECTORY_SEPARATOR . \'models\',APPLICATION_PATH. DIRECTORY_SEPARATOR . \'forms\',APPLICATION_PATH. DIRECTORY_SEPARATOR . \'views\'. DIRECTORY_SEPARATOR .\'scripts\',get_include_path())));
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。