PDA

Click to See Complete Forum and Search --> : PHP in Eclipse - Include Path


StrangerInBeijing
Dec 2nd, 2009, 09:33 AM
I got Apache, MySQL, PHP, PEAR and PHPUnit working on my local machine (I wanted to do things without xampp or wampserver). All fine (It seems!)

Before all this I had xampp, and coded PHP in Eclipse (installed PDT).

When I create a php page, and include "PHPUnit/Framework.php'" it finally work (because I never bothered with PEAR, I never bothered with include paths..that's working now).

Running this file in my localhost works fine. No errors, and the whole include_path thing seems to work out fine as the files above can be found without error.

But with the file open in Eclipse, doing a "Run As->PHP Script" return an error complaining the include cannot be found (and it state the path to be the path to the folder this script is in!).
So I got a feeling the php eclipse pdt or whatever have it's own include path or something like that?

StrangerInBeijing
Dec 2nd, 2009, 09:42 AM
Oh wait, I got it.
In PHP Perspective, right click the project->Include Path->Configure Include Path->Libraries->Add External Source Folder and add your include folder (in my case "D:\Apps\PHP\PEAR\pear" .. yeah I know, I made a mistake during installing and configuring things and got a pear folder inside a PEAR folder)

That is the "normal" and only way?

kows
Dec 2nd, 2009, 10:47 AM
I've never used Eclipse, so I can't help you. however, after looking at their website, I may consider giving them a try, as I'm somewhat unhappy with my current editor. we'll see!

StrangerInBeijing
Dec 3rd, 2009, 01:06 AM
Bit of a hassle if you are new to it, but by now I use eclipse for java, php, html, css and the lot.
Miss some minor things one take for granted (like Ctrl+Tab doing nothing) but it's pretty good though. (Coming from someone having used nearly every editor / ide out there I guess that means I vouch for it)