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:
C:\xampp\php\php.exe
C:\xampp\php\php.ini
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:
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
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).