Current Location: Home> Latest Articles> Complete Guide to Setting Up Xdebug and API Testing with Postman in PhpStorm 2020.1

Complete Guide to Setting Up Xdebug and API Testing with Postman in PhpStorm 2020.1

gitbox 2025-06-27

Introduction

PhpStorm 2020.1 is a powerful integrated development environment for PHP that greatly improves development efficiency. Postman is a widely used API testing tool that enables quick and convenient API debugging and testing. This article will guide you through installing and configuring the Xdebug debugging environment in PhpStorm 2020.1, and using Postman for API calls and testing.

Installing and Configuring the Xdebug Debugging Environment

Installing the Xdebug Extension

First, open your php.ini configuration file and add the following lines:

zend_extension="D:\php\ext\php_xdebug-2.4.0-5.6-vc11.dll"
xdebug.remote_enable=1
xdebug.remote_handler="dbgp"
xdebug.remote_host="127.0.0.1"
xdebug.remote_port=9000
xdebug.remote_autostart=1

Note: Adjust the path to the Xdebug extension according to your local environment.

After editing, restart your PHP service to apply the changes.

Configuring Debug Settings in PhpStorm

In PhpStorm, go to the Run menu and select Edit Configurations. Click the plus + icon and choose PHP Remote Debug.

Fill in the configuration window with the following details:

  • Name: Any name to identify the debug configuration.
  • IDE Key: The debug key to use.
  • Server Port: The port your application uses.
  • Debugger Port: Usually the Xdebug default port, 9000.
  • Check the option to “Force break at the first line.”

Save the configuration after completion.

Using Postman to Call and Debug APIs

Installing the Postman Plugin

Within PhpStorm, open Plugins, search for the Postman plugin, install it, and then restart PhpStorm.

Configuring the Postman Plugin

Launch the Postman plugin and open the settings. Fill in the following:

  • PHP Interpreter: Select your system’s PHP interpreter.
  • Server URL: Enter the API endpoint URL to test.
  • Cookie: Enter relevant cookies if your API requires authentication.
  • Request Method: Choose the HTTP method for your API call.

Save the settings once done.

Starting Debug and Sending Requests

In PhpStorm, select “Start Listening for PHP Debug Connections” from the Run menu. Then, use the Postman plugin to send your API request and debug in real time.

Conclusion

This tutorial explained how to install and configure the Xdebug environment in PhpStorm 2020.1 and use the Postman plugin for API debugging. Mastering these steps will significantly improve your PHP development and debugging workflow, helping you quickly identify issues and optimize your code.