PHP 和文件路径帮助
我现在使用的是 Windows,但我需要我的脚本在 Windows 或 Linux 上运行。我正在开发一个允许将视频上传到 youtube 的项目,youtube 库需要使用 Zend 框架(不幸的是),所以我真的很努力让它工作,但没有运气。
所以我的页面显示
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
我有 Zend 框架,
E:\Server\htdocs\frameworks\Zend
然后尝试设置包含路径,以便脚本可以访问 Zend,这就是我的麻烦开始的地方。我尝试使用这个...
$path = 'E:/Server/htdocs/frameworks/Zend/';
set_include_path(get_include_path() . PATH_SEPARATOR . $path);
但我仍然收到上面看到的错误,现在您可以看到上面脚本的路径和我的 Zend 的路径,有人可以告诉我如何设置包含路径才能正常工作?感谢您的帮助,
到目前为止我尝试了一些建议但没有运气。这是我更新的代码和结果
$path = 'E:\Server\htdocs\frameworks';
set_include_path(get_include_path() . PATH_SEPARATOR . $path);
echo get_include_path();
给出了这个...
E:\Server\php\PEAR;E:\Server\htdocs\frameworks
所以看起来我的 zend 包含路径已添加,但它仍然说找不到它
最终更新!
它正在工作,就在我设置包含路径的地方没有包含在所有文件中,有没有办法设置包含路径并使其在全局范围内可用?
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?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
如果您想更改
php.ini
中的包含路径,只需更改include_path
即可。查看本教程,了解多种更改包括路径。If you want to change the include path in
php.ini
, just changeinclude_path
. Check out this tutorial to find out about a myriad of ways of changing the include path.与
可能会对您的系统产生影响?尝试使用
\
而不是/
。versus
might make a difference on your system? Try it with
\
instead of/
.