filmov
tv
Setting up Xdebug 2.0.6-dev, XAMPP 1.7.3 and Eclipse PDT 2.2.0 on Windows

Показать описание
The following video tutorial shows how to configure Xdebug delivered
with XAMPP and how to use Eclipse PDT for debugging a sample php
project. The video is covered by the written instructions below, see
them as addition, the video should be enough. One note to the end of the
video: The debugging is started twice, in the first debug pass you will
see, that the website is not redirected to the php script receiving the
form data. That sometimes just happens, seems to be some kind of bug. On
the second attempt everything works.
The tutorial uses XAMPP 1.7.3, Xdebug 2.0.6-dev, Eclipse PDT 2.2.0 All
In Ones and Windows 7. It however should work the same on future
versions of the mentioned software. The written instructions assume that
you install XAMPP to C:\ (the default suggested by the installer). Note
that the installer then creates C:\xampp automatically.
1) Get XAMPP (the basic package, only this package includes Xdebug) from
the installer will then automatically create C:\xampp
2) After XAMPP has
replacements:
replace
with
replace
with
3) (Re)start the apache webserver using the XAMPP Control Panel.
4) Get Eclipse PDT All In Ones from
choice. Start Eclipse and make sure to select C:\xampp\htdocs as
workspace, else your files won't be available to the apache webserver
and therefore you can't execute them. In the Eclipse menu choose Window
- Preferences, then PHP - Debug. Change the PHP Debugger from Zend
Debugger to XDebug and uncheck "Break at First Line". Click Apply and
then OK. The debugger is now set up. Time to use it! IMPORTANT: If you
already had any debug configuration for a PHP project, make sure to
delete it, so that a new configuration with the new settings is created
the next time you debug a php script! Debug configurations you've
created before changing the settings in this step won't be automatically
updated! This is a common source of errors!
5) (For this step I recommend you have a look at the video, it is easy
but complex to describe).
If you haven't already done it, choose the
most right symbol with the arrow (Workbench) in the Eclipse welcome
screen. In the Eclipse menu choose File - New - PHP Project. Enter a
name for your project e.g. WebDebugTest and click Finish. Now download
me, it is from [1]) called "webDebugExample". Select the three files
from this folder and add them to your Eclipse project by using e.g.
Drag&Drop (maybe have a look at the video if you don't know how to do
that). The file one should start from when using this sample is
project as PHP Web Page. After you have entered something in the form
and choosen submit, the debugger should start. The debugger is used like
the other typical debuggers you may know. If you want to see the output
of the script, you have to continue it using the arrow symbol in the
debugger. Note, that in some cases the displayed website won't change
from the input form to the output. This is why the debugging process is
run twice in the video. This seems to be a bug using Eclipse PDT and
XDebug.
Some notes:
- The basic passwords for the software delivered with XAMPP
- In the video I just start the apache webserver. You probably want to
run MySQL too.
- Other tutorials on Xdebug change / add several lines in / to the
[XDebug]
;; Only Zend OR (!) XDebug
default values, so actually you don't need to add them again. Also note
that you have to use zend_extension and not zend_extension_ts in our
case. You can find more on this in [1] on page 30 "Use the correct
zend_extension directive"
[1] Nathan A. Good, "Debugging PHP using Eclipse and PDT" ,
with XAMPP and how to use Eclipse PDT for debugging a sample php
project. The video is covered by the written instructions below, see
them as addition, the video should be enough. One note to the end of the
video: The debugging is started twice, in the first debug pass you will
see, that the website is not redirected to the php script receiving the
form data. That sometimes just happens, seems to be some kind of bug. On
the second attempt everything works.
The tutorial uses XAMPP 1.7.3, Xdebug 2.0.6-dev, Eclipse PDT 2.2.0 All
In Ones and Windows 7. It however should work the same on future
versions of the mentioned software. The written instructions assume that
you install XAMPP to C:\ (the default suggested by the installer). Note
that the installer then creates C:\xampp automatically.
1) Get XAMPP (the basic package, only this package includes Xdebug) from
the installer will then automatically create C:\xampp
2) After XAMPP has
replacements:
replace
with
replace
with
3) (Re)start the apache webserver using the XAMPP Control Panel.
4) Get Eclipse PDT All In Ones from
choice. Start Eclipse and make sure to select C:\xampp\htdocs as
workspace, else your files won't be available to the apache webserver
and therefore you can't execute them. In the Eclipse menu choose Window
- Preferences, then PHP - Debug. Change the PHP Debugger from Zend
Debugger to XDebug and uncheck "Break at First Line". Click Apply and
then OK. The debugger is now set up. Time to use it! IMPORTANT: If you
already had any debug configuration for a PHP project, make sure to
delete it, so that a new configuration with the new settings is created
the next time you debug a php script! Debug configurations you've
created before changing the settings in this step won't be automatically
updated! This is a common source of errors!
5) (For this step I recommend you have a look at the video, it is easy
but complex to describe).
If you haven't already done it, choose the
most right symbol with the arrow (Workbench) in the Eclipse welcome
screen. In the Eclipse menu choose File - New - PHP Project. Enter a
name for your project e.g. WebDebugTest and click Finish. Now download
me, it is from [1]) called "webDebugExample". Select the three files
from this folder and add them to your Eclipse project by using e.g.
Drag&Drop (maybe have a look at the video if you don't know how to do
that). The file one should start from when using this sample is
project as PHP Web Page. After you have entered something in the form
and choosen submit, the debugger should start. The debugger is used like
the other typical debuggers you may know. If you want to see the output
of the script, you have to continue it using the arrow symbol in the
debugger. Note, that in some cases the displayed website won't change
from the input form to the output. This is why the debugging process is
run twice in the video. This seems to be a bug using Eclipse PDT and
XDebug.
Some notes:
- The basic passwords for the software delivered with XAMPP
- In the video I just start the apache webserver. You probably want to
run MySQL too.
- Other tutorials on Xdebug change / add several lines in / to the
[XDebug]
;; Only Zend OR (!) XDebug
default values, so actually you don't need to add them again. Also note
that you have to use zend_extension and not zend_extension_ts in our
case. You can find more on this in [1] on page 30 "Use the correct
zend_extension directive"
[1] Nathan A. Good, "Debugging PHP using Eclipse and PDT" ,
Комментарии