0

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 error 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?

9
  • 1
    The Zend/Loader.php file is located at E:\Server\htdocs\frameworks\Zend\Zend\Loader.php, with two Zend directories? Commented Jun 7, 2011 at 1:27
  • Linux doesn't use drive letters E: Commented Jun 7, 2011 at 1:30
  • @Radu no just 1 zend directory E:\Server\htdocs\frameworks\Zend\Loader.php Commented Jun 7, 2011 at 1:33
  • @jasondavis, then your $path should be E:/Server/htdocs/frameworks, not E:/Server/htdocs/frameworks/Zend. Commented Jun 7, 2011 at 1:34
  • @Radu, I just tried that but doesnt have any affect Commented Jun 7, 2011 at 1:39

2 Answers 2

2

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.

Sign up to request clarification or add additional context in comments.

Comments

2
E:\Server\htdocs\frameworks\Zend

versus

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

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

2 Comments

It might be that you're trying to include E:/Server/htdocs/frameworks/Zend/Zend/Loader.php then, cause thats what your code does
It is working, is there a way to set the include path and have it be set for all files

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.