Ubuntu & apache & php & xdebug: install php xdebug

Trabla: Ubuntu & apache & php & xdebug: install php xdebug


php zend engine 2




Environment:
Linux: Ubuntu 12.10
Apache:  2.0
PHP: 5.4.6-1ubuntu1.8


Solving: 

1. Create folder for Xdebug output files  ( e.g. /home/xdebug/grind-out  ),
will be used in xdebug.ini later.

Example:

cd /home
sudo mkdir xdebug
cd /xdebug
sudo mkdir grind-out

Change owner to www folder user

sudo chown -R www-data:www-data /home/xdebug



2.  Install Xdebug:

sudo apt-get install php5-xdebug


3. Edit xdebug.ini file :

sudo pico /etc/php5/mods-available/xdebug.ini

Add following lines:


zend_extension=/usr/lib/php5/20100525/xdebug.so 

xdebug.remote_enable=on
xdebug.remote_handle=dbgp
xdebug.remote_host=localhost
xdebug.repote_port=9000

xdebug.profiler_enable = 1
xdebug.profiler_output_name = cachedrind.out.%t-%s
xdebug.profiler_output_dir="
/home/xdebug/grind-out"

Where zend_extension=/usr/lib/php5/20100525/xdebug.so is auto generated  



4.  Enable xdebug module - run following command:

sudo  php5enmod xdebug



5.  Restart apache:

sudo service apache2 restart



6. Final check, run command:

 php -v
 

PHP 5.4.6-1ubuntu1.8 (cli) (built: Apr  4 2014 01:28:36)
Copyright (c) 1997-2012 The PHP Group
Zend Engine v2.4.0, Copyright (c) 1998-2012 Zend Technologies
    with Xdebug v2.2.1, Copyright (c) 2002-2012, by Derick Rethans

 


 

No comments:

Post a Comment