apt get life

Life around technology

  • Technology
    • Guides
    • Linux
    • Development
      • Laravel
    • Misc
    • Raspberry Pi
  • Writing
  • Crafts
    • Crochet
    • Model Making
    • Painting
  • Privacy Policy
You are here: Home / Archives for xdebug

Setting up PHP XDebug in PHPStorm

2014/07/17 by sudo

Setting up XDebug in Apache

First off, ensure that the modules have been installed for php and xdebug:
sudo apt-get install php5-dev php5-cli php-pear
sudo pecl install xdebug

Now the packages should be installed, we need to find the default location for PHP and xdebug. Take note of both resulting directories:
which php5
sudo find / -name 'xdebug.so'

Horrah, we have our paths for the xdebug plugin so we can edit the approrpaite PHP files. There are two exciting options here:

Number 1 – you can edit PHP ini directly and add the code (later)

sudo nano /etc/php5/apache2/php.ini

Number 2 – you can edit the conf.d/20-xdebug.so file and edd the code (later)

nano /etc/php5/apache2/conf.d/20-xdebug.ini

Code for PHP.ini or 20-xdebug.so:

# This should be the directory you received from the find command you used earlier
zend_extension = /usr/lib/php5/20121212/xdebug.so
# These settings enable a connection to sublime text.
# If you're using PHP storm you can use the same settings,
# with other programs mileage may vary
zend_extension=xdebug.so
xdebug.remote_enable=On
xdebug.remote_host="localhost"
xdebug.remote_port=9000
xdebug.remote_handler="dbgp"
xdebug.remote_autostart=1

Now it’s a good idea to restart apache so xdebug is loaded:

sudo /etc/init.d/apache2 restart

 

Setting up XDebug in PHPStorm

At this point you will need to open PHP Storm to configure it with Xdebug. Once it’s open go to:

File -> Settings

Select PHP from the left hand menu

click … on interpreter

hit the “reload” button and xdebug should appear.

Click ok.

click debug on left hand column

make sure xdebug options are enabled.

Bookmarks

You need to create new book marks in your web browser. You can either follow the guide at it’s source, or keep following what’s in the article:
http://www.jetbrains.com/phpstorm/marklets/

Start xDebug


javascript:(/** @version 0.5.2 */function() {document.cookie='XDEBUG_SESSION='+'PHPSTORM'+';path=/;';})()

Stop xDebug


javascript:(/** @version 0.5.2 */function() {document.cookie='XDEBUG_SESSION='+''+';expires=Mon, 05 Jul 2000 00:00:00 GMT;path=/;';})()

Debug this page


javascript:(/** @version 0.5.2 */function() {document.cookie='XDEBUG_SESSION='+'PHPSTORM'+';path=/;';document.location.reload();document.cookie='XDEBUG_SESSION='+''+';expires=Mon, 05 Jul 2000 00:00:00 GMT;path=/;';})()

Filed Under: Development Tagged With: debudding, development, Linux, php, xdebug

Recent Posts

  • System Hang on Ubuntu 24.04 “e1000_print_hw_hang”
  • Disable iLO on HP Microserver Gen8
  • Ubuntu Desktop 24.04 Change Wallpaper Settings
  • Customising Ubuntu Desktop 24.04
  • Remove domains from Let’s Encrypt using Certbot

Tags

API auditing crochet data recovery debian debudding development Dingo API docker email Getting started with Laravel 5 & Dingo API hard drive health HP Microserver KVM Laravel larvel 5 lenovo Linux Minion mint netgear nas networking network shares php PHP development Postfix raspberry pi review samba security SMART smartctl smartmontools smb testing traefik ubuntu ubuntu 18.04 ubuntu 20.04 ubuntu 22.04 ubuntu server vagrant Virtual machines xdebug xubuntu

© Copyright 2015 apt get life