Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » PHP Development Tools (PDT) » failed openning '../include.inc.php'
failed openning '../include.inc.php' [message #52251] Mon, 17 September 2007 16:13 Go to next message
Bogdan Ribic is currently offline Bogdan RibicFriend
Messages: 13
Registered: July 2009
Junior Member
I have a problem running a script from eclipse / xdebug. Script
otherwise works fine on the server and evrywhere else. Problem is trying
to include a file from parent folder, ie line with

require_once '../include.inc.php';

This works fine from ZDE, from php.exe and on the server, from eclipse
it complains that it can't find the file, and I have to rewrite it using
dirname(dirname(__FILE__)) acrobatics.

I'm using milestone 3 and xdebug from all-in-one package, and trying to
do Debug as->Php script.
Re: failed openning '../include.inc.php' [message #52413 is a reply to message #52251] Mon, 17 September 2007 21:17 Go to previous messageGo to next message
Bogdan Ribic is currently offline Bogdan RibicFriend
Messages: 13
Registered: July 2009
Junior Member
Sorry to reply to myself :)

This only happens when trying to run a file from a subfolder. Problem
is that eclipse tries to execute the file while current directory is set
to project root, and not one where file is. If I add
chdir(dirname(__FILE__)) to start of script, it will work correctly and
find the file.

I'm pretty sure this is not a feature, so where do I report the bug ?

Boban.

Bogdan Ribic wrote:
> I have a problem running a script from eclipse / xdebug. Script
> otherwise works fine on the server and evrywhere else. Problem is trying
> to include a file from parent folder, ie line with
>
> require_once '../include.inc.php';
>
> This works fine from ZDE, from php.exe and on the server, from eclipse
> it complains that it can't find the file, and I have to rewrite it using
> dirname(dirname(__FILE__)) acrobatics.
>
> I'm using milestone 3 and xdebug from all-in-one package, and trying to
> do Debug as->Php script.
Re: failed openning '../include.inc.php' [message #52494 is a reply to message #52413] Tue, 18 September 2007 09:14 Go to previous messageGo to next message
D Kelsey is currently offline D KelseyFriend
Messages: 232
Registered: July 2009
Senior Member
Hi Bogdan, you are correct, the Xdebug launcher sets the working directory
to the project root (similar to a java launch which sets the default working
directory to the project root), but if you use the zend debugger it does
something different.

There needs to be a common launch environment for different debugger launches
so they behave in the same way. The other thing that is needed is to
allow the launch to configure the working directory. This is an enhancement and
I will raise this on bugzilla.

Many thanks for highlighting the issue.

Dave Kelsey


Bogdan Ribic wrote:
> Sorry to reply to myself :)
>
> This only happens when trying to run a file from a subfolder. Problem
> is that eclipse tries to execute the file while current directory is set
> to project root, and not one where file is. If I add
> chdir(dirname(__FILE__)) to start of script, it will work correctly and
> find the file.
>
> I'm pretty sure this is not a feature, so where do I report the bug ?
>
> Boban.
>
> Bogdan Ribic wrote:
>> I have a problem running a script from eclipse / xdebug. Script
>> otherwise works fine on the server and evrywhere else. Problem is
>> trying to include a file from parent folder, ie line with
>>
>> require_once '../include.inc.php';
>>
>> This works fine from ZDE, from php.exe and on the server, from eclipse
>> it complains that it can't find the file, and I have to rewrite it
>> using dirname(dirname(__FILE__)) acrobatics.
>>
>> I'm using milestone 3 and xdebug from all-in-one package, and trying
>> to do Debug as->Php script.
Re: failed openning '../include.inc.php' [message #52601 is a reply to message #52494] Tue, 18 September 2007 13:12 Go to previous messageGo to next message
Bogdan Ribic is currently offline Bogdan RibicFriend
Messages: 13
Registered: July 2009
Junior Member
Dave,

I already submitted a bug report, bug id 203668

https://bugs.eclipse.org/bugs/show_bug.cgi?id=203668

Btw, I noticed another one, about launch history and not checkign launch
settings (wether to execute openned file or to execute last launched).
More specificaly, pressing F11 will launch last file I added to the
history, not the last one I executed with debug as -> php script.

I'd appreciate a way to just execute / debug the script that's openned
in editor. Will make a bug report for that too :)

Boban

Dave Kelsey wrote:
> Hi Bogdan, you are correct, the Xdebug launcher sets the working directory
> to the project root (similar to a java launch which sets the default
> working
> directory to the project root), but if you use the zend debugger it does
> something different.
>
> There needs to be a common launch environment for different debugger
> launches
> so they behave in the same way. The other thing that is needed is to
> allow the launch to configure the working directory. This is an
> enhancement and
> I will raise this on bugzilla.
>
> Many thanks for highlighting the issue.
>
> Dave Kelsey
>
Re: failed openning '../include.inc.php' [message #52627 is a reply to message #52601] Tue, 18 September 2007 14:00 Go to previous messageGo to next message
D Kelsey is currently offline D KelseyFriend
Messages: 232
Registered: July 2009
Senior Member
Bogdan,
I see in the bug you raised, you also refer to an editor problem. I will
add a comment that the issue with xdebug is covered by an enhancement to PDT
and that the defect is only about the editor not linking.

Pressing F11 is not a defect but a new "feature" of eclipse 3.3. You can change this
behaviour to work in the manner you want by going to preferences in the
Launching tab under "Run/Debug" change Launch Operation to
Always Launch the previously launched application.

You should be able to just execute/debug the script that is in the editor
just bring up the pop up menu in the file you are editing and select
Run as-->PHP Script.

Cheers
Dave Kelsey

Bogdan Ribic wrote:
> Dave,
>
> I already submitted a bug report, bug id 203668
>
> https://bugs.eclipse.org/bugs/show_bug.cgi?id=203668
>
> Btw, I noticed another one, about launch history and not checkign launch
> settings (wether to execute openned file or to execute last launched).
> More specificaly, pressing F11 will launch last file I added to the
> history, not the last one I executed with debug as -> php script.
>
> I'd appreciate a way to just execute / debug the script that's openned
> in editor. Will make a bug report for that too :)
>
> Boban
>
> Dave Kelsey wrote:
>> Hi Bogdan, you are correct, the Xdebug launcher sets the working
>> directory
>> to the project root (similar to a java launch which sets the default
>> working
>> directory to the project root), but if you use the zend debugger it does
>> something different.
>>
>> There needs to be a common launch environment for different debugger
>> launches
>> so they behave in the same way. The other thing that is needed is to
>> allow the launch to configure the working directory. This is an
>> enhancement and
>> I will raise this on bugzilla.
>>
>> Many thanks for highlighting the issue.
>>
>> Dave Kelsey
>>
Re: failed openning '../include.inc.php' [message #52733 is a reply to message #52627] Tue, 18 September 2007 15:05 Go to previous message
Bogdan Ribic is currently offline Bogdan RibicFriend
Messages: 13
Registered: July 2009
Junior Member
Dave Kelsey wrote:

>
> Pressing F11 is not a defect but a new "feature" of eclipse 3.3. You can
> change this
> behaviour to work in the manner you want by going to preferences in the
> Launching tab under "Run/Debug" change Launch Operation to
> Always Launch the previously launched application.

I tried that, these settings are pretty much ignored. I submitted
another bug report, with longer explanation of what happens.

https://bugs.eclipse.org/bugs/show_bug.cgi?id=203761

also, F11 behavior is not consistent with that in java mode, where F11
will launch last launched configuration, not last one added to launch
config list.

And I have couple complaints about code formatting with heredoc (adding
{$something} makes it attempt to indent heredoc string and couple more
oddities) and indenting blocks that are not inside braces,
refactor->rename does nothing... but will submit these some other time :)

.... trying to leave ZDE for good.

Boban.
Previous Topic:Mac+MAMP+EclipsePDT > Mysql connection problem
Next Topic:How do I _completely_ delete a Project?
Goto Forum:
  


Current Time: Fri Apr 19 11:30:55 GMT 2024

Powered by FUDForum. Page generated in 0.02071 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top