Run xdebug with quick setting

Many people have problems in enabling the xdebug module to debug their code. Let’s see how easy it’s to run xdebug with quick setting.

Steps to run xdebug

Step 1

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

Step 2

Edit php.ini and paste the sample of code:

If you are using Ubuntu, your php.ini path is something like /etc/php/7.1/apache2/php.ini

If you are using the 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

Step 3

Restart apache, if you want to use it instantly.

Now tell your editor to listen for xdebug.

How to enable PHP mail function on Ubuntu

Here are steps to follow:

First of all install packagephp-pear if it’s already not installed. apt-get install php-pear
Then install following PEAR packages

  • pear install mail
  • pear install Net_SMTP
  • pear install Auth_SASL
  • pear install mail_mime

Then install POSTFIX

apt-get install postfix

This command will bring dialogue step by step to setup mail server.

Select Internet Site

and choose domain mail to be sent from

Try to send mail using mail() function, and you’ll receive the one you sent.