dongye1912 2017-03-02 02:56
浏览 105

Eclipse PDT中的PHP CLI应用程序调试

I'm trying to get PHP CLI Application debugging working in Eclipse. When I click Debug As->PHP CLI Application, it opens the Debug perspective properly, but when I step through my code, the include statements throw the warning:

include_once(): Failed opening 'database.inc' for inclusion (include_path='.') in C:\xampp\www\exec\parse_nvd_cve.php on line 30

And of course, the code dies immediately afterward because the functions in the include files are undefined.

Here is my Eclipse PHP Executable config:

  • Name: XAMPP PHP
  • Executable Path: C:\xampp\php\php.exe
  • PHP ini file (optional): C:\xampp\php\php.ini
  • Use system default php.ini (checked)
  • Configuration SAPI Type: CLI

I've also tried un-checking "Use system default php.ini" and leaving the PHP ini file blank, all yield the same result.

And my Debug Config:

  • Runtime PHP: Project default: XAMPP PHP

Debugger is XDebug and it's working fine for remote debugging of the Web Applications in the same project.

My include path is set correctly in php.ini, and it works fine when I run the same script from the command line. The file I'm attempting to include is in C:\xampp\www\inc\database.inc. All the include files are in C:\xampp\www\inc\ and they are all in the same project.

From php.ini: include_path=".;C:\xampp\php\PEAR;C:\xampp\www\inc;C:\xampp\www\classes"

I am using Eclipse Neon 4.6.0 Build id 20160613-1800 and XAMPP 5.6.23-0

  • 写回答

1条回答 默认 最新

  • dongzongzi0379 2017-03-09 01:43
    关注

    Solution was to add the include path to all the include folders in the project properties (Right-click Project -> Properties -> PHP -> Include Path (I found the answer here).

    评论

报告相同问题?

悬赏问题

  • ¥15 c语言怎么用printf(“\b \b”)与getch()实现黑框里写入与删除?
  • ¥20 怎么用dlib库的算法识别小麦病虫害
  • ¥15 华为ensp模拟器中S5700交换机在配置过程中老是反复重启
  • ¥15 java写代码遇到问题,求帮助
  • ¥15 uniapp uview http 如何实现统一的请求异常信息提示?
  • ¥15 有了解d3和topogram.js库的吗?有偿请教
  • ¥100 任意维数的K均值聚类
  • ¥15 stamps做sbas-insar,时序沉降图怎么画
  • ¥15 买了个传感器,根据商家发的代码和步骤使用但是代码报错了不会改,有没有人可以看看
  • ¥15 关于#Java#的问题,如何解决?