- Install Xdebug
cd /var/www/
(where your web servers document root is set)git clone https://github.com/jokkedk/webgrind
More info at https://github.com/jokkedk/webgrind/wiki/Installation
cd /var/www/
(where your web servers document root is set)git clone https://github.com/jokkedk/webgrind
More info at https://github.com/jokkedk/webgrind/wiki/Installation
Xdebug with default_enable=1
makes PHP execution kinda slow. Fortunately it offers on demand profiling when XDEBUG_PROFILE
parameter is part of the request.
Make sure you have the following in your php.ini under [xdebug]
section:
[xdebug] xdebug.profiler_enable_trigger=1 xdebug.profiler_enable=0
Resources
https://stackoverflow.com/questions/8077993/can-i-manually-say-on-xdebug-profiler-to-start-profiling-in-specific-place
https://xdebug.org/docs/all_settings#profiler_enable_trigger
While I’m not sticking to Arch Linux’s PHP (it’s version 7 by default a long time) so I had to compile Xdebug for my PHP version. Great thing at xdebug’s site is that they provide a wizard which parses the pasted php.ini and outputs an install instruction list 🙂
For me the following worked like charm:
tar -xvzf xdebug-2.4.0.tgz
cd xdebug-2.4.0
phpize
(See the FAQ if you don’t have phpize
).As part of its output it should show:
Configuring for: PHP Api Version: 20131106 Zend Module Api No: 20131226 Zend Extension Api No: 220131226
If it does not, you are using the wrong phpize
. Please follow
this FAQ entry and skip the next step.
./configure
make
cp modules/xdebug.so /usr/lib/php/modules
/etc/php/php.ini
and add the linezend_extension = /usr/lib/php/modules/xdebug.so
sudo systemctl restart httpd.service
Oh yeah