包含 Eclipse 忽略的 php.ini 路径
我有一个 PHP 脚本要运行。如果我从命令行运行它,它工作正常(包含路径设置正确)。
如果我想在 Eclipse 中运行它(作为脚本运行),那么 php.ini 的 PHP 包含路径将被 Eclipse 替换,其中包含我添加到项目中的所有库。
我已经在 Eclipse 中配置了 PHP 可执行文件。我已经设置了正确的 PHP 可执行文件,并且也选择了 php.ini 文件(我已经检查过,是正确的)。但它被忽略了......
编辑:这是一个 Eclipse 错误: https://bugs.eclipse.org/bugs/process_bug.cgi
I have a PHP script to run. If I run it from the command line, it works fine (include path is set correctly).
If I want to run it inside Eclipse (Run as script), then the PHP include path of my php.ini is replaced by Eclipse, with all the libraries I've added to the project.
I've configured my PHP executable in Eclipse. I've set the correct PHP executable file, and I selected my php.ini file too (the right one, I've checked). But it is ignored...
Edit : this is an Eclipse bug :
https://bugs.eclipse.org/bugs/process_bug.cgi
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
在 Eclipse for PHP Cli 应用程序中
1) 单击“项目属性”
2) 单击“包含路径”
3) 添加外部文件夹和/或源和/或库
执行此操作后,我能够运行我的程序。如果我没有执行上述操作,我就必须使用函数
set_include_path(get_include_path() . PATH_SEPARATOR . "c:\PHP\PEAR");等等......
对于 PHP Web 应用程序,我没有遇到问题,因为我将 include_path var 与我的配置一起放入 Apache2 vhosts 文件中。
In Eclipse for PHP Cli Applications
1) Click on Project Properties
2) Click on Include Path
3) Add external folder and/or Source and/or Libraries
After doing such I was able able to run my programs. If I didn't do the above I was having to use the function
set_include_path(get_include_path() . PATH_SEPARATOR . "c:\PHP\PEAR"); etc...
For PHP Web applications I wasn't having issue because I put my include_path var in the Apache2 vhosts file along with my configuration.
使用手动重新添加旧路径不会起作用吗?
在您正在运行的脚本的第一行中
Wouldn't manually re-adding the old paths using
in the first line of the script you're running work?
您能否将当前的 php 包含路径添加为链接文件夹 在您的项目中,为了引用 PHP 包含路径中的链接目录?
替代文本 http://files.zend.com/help/PDT/include_path_properties.png< /a>
这样,即使你的路径被替换,它也会被替换为:
Could you add the current php include path as a linked folder within your project, in order to reference that linked directory in the PHP include path?
alt text http://files.zend.com/help/PDT/include_path_properties.png
That way, even if your path is replaced, it will be replaced by:
这是Eclipse的一个bug,已经修复了3个bug,但没有一个得到修复。
不修改 PHP 文件就没有解决方案。
https://bugs.eclipse.org/bugs/process_bug.cgi
This is a bug of Eclipse, 3 bugs have been filled about it but none of them got fixed.
No solution without modifying your PHP files.
https://bugs.eclipse.org/bugs/process_bug.cgi