views:

356

answers:

3

Hi all,

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

+1  A: 

Wouldn't manually re-adding the old paths using

set_include_path(get_include_path() . PATH_SEPARATOR . $path);

in the first line of the script you're running work?

Pekka
I guess it does, but I don't want to do that. The php.ini is here for that ^^ (and most of all this is a shared project, I can't)
Matthieu
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

That way, even if your path is replaced, it will be replaced by:

  • your path
  • all the other librairies
VonC
Yes I guess this would be the fallback solution, but it bothers me that I (and my team) spent time configuring the php.ini, and that we should re-add it to Eclipse for each project (about 10). With the php.ini, it's done once. Eclipse sucks on that particular point or what ?
Matthieu
@Matthieu: true, but once added, it won't change, and the launched session will preserve that path. Not ideal but it should work.
VonC
A: 

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

Matthieu