Debugger error with $doc_root = $_SERVER['DOCUMENT_ROOT']

General discussion on Zend Studio

Debugger error with $doc_root = $_SERVER['DOCUMENT_ROOT']

Postby mbs400 on Mon Jul 20, 2009 3:29 am

.
When debugging in a small project in Eclipse PDT for OS X when I get to either of the lines below I get :

$doc_root = $_SERVER['DOCUMENT_ROOT'] ;
Notice: /site/error/main_error_handler.php line 149 - Undefined index: DOCUMENT_ROOT

$rem_addr = $_SERVER['REMOTE_ADDR'] ;
Notice: /site/error/main_error_handler.php line 164 - Undefined index: REMOTE_ADDR

yet when I run the page normally, just using the browser there are no errors and

echo $doc_root ;
echo $rem_addr ;

both work like they should...

I am running ZendServer CE with htdocs as the Document Root

I need to be able to rely on the debugger, not have it introduce more errors.

If I look at the $_SERVER variable in the debugger prior to the error, sure enough the values are missing.

Any ideas ?
.
.
mbs400
 
Posts: 43
Joined: Tue Jul 14, 2009 10:13 pm

Re: Debugger error with $doc_root = $_SERVER['DOCUMENT_ROOT']

Postby mbs400 on Mon Jul 20, 2009 3:36 am

.
I just ran the same project with ZendStudio 5.5.1 ons OS X and there were no errors, the variable values printed just fine...

I've looked at the preferences for Eclipse ---> php and also for the project and could not find anything that might be causing the problem.
.
.
mbs400
 
Posts: 43
Joined: Tue Jul 14, 2009 10:13 pm

Re: Debugger error with $doc_root = $_SERVER['DOCUMENT_ROOT']

Postby rbzend on Mon Jul 20, 2009 10:52 am

I'm quite sure that you are using local debugging. One of the main differences between local and remote debugging is that remote debugging runs in the server's environment and has all relevant data in the $_SERVER array. Follow this link for the procedure of remote debugging - http://files.zend.com/help/Zend-Studio- ... b_page.htm
User avatar
rbzend
 
Posts: 530
Joined: Tue Dec 23, 2008 5:03 pm

Re: Debugger error with $doc_root = $_SERVER['DOCUMENT_ROOT']

Postby mbs400 on Wed Jul 22, 2009 4:46 pm

.
I've been using Zend Studio 5.5.x for some time, and recently I began trying to work with Eclipse PDT, and found that the problem I was having was that I was not playing by its rules. With Zend Studio you could basically do F8 (Debug URL...) then paste "http://localhost/index.php" hit OK and life was swell.

With Eclipse it seems that there is more to setup before you go off debugging...

So yesterday I went to over to Nerdbooks and that found they had 34 different books on "Eclipse" in stock, anyway got :

( 1 ) Zend Studio for Eclipse
( 2 ) Zend Framework in Action

I might as well learn the rules in order to make this a painless proposition...

BTW, once I got the Eclipse setup more or less correct, all the variables showed up.

Thanks for the help...
.
.
mbs400
 
Posts: 43
Joined: Tue Jul 14, 2009 10:13 pm

Re: Debugger error with $doc_root = $_SERVER['DOCUMENT_ROOT']

Postby mbs400 on Wed Jul 22, 2009 4:55 pm

I am terrible at proof reading. My previous message should have said :

...anyway I got :

( 1 ) Zend Studio for Eclipse
( 2 ) Zend Framework in Action
mbs400
 
Posts: 43
Joined: Tue Jul 14, 2009 10:13 pm


Return to Zend Studio

Who is online

Users browsing this forum: No registered users and 1 guest