Remember me

Register now!
Site Info
Webmasters

Who's Online
3 user(s) are online (1 user(s) are browsing XOOPS Docman)

Members: 0
Guests: 3

more...

## 1.5. Installing Debugger

At the moment only DBG is supported by the standard PHPeclipse release. XDEBUG is only supported by loading the appropriate sources via CVS.

### 1.5.1. Installing DBG

DBG is a full-featured php debugger engine, an interactive tool that helps you debug PHP scripts. It works with a production and/or development web server and allows you to debug your scripts locally or remotely, from an IDE or the console. PHPeclipse has a built-in, pure Java debugging client that operates the DBG debugging engine.

To get the debugger to work you need to install the debugger engine to run in the PHP interpreter, and configure the debugger client to communicate with the engine.

Make sure you download the appropriate DBG binaries for your OS and your release of PHP (from 4.0.6 up to 4.3.10 and from 5.0.0 up to 5.0.3) (Note that the 5.0.3 debugger binary seems to work for the 5.0.4 and 5.05 interpreters.) If you are using Mac OS X you will have to build the debugger from source.

#### 1.5.1.1. Getting the right php_dbg.dll

DBG can be downloaded from DBG Downloads. You need to download the dbg modules packet for the appropriate operating system. Unpack the zipped packet and take the dll (or so) file which matches the PHP version you have currently running. E.g. for PHP 5.1.2 the correct file is php_dbg.dll-5.1.2. Rename the appropriate file to php_dbg.dll and read Section 1.5.1.2, “Find the extension directory” to find out the right destination location for the file.

#### 1.5.1.2. Find the extension directory

The best way to find out is via the “phpinfo()” command. Create a PHP-file called phpinfo.php with the following content:

<?php phpinfo(); ?>

and start it via your web browser. Then search for “extension_dir”. The right column shows the path to the directory where you have to place the php_dbg.dll (see Figure 1.9, “The information about the extension directory”).

#### 1.5.1.3. Setup php.ini

Where is the php.ini which needs to be set up?

The simplest way to find out the path of the php.ini is again with the help of the phpinfo function as described in Section 1.5.1.2, “Find the extension directory”

Tip Another possibility to find out where an application searches specific files is by using a tool called Filemon which you can get from Sysinternals.

The resulting output shows the path of the php.ini file within the topmost header. See Figure 1.10, “Get the php.ini path”

Now open php.ini and search for “implicit_flush”, and set it to “On”.

; this is to see output while debugging
implicit_flush = On 

copy the following lines into php.ini (they can go at the end of the file). For linux it is a php_dbg.so instead of php.dbg.dll.

[debugger]
extension=php_dbg.dll
debugger.enabled=on
debugger.profiler_enabled=on
debugger.hosts_allow=localhost
debugger.hosts_deny=ALL
debugger.ports=7869, 10000/16


Disable eAccelerator if it is installed and enabled:

eaccelerator.enable="0"

Disable the Xdebug extension if installed (usually via pear) by commenting out

;zend_extension=/usr/lib/php4/20020429/xdebug.so

Also if you have Zend Extension Manager installed (You should find a [Zend] section) make sure you add this line before any other zend_extension_ts (windows) or zend_extension (linux) lines: For Windows:

zend_extension_ts = "C:\path\to\php_dbg.dll"

For linux:

zend_extension=/var/lib/php4/dbg.so

Restart web server

#### 1.5.1.4. Test the DBG Installation

When you have done all steps, restart your web server and again submit the phpinfo function as described in Section 1.5.1.2, “Find the extension directory”. Search the browser output for “dbg” and you should find a section like you can see in Figure 1.11, “phpinfo showing the DBG section”

In addition you can submit the following URL within your browser: http://localhost/index.php?DBGSESSID=1@localhost:10001. Now, as there is no client running listening to dbg, you should see the following error message

Note For setting up a debug configuration and doing real debugging with PHPeclipse, see Section 4.1, “PHP Source Level Debugging”.

### 1.5.2. Installing XDEBUG

The XDebug support is only available through direct checkout of the PHPeclipse CVS repository.

More to come.

The comments are owned by the author. We aren't responsible for their content.

dalong
Published: 2006/11/16 8:00  Updated: 2006/11/16 8:00
Just popping in
Joined: 2006/11/16
From:
Re: xo-002 http://www.apachefriends.org/en/xampp.html
very good!
I like here!

dalong
Published: 2006/11/16 10:13  Updated: 2006/11/16 10:13
Just popping in
Joined: 2006/11/16
From:
Re: xo-002 http://www.apachefriends.org/en/xampp.html

huqilong
Published: 2006/11/20 2:50  Updated: 2006/11/20 2:50
Just popping in
Joined: 2006/11/16
From:
Re: xo-002 http://www.apachefriends.org/en/xampp.html
I hava a question ,when I have installed phpeclipse，I can't user the button for the apache in the Eclipse IDE,how shoud I do?

