22 de noviembre de 2014

XAMPP + Xdebug + PhpStorm on Mac OS X

Here is how to setup XAMPP with Xdebug and PhpStorm on a Mac, working at least in Yosemite. Things you need to download and install prior following these steps:
First we need to install autoconf with homebrew:
brew install autoconf

Next we'll download Xdebug and compile it. With the terminal, go to a folder where you want to download the code (Desktop, Downloads...). There's no need to create a folder to put in the download.
git clone git://github.com/derickr/xdebug.git
cd xdebug

Now let's configure Xdebug before compiling. Recent XAMPP releases are 64 bits, so we do the following.
 ./configure --enable-xdebug \
 --with-php-config=/Applications/XAMPP/xamppfiles/bin/php-config
Now we compile it
make
And copy the required files from the compiled Xdebug to XAMPP
copy files sudo cp -R modules/ /Applications/XAMPP/xamppfiles/lib/php/extensions/no-debug-non-zts-20121212/
After that, we edit XAMPP's PHP to add Xdebug. For that, we edit the php's config located on this file: /Applications/XAMPP/etc/php.ini and add the following at the end of the file
 [xdebug]
 zend_extension=/Applications/XAMPP/xamppfiles/lib/php/extensions/no-debug-non-zts-20121212/xdebug.so
 xdebug.remote_enable=on
 xdebug.remote_handler=dbgp
 xdebug.remote_host=127.0.0.1
 xdebug.remote_port=9000
All thats left is to create a new configuration of type PHP Web Application and run it. When adding XAMPP as a server on PhpStorm, we can see that is detecting Xdebug:



Thanks to:
Jetbrains documentation
Laaz's blog post http://blog.laaz.org/tech/2010/08/27/xdebug-with-xampp-on-mac-os-x/

0 comentarios:

Publicar un comentario