SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Addict Caterwomtious's Avatar
    Join Date
    Dec 2001
    Posts
    222
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    $_SERVER not populated when using Eclipse PDT with xdebug

    I'm trying to set up PHP debugging using Eclipse PDT and xdebug. I'm temptingly close: I can step though a simple test script successfully.

    However, when I try to debug my actual website I hit a problem. The $_SERVER array doesn't have all its usual variables populated when debugging, and my scripts rely on them. It's fine when I run the page normally.

    A var_dump($_SERVER) when debugging shows that it's not completely empty; it has the following variables set to appropriate values:

    • 'ALLUSERSPROFILE'
    • 'APPDATA'
    • 'CLASSPATH'
    • 'CLIENTNAME'
    • 'CommonProgramFiles'
    • 'COMPUTERNAME'
    • 'ComSpec'
    • 'DBGP_COOKIE'
    • 'DBGP_IDEKEY'
    • 'HOMEDRIVE'
    • 'HOMEPATH'
    • 'LD_LIBRARY_PATH'
    • 'LOGONSERVER'


    Does anyone have any idea what how I might get the usual DOCUMENT_ROOT, REQUEST_URI etc in there during a debug session?

    I'm using Windows XP, Apache 2.2, PHP 5.2.6, Eclipse 3.3.2 and xdebug 2.0.3-5.2.5

  2. #2
    Coding and Breathing CoderMaya's Avatar
    Join Date
    Feb 2008
    Location
    Atlit, Israel
    Posts
    470
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hmm.. I'm not sure as I never used debugging for PHP, but does x debug use Apache somehow?
    Learn about the new Retro Framework
    Code PHP the way it was meant to be coded!

  3. #3
    . shoooo... silver trophy logic_earth's Avatar
    Join Date
    Oct 2005
    Location
    CA
    Posts
    9,013
    Mentioned
    8 Post(s)
    Tagged
    0 Thread(s)
    Using PHP thought the command-line is different then running though a server like Apache. $_SERVER will not contain those things that are associated with a server. (REQUEST_URI, DOCUMENT_ROOT, HTTP_*)
    Logic without the fatal effects.
    All code snippets are licensed under WTFPL.



Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •