开发者

Help with PHP and filepaths

I am using windows right now but I need my script to work on windows or linux. I am working on a project which allows to upload video to youtube, the youtube library requires the use of Zend framework (unfortunately) so I am really trying to get it to work, with no luck.

So my page says

Warning: require_once(Zend/Loader.php) [function.require-once]: failed to open stream: No 
such file or directory in 
E:\Server\htdocs\clients\youtube2\demos\Zend\Gdata\YouTubeVideoApp\operations.php on line 37

I have Zend framework located at

E:\Server\htdocs\frameworks\Zend

I then try to set the include path so that the scripts have access to Zend, thats where my trouble starts. I try to use this...

$path = 'E:/Server/htdocs/frameworks/Zend/';
set_include_path(get_include_path() . PATH_SEPARATOR . $path);

But I still get the er开发者_如何学运维ror that you see above, now that you can see the path of my script above and the path of my Zend, can someone show me how to set the include path to work correctly? Thanks for any help


I tried some suggestions with no luck so far. Here is my updated code and result

$path = 'E:\Server\htdocs\frameworks';
set_include_path(get_include_path() . PATH_SEPARATOR . $path);
echo get_include_path();

Gives this...

E:\Server\php\PEAR;E:\Server\htdocs\frameworks

So it appears my include path for zend is added, but it still says it cannot find it


Final Update!

It is working, just where I set the include path wasn't getting included into all the files, is there a way to set the include path and have it be available globally?


If you want to change the include path in php.ini, just change include_path. Check out this tutorial to find out about a myriad of ways of changing the include path.


E:\Server\htdocs\frameworks\Zend

versus

$path = 'E:/Server/htdocs/frameworks/Zend/';

might make a difference on your system? Try it with \ instead of /.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