Let's make comprehension easy ...
In this blog, I would like to share my experience of configuring and setting up PHP debug environment. It is handy when it comes to troubleshooting an issue or understanding an existing PHP based application. Also it is better to place breakpoints and step through the code rather than putting log statements in your development environment.
So below are the software(s) installed:
I will not get into describing how to install ubuntu 16.10 os, as I assume that reader has a basic knowledge of installing and using Ubuntu os.
Inorder to install the PHP debugger, using package manager:
Then execute the below commands:
Next up, download XAMPP server preferably with PHP 7.1.1 for Linux.
Ensure you give the download .run file user executable permission:
chmod u+x <xampp>.run
Then run the following command to start the installation:
Stop the instance of lamp if it is running:
Open the file /opt/lampp/etc/php.ini and add the following file:
Start the xampp server by running /opt/lampp/manager-linux-x64.run and visit localhost. Click on PhpInfo on top right. This should show you the PHP configuration. Observe the Zend extension states that xdebug is enabled or alternatively run /opt/lamp/bin/php -m and ensure Zend module has xdebug listed.
Configure your apache configuration to host multiple sites by editing the httpd.conf file as below:
Download Jet Brains PHP Storm IDE
In PHP storm configuration, create a server and add remotely debug PHP application, enter the KEY (PHPSTORM) and that is it :)