TagPHP

Use Xdebug profiler with PhpStorm

Today I played around a while trying to configure Xdebug profiler to work with PhpStorm.  The following config only apply to a local LAMP stack with Xdebug installed with homebrew.

Here is the xdebug.ini I used :

[xdebug]
zend_extension="PATH_TO_EXT"
xdebug.remote_enable=on
xdebug.remote_connect_back=1
xdebug.default_enable=1
xdebug.remote_autostart=1
xdebug.remote_host=localhost
xdebug.remote_handler=dbgp
xdebug.remote_port=9000
xdebug.cli_color=on
xdebug.profiler_output_dir=/PATH/TO/DIRECTORY
xdebug.profiler_enable_trigger = 1;

The folder you choose for the output must be writable by the server. You can also be lazy and do : chmod 777 /PATH/TO/DIRECTORY

Once this is set, you can use this nifty little chrome plugin to start profiling.

The output will be written to the folder you specified. You can use it and let PhpStorm interpret the result for you by choosing : Tools | Analyze XDebug Profiler Snapshot.

PhpStorm custom icons

I stumble upon an excellent icon alternative made by Bernard Kowalski to the boring standard PhpStorm icon. You can download it here 😉

Here are the steps to replace your PhpStorm icon so it shows within the application itself:

  1. Right-click on PhpStorm.app and Show Package Contents
  2. Navigate to Contents/Resources/
  3. Replace webide.icns with custom icon (making sure the name is exactly the same)

Enjoy!

 

© 2017 Jonathan Bardo