Reputation: 2459
I have tried a lot but not been able to understand the steps involved in debugging a PHP website residing on a remote server with eclipse Indigo PDT and Xdebug. Following is my configuration.
Remote: LAMP, Xdebug(fully setup)
Local: LAMP, Eclipse PDT with RSE,
My main problem is about the setup that I need to do locally with eclipse to be able to debug the remote website. Specifically:
Do I need to create a new eclipse project locally? If yes, where should I load the source files from and how? Do I need an exact copy of the source files as on the server?
Do I need to have all the files locally before I can start debugging? I copied only index.php to a local project and started debugging. I received the remote connection when I started debugging the website and could step through index.php, but not after that. If I don't need to have all the source files locally beforehand, how can I set a break point in a file that is reached after 20 function calls?
What other settings need to be setup to link the local and remote projects. Do I need to add a new PHP server? What should be the settings of the debug configuration?
I know about sshfs and tried to set it up using this link: http://www.docplanet.org/php/how-to-debug-php/ but eclipse took forever to build project files on the server and hung.
I have looked all over. A good link to go with the answers will be appreciated.
Thank you.
Upvotes: 3
Views: 3369
Reputation: 2459
I posted the question on eclipse forums too and got an answer: http://www.eclipse.org/forums/index.php/mv/msg/365474/890896/#msg_890896
So here are the answers:
Yes, you need source files and an eclipse project locally. No debugger delivers source files. I read on SO that for PHP we only need the lines that are being debugged to be same, while for C# the whole project has to be a copy.
Yes, you need the files locally and set your break point in them.
One thing I found is that you don't need to start the debugger like we do with normal projects. Eclipse starts accepting the debugging connection the moment you setup the debugger. So you just need to open the webpage with debugging enabled and eclipse will catch the connection and let you know.
Upvotes: 2