huqilong
Published: 2006/11/20 3:10  Updated: 2006/11/20 3:10
Just popping in
Joined: 2006/11/16
From:
Re: xo-002 http://www.apachefriends.org/en/xampp.html
dddd

Mark_1900
Published: 2006/11/18 11:05  Updated: 2006/11/18 11:09
Just popping in
Joined: 2006/11/18
From:
Alias Permission Problems
For an Alias I also had to add a Directory tag to the httpd.conf, otherwise I had permission problems accessing the files... <br /> [code] Alias /wiki "C:/Documents and Settings/Me/wiki"<br /> <Directory "C:/Documents and Settings/Me/wiki"><br /> Options Indexes MultiViews<br /> AllowOverride None<br /> Order allow,deny<br /> Allow from all<br /> </Directory><br /> [/code]<br /> Oh and all these editing tags seem broken!!

Mark_1900
Published: 2006/11/18 11:21  Updated: 2006/11/18 11:32
Just popping in
Joined: 2006/11/18
From:
Getting the correct php_dbg.dll
I want a debugger. I downloaded the latest XAMPP 1.5.4a and noticed that it comes with PHP 5.1.6 & PHP 4.4.4, and neither are supported. The debugger module only supports a subset of these major versions from 5.1.0 to 5.1.2 and 4.4.0 to 4.4.2 (http://dd.cron.ru/dbg/downloads.php). I think right at the beginning you should specify which versions to download to get a debugger Version "XAMPP 1.5.2" would be fine.

huqilong
Published: 2006/11/30 6:28  Updated: 2006/11/30 6:28
Just popping in
Joined: 2006/11/16
From:
Re: xo-002 http://www.apachefriends.org/en/xampp-windows....
I want to know how to use phpeclipse with eclipse detailly!

thierrybo
Published: 2007/2/3 16:19  Updated: 2007/2/3 16:21
Just popping in
Joined: 2007/2/3
From:
Re: xo-002 ch02s03.html Workspace Method 2
I do not agree with the suggested method 2: Quote:
For example you have set up XAMPP and your “document root” path is the XAMPP default:
 C:Program Filesapachefriendsxampphtdocs 
Quote:
,then your appropriate workspace path should be one level less:
 C:Program Filesapachefriendsxampp 
If htdocs is your document root, then each folder inside IS a new project and you should set workspace directory as Document Root directory. With suggested method, all your web projects are managed with ONE big PHPeclipse project.

dafydd
Published: 2007/4/3 6:01  Updated: 2007/4/3 6:01
Just popping in
Joined: 2007/4/3
From:
Re: xo-002 ch01.html
Trying this out on a Mac. J2SE 1.5.0_07-164 installed. 1.5.0_06 is what's available on the download site. However, it would almost certainly be updated with Software Update.

dafydd
Published: 2007/4/6 1:00  Updated: 2007/4/6 1:00
Just popping in
Joined: 2007/4/3
From:
Re: xo-002 ch01s04.html
Second question: How do we point the XAMPP start/stop buttons in the Eclipse toobar to where we put XAMPP?

dafydd

dysmas
Published: 2007/8/4 14:18  Updated: 2007/8/4 14:18
Just popping in
Joined: 2007/8/4
From:
Debugging standalone PHP applications
Thanks hundred times for all the detailed explanations here !!

And especially for the note which explains why debugging a CLI application does not work in 1.1.8 version and only in 1.1.9. (wrong port, as I guessed, but I have been looking for this information for some hours before coming here). Unfortunately this 1.1.9 CVS version does not work in the last 3.2.0 Eclipse version I just got. Let us hope the stable version is going quickly.

Mercyful
Published: 2007/9/10 14:46  Updated: 2007/9/10 14:46
Just popping in
Joined: 2007/9/10
From:
Re: dbg is not working
I want using eclipse3.2 with php-plugin and for debugging i want using dbg.
I'm using xampp 1.6.3a with php 4.4.7. and php_dbg.dll-4.4.x
After step by step installation
http://docs.schuetzengau-freising.de/ ... =xo-002&file=ch01s05.html
the debugger dbg will not work.
When i called phpinfo() there is no section dbg shown.
Who have any ideas?
Thanks a lot!
Regards Mercyful

keryx
Published: 2007/9/26 22:59  Updated: 2007/9/26 22:59
Just popping in
Joined: 2007/9/26
From:
Re: xo-002 ch04.html
A section about verrors should be nice. I get the following:

<terminated, exit value: 0>PHP C:\Program\PHP\php.exe : <path>/<fil>.php

I've googled like crazy but to no avail. And yes - it does not stop at breakpoints and "variables" are empty. DBG is working:

if (function_exists ("DebugBreak")) {
DebugBreak ();
echo "debugging started!<br />\n";
}

Outputs "debugging started!" And DBG is reported on phpinfo().

koski
Published: 2007/10/19 3:55  Updated: 2007/10/19 3:55
Just popping in
Joined: 2007/10/19
From:
Re: xo-002 ch01s03.html
Hi,

Seems that the mentioned link for cvs:

http://phpeclipse.sourceforge.net/update/cvs

is out of date or wrong.