Configuring Xdebug for PHP development/Windows

From Joomla! Documentation
< Configuring Xdebug for PHP development(Difference between revisions)
Jump to: navigation, search
(Serverside (extension in PHP))
 
(4 intermediate revisions by 3 users not shown)
Line 1: Line 1:
Configuring Xdebug is spitted into two parts:
+
{{incomplete}}
 +
{{underconstruction}}
 +
 
 +
Configuring Xdebug is split into two parts:
  
 
== Serverside (extension in PHP) ==
 
== Serverside (extension in PHP) ==
  
 
=== Installation ===
 
=== Installation ===
 +
 
First check if this extension is already installed. Create a new file with the content ''<?php phpinfo(); ?>'', save it in your webfolder (f.e. C:\xampp\htdocs\phpinfo.php) and call it using your browser (f.e. http://localhost/phpinfo.php). The command PHPINFO will show you all information about installed plugins, their configuration and so on. If you see a headline called Xdebug, it is already downloaded and enabled.
 
First check if this extension is already installed. Create a new file with the content ''<?php phpinfo(); ?>'', save it in your webfolder (f.e. C:\xampp\htdocs\phpinfo.php) and call it using your browser (f.e. http://localhost/phpinfo.php). The command PHPINFO will show you all information about installed plugins, their configuration and so on. If you see a headline called Xdebug, it is already downloaded and enabled.
 
On a linux-system it depends on your distribution. Most of the distribution have packages ready that you can just download and install right-away. An example is Debian (or Ubunut). The package there is called ''php5-xdebug''. This command will download and enable the plugin.
 
  
 
To get the extension for a Windows-System, you have to download the DLL-file from http://xdebug.org/download.php that fit's to your PHP version, move it into the ''ext'' folder of your PHP-installation. If the file php_xdebug.dll exists, leave it there. It's most likely the right version, just that it's not enabled. This was f.e. the case for the last XAMPP package I used.
 
To get the extension for a Windows-System, you have to download the DLL-file from http://xdebug.org/download.php that fit's to your PHP version, move it into the ''ext'' folder of your PHP-installation. If the file php_xdebug.dll exists, leave it there. It's most likely the right version, just that it's not enabled. This was f.e. the case for the last XAMPP package I used.
Line 16: Line 18:
 
You enable the plugin by adding (or uncommenting) the following line to your config-file:
 
You enable the plugin by adding (or uncommenting) the following line to your config-file:
 
<source lang="ini">
 
<source lang="ini">
 +
; Example for XAMPP
 
zend_extension = "\xampp\php\ext\php_xdebug.dll"
 
zend_extension = "\xampp\php\ext\php_xdebug.dll"
 +
 +
; Example on Mac OS X for XAMPP
 +
zend_extension="/Applications/XAMPP/xamppfiles/lib/php/php-5.3.1/extensions/no-debug-non-zts-20090626/xdebug.so"
 
</source>
 
</source>
  

Latest revision as of 12:28, 15 October 2012

Note

Please note that the content on this page is currently incomplete. Please treat it as a work in progress.

This article was last edited by Enav (talk| contribs) 7 months ago. (Purge)


Configuring Xdebug is split into two parts:

Contents

[edit] Serverside (extension in PHP)

[edit] Installation

First check if this extension is already installed. Create a new file with the content <?php phpinfo(); ?>, save it in your webfolder (f.e. C:\xampp\htdocs\phpinfo.php) and call it using your browser (f.e. http://localhost/phpinfo.php). The command PHPINFO will show you all information about installed plugins, their configuration and so on. If you see a headline called Xdebug, it is already downloaded and enabled.

To get the extension for a Windows-System, you have to download the DLL-file from http://xdebug.org/download.php that fit's to your PHP version, move it into the ext folder of your PHP-installation. If the file php_xdebug.dll exists, leave it there. It's most likely the right version, just that it's not enabled. This was f.e. the case for the last XAMPP package I used.

[edit] Enable Xdebug

On windows-systems you most likely just have one php.ini file for all configuration whereas on several Linux distributions you have a directory called conf.d in addition. If you have installed Xdebug on a Linux based system, you'll probably find a file xdebug.ini in there. Use this file instead if you have it (just not to mess-up the main config-file).

You enable the plugin by adding (or uncommenting) the following line to your config-file:

; Example for XAMPP
zend_extension = "\xampp\php\ext\php_xdebug.dll"
 
; Example on Mac OS X for XAMPP
zend_extension="/Applications/XAMPP/xamppfiles/lib/php/php-5.3.1/extensions/no-debug-non-zts-20090626/xdebug.so"

Please make sure you use zend_extension instead of extension which (not as extension) requires the full path to the extension-file.

[edit] Configuration

Please also read this introduction for configuration-details: http://xdebug.org/docs/remote

Here is an example of the configuration I use and some comments around that:

; location of my configuration-file
zend_extension=/usr/lib/php5/20090626/xdebug.so
 
; Enables colors if you use xdebug on the console
xdebug.cli_color=1
 
; Enable profiler by a trigger (f.e. cookie or GET-param)
xdebug.profiler_enable_trigger=1
xdebug.profiler_output_dir=/var/www/log/
 
; Debugger will try to connect back to the machine sending the HTTP-Request
xdebug.remote_connect_back=1
 
; Enables the debugger
xdebug.remote_enable=1

[edit] Clientside (configure your IDE)

If your IDE is not listed on http://xdebug.org/docs/remote#clients, you'll probably find a tutorial in the manual of your IDE. Feel free to add helpful tutorials here.

Personal tools
Namespaces

Variants
Actions
Navigation
Joomla! Sites
Toolbox