Quick settings to run xdebug

Follow steps to run xdebug

1)    Install xdebug if not already installed. after installation check whether it’s installed correctly or not (using phpinfo();)

2)    Edit php.ini and paste the sample of code:

if you are using Ubuntu, your php.ini path should be something like /etc/php/7.1/apache2/php.ini if you are using console application of PHP, the path will differ: /etc/php/7.1/cli/php.ini

  1. ; Added for xdebug
  2. zend_extension="/usr/lib/php/20160303/xdebug.so"
  3. xdebug.remote_enable=1
  4. xdebug.remote_autostart = 1
  5. xdebug.remote_handler=dbgp
  6. xdebug.remote_mode=req
  7. xdebug.remote_host=localhost
  8. xdebug.remote_port=9000
  9. xdebug.profile_enable=1

change the above code according to your requirement

3)    Restart apache, if you want to use it instantly.

Now tell your editor to listen for xdebug. You are done.

Leave a Reply