publishing zend website issue on goDaddy.com
I'm trying to move my zend application from local to remote.After I uploaded all of my folders on my GoDaddy host this is my folders structure :
/html
/application
/configs
/controllers
/models
/views
bootstrap.php
/library
/public
/css
/images
/js
.htaccess
index.php
my 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();
Now if I try to go type this URL : "www.mysite.com/public/index/index" I receive this error :
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.
And if I just type : "www.mysite.com/public/" I receive this warning :
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
In local everything was working properly
UPDATE In my index.php I tried :
//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
thanks
I'll wager that a major part of your problem is that you're using \
in your include path. Try replacing those with the constant DIRECTORY_SEPARATOR
. Personally, I would get rid of all of those dirname(dirname(__FILE__))
. Instead use the built in 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())));
精彩评论