Select Page

Eclipse PDT 2.0 is available

Eclipse PDT 2.0 is available

The PDT project is working towards providing a PHP Development Environment framework. This project was formerly known as PHP IDE.

Make #Eclipse PDT work for #Joomla development

Install a PHP debugger

In order to be able to perform debugging using eclipse PDT, you must download one of the following extra packages:  XDEBUG or ZEND debugger. I was not able to get the debugger running with XDEBUG even after reading many tutorials and trial error approach. Both packages are free, and it has work nicely for me with ZEND debugger after 5 minutes…

Unfortunately, XDEBUG/ZEND can not be packaged with PDT due to license restrictions, so both tools are not just running out of the box without few efforts.

PDT and Zend Debugger

Download

PDT + Zend in one package thanks to Zend.com (118MB), highly recommended

OR PDT (105MB) and add Zend debugger through software update later

  • Open #Eclipse and go to Help-> Software Updates-> Find and Install
  • Select “Search for new features to install” and click “Next”
  • Create a New Remote Site with the following details:
  • Name: PDT
  • URL: http://downloads.zend.com/pdt
  • Check the PDT box and click “Next” to start the installation

XAMPP, Zend debugger working together

open the php.ini located at \xampp\apache\bin\php.ini

and add the following

[DEBUGGER]
zend_extension_ts=
E:\php\bin\eclipse\plugins\org.zend.php.debug.debugger.win32.x86_5.2.15.v20081217\resources\php5\ZendDebugger.dll
zend_debugger.allow_hosts=127.0.0.1/192.168.1.100
zend_debugger.expose_remotely=always

Notes:

  • Only one key zend_extension_ts is allowed per php.ini file, un-comment all other or it wont work,
  • Attention: I did not move ZendDebugger.dll but use the one coming with eclipse Zend plugin, this may cause issues, if you update this plugin and the path change…

Restart XAMPP apache

By going to http://localhost/xampp/phpinfo.php check that you have a section Zend Debugger

zend.debugger.active.in.xampp

Put now a breakpoint in index.php of any Joomla! installation or deeper in any component you want to debug

And right click on index.php, debug as PHP Web Page (Alt-Shift-D, W)

Attention

While the first page get properly rendered in the internal browser of eclipse PDT, I was getting some strange rendering issues (html code produced look fine), by using an external browser like Chrome, Firefox, the problem has disappear.

PDT and XDebug

Installing with PEAR/PECL is as easy as opening a command prompt and typing

# \xampp\php\pecl install xdebug

open the php.ini located at \xampp\apache\bin\php.ini

and un-comment the following

extension=php_xdebug.dll

and

[XDebug]
;; Only Zend OR (!) XDebug
zend_extension_ts=”e:\xampp\php\ext\php_xdebug.dll”
xdebug.remote_enable=1
xdebug.remote_host=localhost
xdebug.remote_port=9001
xdebug.remote_handler=dbgp
xdebug.profiler_enable=0
xdebug.profiler_output_dir=”\xampp\tmp”

Caveats:

  1. Modify the correct php.ini file, check the page phpinfo, normally the right php.ini is located at \xampp\apache\bin\php.ini
  2. You need to comment out any other references to “zend_extension_ts” in the php.ini file (the zend optimizer use it already as default)
  3. Restart apache, and check the page http://localhost/xampp/phpinfo.php to make sure XDebug has been successfully installed

debugging AkoBookPlus:

debugging.joomla.components

 

Add subversion plugin

Install subversive by pointing the update manager to subversive update site

svn.subversive.install

You need also to install SVN connectors by adding a new update site:

http://www.polarion.org/projects/subversive/download/eclipse/2.0/update-site/ – [required] Subversive SVN Connectors

svn.subversive.install.connector 

Eclipse will restart, you should be able to browse www.joomlaCode.org repositories.

Happy Joomla! development and PHP debugging!

About The Author

I worked with various Insurances companies across Switzerland on online applications handling billion premium volumes. I love to continuously spark my creativity in many different and challenging open-source projects fueled by my great passion for innovation and blockchain technology.In my technical role as a senior software engineer and Blockchain consultant, I help to define and implement innovative solutions in the scope of both blockchain and traditional products, solutions, and services. I can support the full spectrum of software development activities, starting from analyzing ideas and business cases and up to the production deployment of the solutions.I'm the Founder and CEO of Disruptr GmbH.

Categories