Xdebug

Manual Install

The following Instructions based on http://xdebug.org/wizard.php help you to install it manually:

  1. Download the latest version (xdebug-x.x.x.tgz) fromĀ  http://xdebug.org/download.php
  2. Unpack the downloaded file with:
    $> tar -xvzf xdebug-x.x.x.tgz
  3. On shell run:
    $> cd xdebug-2.2.3
    $> phpize #(See the FAQ if you don't have phpize.
    
  4. Result should be:
    Configuring for:
    ...
    Zend Module Api No: 20090626
    Zend Extension Api No: 220090626

    Please consider the number! If you got different results, look at http://xdebug.org/docs/install for help.

  5. Next shell commands:
    $> ./configure
    $> make
    $> cp modules/xdebug.so /usr/lib/php5/20090626
    $> nano /etc/php5/apache2/php.ini
  6. Change or add the following line:
    zend_extension = /usr/lib/php5/20090626/xdebug.so

     

  7. Restart the webserver:
    $> sudo service apache2 restart
    $> # or
    $> sudo /etc/init.d/apache2 stop
    $> sudo /etc/init.d/apache2 start

Chrome extension

You can use the Xdebug helper extension for debugging with PHPStorm. Under chrome://extensions/ in the options of the extension you should select PhpStorm as IDE-Key. (@see https://confluence.jetbrains.com/display/PhpStorm/Browser+Debugging+Extensions)

Firefox extension

For Firefiox you can use the easiest XdebugĀ  or easy Xdebug extension. In Preferences PHPSTORM must be set as IDE-Key.Ā (@see https://confluence.jetbrains.com/display/PhpStorm/Browser+Debugging+Extensions)

Server settings

On server side there is the PHP-Modul php5-xdebug required. And under /etc/php5/apache2/conf.d/ there must exist a xdebug.ini-file (f.e.: 20-xdebug.ini) with the following information:

zend_extension=/usr/lib/php5/20121212/xdebug.so # Attention -> must be the actual number!!!!
[XDebug]
xdebug.remote_enable=1
xdebug.remote_port=9000
xdebug.profiler_enable=0
xdebug.profiler_output_dir="/tmp"
xdebug.remote_host=$CLIENTIP # in virtual environment it is the Host-IP!

PHP-Storm settings

General settings:

phpstorm-xdebug-1 Then you have to configure a remote server and debug settings:

selection_002

On bash

$> export XDEBUG_CONFIG="idekey=16231"
$> php -dxdebug.remote_enable=1 -dxdebug.remote_autostart=On -dxdebug.idekey=phpstorm -dxdebug.remote_host=10.0.2.2 product_import.php

More Information

Leave a Reply

Your email address will not be published. Required fields are marked *

 

This site uses Akismet to reduce spam. Learn how your comment data is processed.