Smart questions
Smart answers
Smart people
Join Tek-Tips Forums
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Member Login




Remember Me
Forgot Password?
Join Us!

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips now!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

Join Tek-Tips
*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.
Jobs from Indeed

Link To This Forum!

Partner Button
Add Stickiness To Your Site By Linking To This Professionally Managed Technical Forum.
Just copy and paste the
code below into your site.

Debugging PHP

PHPEclipse IDE (on windows) breakpoints
Posted: 10 Aug 06

PHPEclipse got great features once you got it working.
What I use most is the editor (syntax check and intellisence for variables). And the debugger, looking at variables when a breakpoint is hit can speed up debugging 100 times for someone who is just staring with PHP.
Another great friend of mine is php_manual_en.chm
The on line manual as compiled windows help file, keep it open at all times.

Here are the steps I took to get it working, please ask me if it didn't work or if you think something is missing (like linux install).


Note, do not download newer versions of eclipse, php or whatever
these packages work together, with other versions it might not work
Extract the files to the directories given here or it wil not work.
I've downloaded all the needed installs and zips.
Other people can google for it, most installs and zips can be found
immediately but dbg-2.13.1-win32.zip you have to google for dbg and php
Note that you do this on a dev pc, xampp leaves a lot of security holes
for php settings and no admin password for mysql. check out xampp site
to fix but make sure debugging works first, if it doesn't work after
you might know what you've changed to mess it up.

Download and install sun jdk jdk-1_5_0_07-windows-i586-p.exe


Extract xampp-win32-1.4.9.zip to c:\xampp
run setup_xampp.bat (in a commandprompt with cmd)
start xampp with xampp_start.exe (do not close the cmd window)
A couple of things that could give you problems are:
1. IIS or another webserver is allready running and takes port 80
2. Skype is running and takes a port that apache wants, apache won't start then.
open localhost in a browser
check the php version (top of the page)
this case 5.0.2
extract the correct php dll files from dbg-2.13.1-win32.zip
copy file php_dbg.dll-5.0.5
to
C:\xampp\php\extensions
C:\xampp\php\ext
rename the file php_dbg.dll
copy php.ini ( http://www.geocities.com/harm_meijer/php.ini )
C:\xampp\php
C:\xampp\php (as php5.ini)
C:\xampp\apache\bin
stop apache and mysql and start it again
open localhost and click in the side menu phpinfo()
The page should contain with DBG v2.13.1, (C) 2000,2006, by Dmitri Dmitrienko
(look for the text dbg)

extract eclipse-SDK-3.1.2-win32.zip to c:\xampp
extract net.sourceforge.phpeclipse_1.1.8.bin.dist.zip to C:\xampp\eclipse
start eclipse (C:\xampp\eclipse)
As a workspace you have to use C:\xampp\htdocs\PHPeclipse

Edit the C:\xampp\apache\conf\httpd.conf
to add the eclipse workspace (C:\xampp\htdocs\PHPeclipse):

Alias /eclipse "C:\xampp\htdocs\PHPeclipse"
<Directory "C:\xampp\htdocs\PHPeclipse">
  Options Indexes MultiViews
  AllowOverride None
  Order allow,deny
  Allow from all
</Directory>

stop and start apache

windows only needed for php help when called from eclips,I didn't get this
to work, it should open the correct page when pressing chift +ctrl + h
copy php_manual_en.chm to C:\xampp\php
In eclipse choose window -> preferences
phpEclipse web development -> php -> help (win_32..)
next to php*.chm file fill in C:\xampp\php\php_manual_en.chm
click apply

Same window side menu called Installed interpenters
add C:\xampp\apache\bin\php.exe

Same window side menu called PHP external tools
fill in the following values for
RUN php command: C:\xampp\apache\bin\php.exe
Parse command C:\xampp\apache\bin\php.exe -l -f {0}
click apply

under PHP external tools -> apache fill in
next to Apache the value C:\xampp\apache\bin\Apache.exe
next to path to httpd.conf C:\xampp\apache\conf\httpd.conf
click apply

then left side menu click MYSQL
next to MYSQL fill in C:\xampp\mysql\bin\mysql.exe
click apply

left side menu under project defaults
next to localhosts the value http://localhost/eclipse
click apply
click OK

In eclipse choose file -> new -> project
php -> php project -> next
project name is test and keep "use default location" checked -> finished

Before debugging run cmd and run xampp_start.exe in c:\xampp (keep the command window open)
In eclipse choose Run -> Debug...
Left side menu click PHP DBG Script -> new
environment tab -> interpreter tab a value of c:\xampp\apache\bin\php.exe should be the interpreter
Remote Debug tab -> check remote debug and open with DBGSession URL in internal Browser
Remote source path should be somewhere in C:\xampp\htdocs\PHPeclipse\[your project]
When you click debug button (first time) eclipse should ask you if you want to switch to debug workspace, click yes and remember this setting
The first time it might not work, close and restart eclipse it should work the second time.
Eclipse debugger will attach to any browser requesting a get parameter http://localhost/eclpse/[your project]/[your php file]?DBGSESSID=1@clienthost:[process=mostly 10001]
Remember to stop debugging on my pc javaw.exe takes 100% cpu after page has loaded (not when hitting a breakpoint)


checkout this url for more help
http://support.nusphere.com/viewtopic.php?t=576
http://www.plog4u.org/index.php/Using_PHPEclipse_:_Installation_:_Installing_Apache/MySQL/PHP

Back to PHP FAQ Index
Back to PHP Forum

My Archive

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close