Zendframe work include path Error on Hosting
I am trying to implement oAuth using Zendframe work. The script is running great on my localhost whereas when i am hosting the same files on to server (online) it is giving me include path error. I am not figuring out what might开发者_C百科 be the problem.
Error : Warning: require_once(Zend/Http/Client.php) [function.require-once]: failed to open stream: No such file or directory in
Thank You
You have to add the path in which Zend Framework is installed to your include path:
set_include_path('/path/where/Zend/directory/is' . PATH_SEPARATOR . get_include_path());
The include path is where PHP searches when you include a script.
Also, it's likely that you may have to upload the Zend Framework to your hosting server, as your hosting provider may not have installed it.
Sounds like the location where Zend Framework exists on your local host is defined in the default include path of your PHP configuration, or you're setting some include paths specific to application environment.
Compare the output of your get_include_path()
in development and production, to see where it goes wrong. You can add the path where the application can find the Zend files from with set_include_path()
, eg:
set_include_path(
APPLICATION_PATH.'/../library'.
PATH_SEPARATOR.
get_include_path()
);
精彩评论