Phpstorm Xampp Xdebug



  • Xdebug is a PHP extension which provides debugging, profiling, code coverage, stack traces and many other capabilities. In this succinct tutorial, I will show us how to set up Xdebug that ships with XAMPP in PhpStorm. See the steps below. Open up php.ini (located at C: path-to-xampp php) for editing.
  • Nice and easy, this. Set the url with?XDEBUGSESSIONSTART=PHPSTORM and set a header Cookie: XDEBUGSESSION=PHPSTORM.

Requirements

  • XAMPP for Windows: https://www.apachefriends.org/download.html
  • The VC14 build requires the Microsoft Visual C++ Redistributable for Visual Studio 2014
  • The VC15 build requires the Microsoft Visual C++ Redistributable for Visual Studio 2015, 2017 and 2019

Open up the test.php file in PhpStorm and click on the little green bug icon on the top right to run the file in debug mode. The console window pops up again and yields something like this. Setting up Xdebug and PhpStorm with XAMPP for nicer debugging With xdebug you can set breakpoints in your code, see all defined variable and even change them while running the code. To start we need to download the latest Xdebug version from You have to choose the right version for your installed php version.

Setup

  • Download Xdebug for the specific PHP version:

    • PHP 7.0: https://xdebug.org/files/php_xdebug-2.6.1-7.0-vc14.dll
    • PHP 7.1: https://xdebug.org/files/php_xdebug-2.7.2-7.1-vc14.dll
    • PHP 7.2: https://xdebug.org/files/php_xdebug-2.7.2-7.2-vc15.dll
    • PHP 7.3: http://xdebug.org/files/php_xdebug-2.7.2-7.3-vc15-x86_64.dll

Notice: You can also use the built-in Xdebug by using zend_extension = 'C:xamppphpextphp_xdebug.dll'.

  • Move the downloaded dll file to: C:xamppphpext

  • Open the file C:xamppphpphp.ini with Notepad++

  • Disable output buffering: output_buffering = Off

  • Scroll down to the [XDebug] section (or create it) and copy/paste these lines:

  • Restart Apache

  • Click the Github ★ Star button :-)

PhpStorm

  • Use the PhpStorm bookmarklets generator to activate Xdebug from the browser side.

Netbeans

  • Change the Netbeans debugging options: https://user-images.githubusercontent.com/781074/39868196-c98f15a0-5458-11e8-8143-d8c44079e099.jpg

Eclipse

  • No comment

Visual Studio Code

  • Install the PHP Debug Adapter for Visual Studio Code.

Adobe Brackets

  • Install the PHP Debugger for Brackets.

Sublime Text 2 and 3

  • Install the Xdebug Client Package

Lab Exercise: Installing XAMPP and Configuring it with PhpStorm


This document is a walkthrough through the process of installing and configuring XAMPP. After following all steps you will have fully configured XAMPP with PhpStorm integration.

This lab is part of the “Software Technologies” course @ SoftUni.


XAMPP is a software package that bundles in a single package PHP + Apache + MySQL + phpMyAdmin + some other tools for PHP Web development in Windows environment.Phpstorm

Part I: Installing XAMPP and Configuring the Apache Server and MySQL Database


This first part will show you how to install XAMPP, start the Apache server, and create your first MySQL DB.

1.Downloading XAMPP


Download XAMPP version 7.0.6 from https://www.apachefriends.org/download.html.

2.Installing XAMPP


The pictures below will show you the steps that you need to go through, in order to successfully install XAMPP.

Install XAMPP in thedefault directory (“C:xampp”), or you might encounter permission troubles later on.


3.XAMPP First Start


The first time you start XAMPP you will get language selection screen like this one:

After you choose the language you prefer, you will see the main screen of XAMPP:


4.Start Apache Server


Now we need to start Apache server:

If everything is correct, the Apache label will become green, and you will see the default ports80. If you have Skype or a torrent client running, the Apache server will not start. You need to exit the program that holds port 80, and the Apache server will start.


Part II: Connect the Debugger, Apache Server and MySQL DB to PhpStorm


This part will show you how to configure XAMPP with PhpStorm.

5.Go to the PhpStorm Home Page


If it’s the first time you start PhpStorm, it will be quite easy. You will start there. If you have started PhpStorm before, you need to either close your current project using File ->Close Project option or simply skip this step and go to File ->DefaultSettings. You should see this screen:

As you can see in the picture, you need to go to the settings menu.


6.Install the PHP Debugger


Once you are in the setting menu you need to go to Languages & Frameworkstab and select PHP

Phpstorm Xdebug Xampp Mac

. We need to change the PHPversion to PHP7.

After that we need to change the PHP Interpreter:


On the default interpreters page, we need to click the green plus.


After we do that, we will see this window:


We need to choose the PHP Executable now. In order to do that, we need to find our XAMPP folder and choose the ‘php’ directory.


If everything is alright, you should see this:


Let’s give PhpStorm a break. We need to download a debugger. We will download Xdebug from here: http://xdebug.org/files/php_xdebug-2.4.0-7.0-vc14.dll. Place the downloaded file to “C:xamppphpext”.

Now we need to edit the php configuration. Open the php.ini file located in “C:xamppphpphp.ini”.

Once you open the file add the following lines:


Xdebug Phpstorm Xampp Windows

zend_extension = C:xamppphpextphp_xdebug-2.4.0-7.0-vc14.dll

Configure Xdebug Phpstorm


xdebug.remote_enable = 1
Restart XAMPP and run the Apache and MySQL modules again.

If you’ve done everything correctly, you should see the following screen:


7.Create PHP Debugger Configuration


Now we need to create a configuration for our debugger. We need to do that for everyproject/php filePhpstorm. IMPORTANT: The project must be createdin the htdocs folder (located in the main XAMPP folder).

Choose a PHP Web Application on the drop down after you click the green plus.


Edit the Configuration Name and add new server.


Add new server with Host = localhost, on port 80 with Xdebug debugger.


At last we need to select the newly created server, and edit the URL. In the URL part you need to locate the file that you want to debug starting from localhost. In the example below my file is in project DebuggerConfig with file name homeController.php.


The result should be the following:


Now you are readytostartusing PHP!





Page of

Follow us:

© Software University Foundation (softuni.org). This work is licensed under the CC-BY-NC-SA license.


Katalog:downloads ->svn ->soft-tech
downloads -> Internet Explorer Users
downloads -> Internet Explorer Recommended Settings for. Net passport Sites
downloads -> Using local security policy to lock down Internet Explorer on Windows xp machines Click Start
downloads -> Tadbirkorlik faoliyatining jadal rivojlanishini ta`minlashga, xususiy mulkni har tomonlama himoya qilishga va ishbilarmonlik muhitini sifat jihatidan yaxshilashga doir qo`shimcha chora-tadbirlar to`g`risida
soft-tech -> Imdb – Exam Preparation