FeaturesWP CloudPricingEE CLIContactMy Account
Features
Team Access & User Permissions
Install
Resources
Community
CLEAR
Tutorials
PHP
Install Xdebug and configure it with webgrind
Topics
On this page
-
- Getting Started
- Git and File-System Layout (non-default setup)
- Version Constraints
- Managing Themes and Plugins (for entire WordPress site)
- Updating Themes and Plugins (for entire WordPress site)
- Adding Composer Support to Your Own Themes and Plugins (for developers)
- Using Composer to Manage Own Theme/Plugin Dependencies (for developers)
-
- Assigning Multiple IP Addresses to Single LAN Card
- Disable IPv6 on Ubuntu 12.04
- dsh – distributed shell
- fdupes – find & replace duplicate files with hardlinks
- GPG Keys Cheatsheet
- Increase "Open Files Limit"
- kill all php, nginx, mysql or any kind of processes
- Passwordless Authentication for SSH
- Screen
- search replace in multiple files useing grep xargs sed
- Setup sftp
- sysctl.conf
- Timezone Sync
- Using Google Public DNS on Ubuntu Server
- Using openssl to match private key, cerificate and CSR
- Configure Postfix to Use Gmail SMTP on Ubuntu
- Logrotate Example for Custom Logs
- PHP 5.5, MySQL, Postfix, Nginx and WordPress on Ubuntu
- Serverdensity
- Upgrade Ubuntu 10.04 to 12.04
- Using find and sed to replace strings in multiple files
- Webmin
-
- .my.cnf – mysql user & password
- Analyse slow-query-log using Anemometer
- Improving MySQL Query Cache
- MySQL Query Profiling
- Reset MySQL root password
- tuning-primer.sh – an alternative for mysqltuner
- Using MariaDB 10
- Install/Upgrade to MySQL 5.6 on Ubuntu 12.04 LTS
- Change WordPress Domain Name
- Character Sets and Collations
- Enable innodb_file_per_table
- Enable Remote Access (Grant)
- Installing Percona Toolkit
- Using tmpfs for temporary folder creation
- YARPP and InnoDB
- Convert MyISAM to InnoDB
- Using tmpfs for mysqldump & mysqlimport
- Convert from INNODB to MYISAM
- Analyse slow-query-log using mysqldumpslow & pt-query-digest
- mysqlcheck with cron to optimize automatically
- Using MySQLTuner to Optimize MySQL configuration
-
-
- Directly connect to PHP-FPM
- Generating core-dump for php5-fpm
- GeoIP
- Having php5 and php7 on same system.
- Install Xdebug and configure it with webgrind
- Installation of PHP Code Review Tools
- memcache
- PHP's Zend Opcache Config & Web Viewer
- Setting Sqlite support with PHP
- Using HHVM with PHP-FPM Fallback
- Using Redis for PHP Sessions on Ubuntu Server
- Installing PhpMyAdmin Quickly
- Moving PHP's session storage to tmpfs
- Install Xdebug and configure it with Netbeans
- Nginx – Enable PHP-FPM Status Page
- PHP-FPM: Socket vs TCP/IP and sysctl tweaking
- APC Cache Optimization & Monitoring Using Web Interface
- Checking if PHP/WordPress can send mails
- Debugging PHP Scripts Using slow_log and more
- Increase file upload size limit in PHP-Nginx
- Increase PHP script execution time with Nginx
-
- Performance Optimization
- Remove Query string of css/js files
- Setup ElasticSearch with ElasticPress
- Using Redis for WordPress Object-Cache
- WooCommerce Window Shopping Caching Technique
- Moving WordPress To New Server (Faster)
- Better wp-cron using linux's crontab
- 404 error- Page not Found!!!
- Debugging WordPress with Nginx
For EasyEngine Users…
Installing Xdebug
Install Webgrind
Install graphviz and Gprof2Dot
Webgrind config
Using Webgrind
Trigger Profiling
Always Profile
Remote Profiling
Install Xdebug and configure it with webgrind
For EasyEngine Users…
You can use ee debug command which automates some part.
Installing Xdebug
- Install Xdebug for php
sudo apt-get install php5-xdebug
- Setup xdebug.ini for ubuntu
vim /etc/php5/fpm/conf.d/20-xdebug.ini
Add following lines:
xdebug.profiler_output_dir=/tmp
xdebug.profiler_output_name=cachegrind.out.%p-%H-%R
xdebug.profiler_enable_trigger=1
xdebug.profiler_enable=0
3. Restart php5-fpm
sudo service php5-fpm restart
Install Webgrind
Under webroot for example.com, run following commands:
wget https://github.com/jokkedk/webgrind/archive/master.zip
unzip master.zip
mv webgrind-master webgrind
Install graphviz and Gprof2Dot
This is needed for graphical presentation of calls.
apt-get install python graphviz
Webgrind config
Open config.php under webgrind folder. You may need to specify location of dot binary.
static $dotExecutable = '/usr/bin/dot';
Using Webgrind
Goto http://example.com/webgrind in your browser and you will see webgrind UI there.
But wait, you may not see any output there as cachegrind files may not have created yet.
Trigger Profiling
You may not see anything as we have set xdebug to profile only on trigger. This is good for profiling sites used in production environment as well as on server with multiple sites using same PHP pool.
You can use this browser extension to trigger profiling:
- For Firefox: https://addons.mozilla.org/en-US/firefox/addon/the-easiest-xdebug/
- For Chrome: https://chrome.google.com/extensions/detail/eadndfjplgieldjbigjakmdgkmoaaaoc
- For Safari: https://github.com/benmatselby/xdebug-toggler
- For Opera: http://addons.opera.com/extensions/details/xdebug-launcher/
Always Profile
Be warned, that this can eat up GB’s of space on a live server with decent traffic in an hour!
You can change a line like below and it will profile php code always.
xdebug.profiler_enable=1
Of course, you will need to reload PHP for change to take effect using service php5-fpm reload
Remote Profiling
We have covered remote debugging with Netbeans here: https://easyengine.io/tutorials/php/xdebug-netbeans/. Please note that changes to debug config in NetBeans article, if you decide to use it.
Xdebug site has more remote options.
For more details, check out the Xdebug Documentation.
Having php5 and php7 on same system.
PREVIOUS
Installation of PHP Code Review Tools
NEXT
Features
- Server Setup & Management
- Site Creation & Management
- Create WP Cloud Sites
- Speed & Caching
- Firewall Protection
- Backups & Recovery
- Logs & Monitoring
- Deployments & Developer Tools
- Team Access & User Permissions
Useful Links
Product
Other Products
Subscribe for curated product updates, tips, and announcements.
"*" indicates required fields
Phone
This field is for validation purposes and should be left unchanged.
Email*
SIGN ME UP
Δ
© rtCamp, since 2009. All rights reserved.