Howto setup a MacBook for PHP development (part 2)
This article is a follow up on the first part of the 'How to setup an Apache websewrver on a MacBook for PHP development` series.
Integrating xDebug - easy peasy
Once the Apache was convinced to execute PHP files I wanted enable xDebug. This beautiful piece of software save me hours of time last year and I don't want to miss it anymore. I found a xDebug binary for PHP 5.2 at the Komodo website, which turnes out to be a reliable source of xDebug binaries for every estabished operation system. Just download the needed archive, extract it, and copy the xdebug.so file matching your PHP version to a favorized location in your hard disk. As the standard directory for PHP extensions on Mac Os X is the
/usr/local/php5/lib/php/extensions/no-debug-non-zts-20060613directory. I extracted the archive to my 'tmp' directory and copied the extracted xdebug.so to this directory.
$> sudo cp /tmp/xdebug.so [PHP_EXT_DIR]
To configure PHP to use xDebug open the php.ini file and append the following lines:
[XDebug]
;; Only Zend OR (!) XDebug
zend_extension="[PHP_EXT_DIR]/xdebug.so"
xdebug.remote_enable=true
;if debugging on remote server, put client IP here
xdebug.remote_host=127.0.0.1
xdebug.remote_port=9000
xdebug.remote_handler=dbgp
;; profiler
xdebug.profiler_enable=Off
xdebug.profiler_enable_trigger=On
xdebug.profiler_output_dir=/tmp
I configured the output file for profiling the '/tmp' dir. If you stick to that be aware that this directory will be cleaned after a restart. You probably want to use another location. This for sure is just a basic setup of xDebug for more information and configuration options see the xDebug documentation. Restarting the Apache will show the xDebug recognition in the phpinfo.php.
Next Episode
Next thing is to install the PHP Extension Archive Repository.
Trackbacks
Comments
Fields with bold names are mandatory.