Category Archives: Software

PHP Profiling Time and Memory with OSX 10.10 and Xdebug

First you need to have installed Xdebug, to install Xdebug on Linux debian click here.

Configure XDEBUG for time specific profiling:

mkdir /var/log/xdebug-profiling-output/
chmod -R 777 /var/log/xdebug-profiling-output/
nano /etc/php5/apache2/conf.d/xdebug.ini


These settings mean that time profiling outputs will be stored in /var/log/xdebug-profiling-output/, profiling will be disabled by default and only activated using trigger. Having profiling on as default is not recommended because it drains the system resources.

Now reboot Apache2:

/etc/init.d/apache2 graceful

To generate a profiling log, append ?XDEBUG_PROFILE=1 to your site-url, like this:

To be able to parse the output in OSX 10.10 you need Graphviz installed, install it using Homebrew by running:

brew install qcachegrind

Generate a log on your website and then remember the filename path. Copy it over to your OSX machine using:

scp ~/Downloads/

Now open this file in the application qcachegrind to analyze the profiling. You can also analyze the Xdebug profiling output using Php Storms built-in Xdebug Profiler Snapshot analyzer if you have it.

Configure XDEBUG for memory specific profiling:

mkdir /var/log/xdebug-trace-output/
chmod -R 777 /var/log/xdebug-trace-output/
nano /etc/php5/apache2/conf.d/xdebug.ini


These settings means that memory profiling will be disabled by default to save resources, profiling logs will be generated in the folder /var/log/xdebug-trace-output/.

Now reboot Apache2

/etc/init.d/apache2 graceful

To generate a profiling log, append ?XDEBUG_TRACE=1 to your site-url, like this:

Check generate filename and copy trace log from remote host to OSX.

scp ~/Downloads/

Now you can open the log in text-editor.

Finally disabled that backspaces triggers Back-event in Firefox

I finally did the search for how to disable the behavior in Firefox where clicking on Backspaces triggers a ‘Back’-event in the browser.

According to

“You can set the Integer pref browser.backspace_action to 2 on the about:config page to disable the backspace action. BTW Shift + Backspace does the reverse: going Forward if possible, so that is taken as well. ”

It works great, I should have done this earlier to prevent all the frustration of breaking web forms.