Xdebug Phpstorm Ubuntu



  1. Install Xdebug Phpstorm Ubuntu 18.04
  2. Xdebug Phpstorm Docker Ubuntu
  3. Phpstorm Xdebug Docker
Xdebug Phpstorm Ubuntu

Table of Contents

Debug Magento 2: Introduction

Debugging is critical in the development process of any system. Some developers like to log things out, some like to print it right on the screen, but most prefer run-time debugging. Predictably, correctly debug your application will save you tons of time and effort. To debug Magento 2 code, you can use either XDebug or Zend Debug. In this article together we will try to install and config Xdebug, since it is more popular and easier to use. Also note that the IDE we use in this article is PhpStorm.

Install Xdebug Phpstorm Ubuntu 18.04

Ready? Let’s start with the most important thing: Install XDebug.

Ubuntu Make is available in the official package repository of Ubuntu 20.04 LTS. First, update the APT package repository cache as follows: $ sudo apt update. Now, install Ubuntu Make with the following command: $ sudo apt install ubuntu-make. To confirm the installation, press Y and then press. Ubuntu Make should be installed. Debug PHP in Docker with PHPStorm and Xdebug. GitHub Gist: instantly share code, notes, and snippets. PHPIDECONFIG='serverName=jo' user: ubuntu In the PHPStorm small changes were required the server needed to be renamed to jo and the mappings to /var/www/ since we are in the container not on my local machine anymore.

Install XDebug

Xdebug Phpstorm Ubuntu

From now on we assume you have your web server running Ubuntu locally on /var/www/html/. First you have to put a file named info.php there, with the content:

<?php

phpinfo();

?>

Train your brain with dr. kawashima 2.0.3.7 for mac. Then go to 127.0.0.1/info.php, the following screen should display:

Now to install xdebug, open terminal and type in the following command:

sudo apt-get install php5-xdebug

Phpstorm

Here you have your Xdebug installed. However we need to add some config script to setup Xdebug locally. Go check your info.php again, look for this line where you can get the php.ini file location

Go there and paste the following code into the end of the file

zend_extension=”/usr/lib/php5/20131226/xdebug.so”

xdebug.remote_enable=1

Xdebug Phpstorm Ubuntu

xdebug.remote_handler=dbgp

xdebug.remote_mode=req

xdebug.remote_host=localhost

xdebug.remote_port=9000

xdebug.max_nesting_level=300

xdebug.ide_key=’PHPSTORM’

xdebug.remote_connect_back=1

One thing worth mentioning is the zend_extension variable. The number might change depending on your machine. If you are running on php 7 then it would be /usr/lib/php7/20131226/xdebug.so

You will need to restart apache to apply the changes:

Sudo service apache2 restart

Now take a look again at phpinfo, if you can see this part then it is configured correctly

Setup XDebug with PhpStorm

In order to use Xdebug to debug Magento 2, you have to setup it with your IDE (in our case it is PhpStorm). In PhpStorm windows, you need to go to File -> Settings -> Languages & Frameworks -> PHP and set the CLI interpreter

Then go to Servers and set up a debug server. Additionally, you can set up several ones if you want.

Save the config, then go to Run -> Debug Configuration and add a PHP Web Application debug config.

Then look at the upper right corner, you will see the debug listener is now clickable. It means your PhpStorm is ready to listen to debug signals

Now there are two ways that you can get started with debugging, first way is clicking on the green bug, then a new browser page will load up and you can start your debugging from that point

Alternatively, you can install xdebug helper extensions for browsers, Chrome and Firefox, so that it can send debugging signal out to PhpStorm to catch it.

With Chrome: Xdebug helper

With Firefox: The easiest Xdebug

Xdebug Phpstorm Docker Ubuntu

Have you finished all these setup with ease? Great job! In the second part we will discuss more about how to debug Magento 2 code effectively with Xdebug and PhpStorm. See you soon! Acer aspire one zg5 lan driver free downloadfreephotography.

Setting up xdebug (ubuntu) and Phpstorm

sudo pecl install xdebug
sudo touch /etc/php5/mods-available/xdebug.ini
edit /etc/php5/mods-available/xdebug.ini and paste this content in to the file: Monsters den: book of dread.

cd /etc/php5/conf.d/
ln -s ./mods-available/xdebug.ini 10-xdebug.ini

From PhpStomr you need to set up folder mapping
Run -> Edit configurations -> Default -> Php remote Debug ->Servers (select your app domain name) click in the [..] button and on the main folder edit to add the remote url /home/vagrant/code or whatever

Phpstorm Xdebug Docker

Then drag bookmarks from this page to start debuger from browserhttps://www.jetbrains.com/phpstorm/marklets/
Then you can click start debug bookmark on your browser, start listening in Phpstorm (Run -> Start listening for php connecions)