Eclipse 和 Xdebug 不会解析 /etc/php5/conf.d 中的其他 ini 文件
我已经在 Ubuntu 11.4 上为 AMD64 和 Xdebug 设置了 Eclipse 3.6.2。
Eclipse 是通过从 eclipse.org 下载的 zip 文件安装的。 PHP 和 Xdebug 是使用 apt-get 设置的。
当我在 shell 中运行 PHP 脚本时,它们将使用 /etc/php5/php.ini
文件并解析 /etc/php5/conf.d/
中的其他 ini 文件>。
当我在 Eclipse 中运行(运行模式或调试模式)时,它只会解析 php.ini 而不会解析其他 ini 文件。
基本上,所有扩展都没有加载。
I have setup Eclipse 3.6.2 on Ubuntu 11.4 for AMD64 and Xdebug.
Eclipse was installed with zip download from eclipse.org.
PHP and Xdebug were setup with apt-get.
When I run the PHP script in the shell they will use the /etc/php5/php.ini
file and parse additional ini files in /etc/php5/conf.d/
.
When I run in Eclipse (run mode or debug mode) it will only parse php.ini
and no additional ini files.
Basically, all extensions, are not loaded.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
这是一个故意的错误。
PDT 始终使用“-n”选项执行 php。它使其他 ini 文件不可用。
请参阅 https://bugs.eclipse.org/bugs/show_bug.cgi?id= 339547
还有 https://bugs.eclipse.org/bugs/show_bug.cgi?id= 347618
顺便说一句,您将能够添加一个 shell 脚本,将“-n”选项修剪为 PHP 可执行文件。(首选项>PHP>PHP可执行文件)
例如,
It is an intentional bug.
PDT executes php with "-n" option always. It makes additional ini files unavailable.
see https://bugs.eclipse.org/bugs/show_bug.cgi?id=339547
also https://bugs.eclipse.org/bugs/show_bug.cgi?id=347618
BTW, you'll be able to add a shell script which trims "-n" option as PHP Executable.(Preferences>PHP>PHP Executables)
For example,
@atlanto 给出的答案作为解决方法确实并且仍然有效,但是最新版本的 Eclipse(我在 Neon 上)有一个修复程序,如果您不介意使用 php.ini< /code> 和
conf.d
默认为 php 可执行文件设置。仅当您在定义 PHP 可执行文件时放入显式
php.ini
文件时,才会出现加载其他文件失败的情况。 将此留空并选中此框使用系统默认 php.ini 配置
。,如果您使用在构建可执行文件时指定为默认值的 location/php.ini,它将尊重
conf.d
目录的扫描。以下是如何检查您的
php
是否启用了扫描conf.d
以及适当的默认位置在哪里:您应该看到类似以下内容:
重要的项目是:
with-config-file-path
:它将在此处查找您的php.ini
文件with-config-file-scan-dir
:这是 将扫描conf.d
如果您仍然愿意, 要选择与可执行文件的默认位置不同的位置,您的选项是:
conf.d
中的模块指令和文件内联到备用php.ini
中The answer @atlanto gives as a work around did and does still work, but recent version of Eclipse (I'm on Neon) has a fix that may work for you if you don't mind using the
php.ini
andconf.d
set by default for the php executable.The failing to load additional files only happens now if you put in an explicit
php.ini
file when defining a PHP executable. Leave this blank and check the boxUse system default php.ini configurate
.Now if you use the location/php.ini that was specified as default when the executable was built, it will respect scanning of
conf.d
directories.Here's how to check if your
php
has scanningconf.d
enable and where the approriate default location is:You should see something like:
The items that matter are:
with-config-file-path
: this where it will look for yourphp.ini
filewith-config-file-scan-dir
: this is theconf.d
that will be scannedIf you still wish to choose a different in location than the default for the executable your options are:
conf.d
into your alternatephp.ini