I had setup a symfony debugging environment before and now it doesn't work.
Breakpoints do not work. Only way for me to debug is to set 'Break at First Line' option in debug configuration.
Not sure what i changed as I had this environment working until recently, not sure what has changed.
Anyway here are my steps (some recanted from memory as setup these projects few months ago):
The apache virtual host itself is:
- Code: Select all
DirectoryIndex index.php index.html
Allow from All
#got different versions of symfony libs in another folder so i can choose which common lib I want to use for web projects ... so i can just update the one Symfony 1.X code base
Alias /sf "C:\dev\libs\symfony\symfony10\data\web\sf"
Allow from All
(also C:/windows/system32/drivers/etc/hosts file is set to point to blah.localhost to localhost):
and to enable debugging i have in php.ini a reference to where the xdebug extension is, and also some settings:
php.ini has xdebug installed (or zend, right now I have xdebug enabled). phpinfo() confirms this...
- Code: Select all
#Zend debugger ... uncomment below and comment xdebug if using Zend.
#zend_debugger.connector_port = 10000
; profiler settings
; This will stop profiling process, and every time you wish to start profiling you must change it back to 1, and restart Apache.
; can debug specific pages by adding to url: ?XDEBUG_PROFILE=1
;3 below shows what goes into function calls
xdebug.collect_params = 3
;3 output dirs ... for Win/KCacheGrind to analyze php code
I have Eclipse PDT (php plugins included) installed.
Eclipse also has the debugger plugins installed (think came default with Zend, had to install Xdebug. u can google that if want to use Xdebug)...
I setup a new php project in Eclipse called blah (symfony directory structure in there like c:/dev/workspace/blah/web ,etc ).
It was in fact checked out of SVN.
Project is put into the folder c:/dev/workspace/blah
Under Eclipse Preferences->PHP->Debug->Installed Debuggers, i have Zend Debugger port 10000 and Xdebug Port 9000 (i switch between them sometimes by keeping one I want uncommented in php.ini ... I had them both working at some point for symfony debugging. For this example, just trying to get my preferred debugger Xdebug to work, although problem of breakpoints now working occurs for both debuggers).
In Eclipse Preferences->PHP->PHP Servers, I called the name of server: 'Blah.Server' and for the 'Enter the url that points to document root of this server' setting, i had: 'http://blah.localhost'
In the Path Mappings, not sure what to put here ... before I think had for 'Path on server': 'c:/dev/workspace/blah' and Local Path('Path in Workspace') set to /blah.
This may be the main issue, as i heard if breakpoints don't work, the path mappings might be to blame ... although this is a pretty simple example with no remote stuff, just localhost (although it is a lil' advanced eclipse environment as the front controller frontend_dev.php served out of web/ folder).
EDIT: I needed this mapping... 'Path on Server' set to '/' and Local Path('Path in Workspace') set to '/blah/web'
The eclipse Debug configuration,
points to 'Server Debugger': 'XDebug'
PHP Server points to the 'Blah.Server' one i setup.
Has 'Break at First Line' unchecked as i dont want to step through everything...
File: is 'frontend_dev.php/mymodule/myaction/param_id/45'
Url is: 'http://blah.localhost/' and '/frontend_dev.php/mymodule/myaction/param_id/45'
In Advanced, I have 'Open in Browser' checked and 'Debug All Pages' option selected, cause I want to debug my breakpoints which are on a page after a POST/submit. (so it should look for break points at all times while I'm surfing the site).
Anyway, once I click Debug, It goes to the url 'http://blah.localhost/frontend_dev.php/mymodule/myaction/param_id/45' correctly ... it doesnt stop at any of my breakpoints anymore... If i change that 'Break at First Line' and re-debug, it starts debugging... But obviously I don't want to click a thousand times just to get to where my break point is.
I think possibly the Path Mapping setting is wrong. Although it is the same as when debugging was working...
So in summary:
Apache-virtual-hosted out of: C:\dev\workspace\blah\web
Symfony/Eclipse Workspace: C:\dev\workspace\blah
Url to reach site (serves the website out of the workspace): http://blah.localhost
If anyone has an idea of what the Server Mapping should be in my example, or anything else wrong, let me know .
If i figure out whats wrong, i'll post here as there aren't many Symfony+Eclipse+Debugging articles.