Asked  6 Months ago    Answers:  5   Viewed   35 times

How do you debug PHP scripts?

I am aware of basic debugging such as using the Error Reporting. The breakpoint debugging in PHPEclipse is also quite useful.

What is the best (in terms of fast and easy) way to debug in phpStorm or any other IDE?



Try Eclipse PDT to setup an Eclipse environment that has debugging features like you mentioned. The ability to step into the code is a much better way to debug then the old method of var_dump and print at various points to see where your flow goes wrong. When all else fails though and all I have is SSH and vim I still var_dump()/die() to find where the code goes south.

Tuesday, June 1, 2021
answered 6 Months ago

I show you Remote server on a windows machine used there filezilla. My Ubuntu 12.04 is at the moment not on.

Try to make a connection to your FTP-server.

Be shure ftp is up and running. Set your ftp server that you can connect from your local machine.

Change your perspective to Remote System explorer.
Remote System explorer view
Create a new connection

enter image description here

enter image description here

Test your ftp connection

enter image description here

Ftp Server settings.

  • 1 For each user to have ftp access, to create a system user.

  • 2 If not present the line


Add to /etc/shells.

  • 3 In/etc/passwd file for each FTP user as a login shell /bin/false rejected.

    for example:

userxy: x: 1003:1002:/home/userxy:/bin/false

Eclipse Ftp setting

enter image description here

Final steps.

only when a connection to ftp server is established.

  • On your server create a folder in /var/www/html call the folder switch-r .

  • Create a new PHP Project call it Switch-Remote .

enter image description here

right click at Switch-Remote select new folder.

enter image description here

after OK your project looks

enter image description here

right click on the new folder switch select new PHPFile .

enter image description here

after OK you can see following in eclipse ftp log .

enter image description here

and your project ..

enter image description here

open switch.php and replace with new code.

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN">
<meta http-equiv="Content-Type" content="text/html; charset=Cp1252">
<title>Remote Debug</title>
    echo "Hello<br>";
    echo "from DTX-AGIL-3";

put a breakpoint at line 8 .

enter image description here

Create a new Debug Configuration

enter image description here

Change the settings as seen in the next image .

enter image description here

Debug with the just created config .
Debug stops at line 8.

enter image description here

and finish.

enter image description here

Everything you change or you rename files,
everything is automatically transferred via FTP to the server.

Saturday, May 29, 2021
answered 7 Months ago

You should be able to debug the *Test.php files individually as you would the normal project. There's also a setting (at least in NetBeans 7.0) on the project's PHPUnit properties page that tells NB to run all files ending in Test.php as PHPUnit tests.

Saturday, May 29, 2021
answered 7 Months ago

You buy RegexBuddy and use its built in debug feature. If you work with regexes more than twice a year, you will make this money back in time saved in no time. RegexBuddy will also help you to create simple and complex regular expressions, and even generate the code for you in a variety of languages.

alt text

Also, according to the developer, this tool runs nearly flawlessly on Linux when used with WINE.

Sunday, June 6, 2021
answered 6 Months ago
  • PhpStorm 2020.3
  • PHP 7.2.20
  • Xdebug v2.7.2

This is a result of fixing WI-51991 in PhpStorm 2020.3 -- done on request from Xdebug author (Xdebug ticket #1756).

Sadly Xdebug 2.9.3 and older has a bug (ticket #1766) that turns off remote debugging for the remainder of the duration of this specific PHP process (that's why only first request works) -- fixed in Xdebug 2.9.4.


Upgrade Xdebug to 2.9.6 or newer (latest versions are Xdebug 2.9.8 for 2.x branch and 3.0.1 for v3) -- it's confirmed working there by multiple people.

Looks like you are on Windows. In such case get the latest version here: (just get the right build, I believe you need "PHP 7.2 VC15 TS (64 bit)": v3.0.1 or 2.9.8)

Alt approach: keep using previous 2020.2.4 or wait for 2020.3.1 where some workaround will be implemented for Xdebug v2.x (WI-57577) -- 2020.3.1 Preview build is already available; final version should be released at some point later this month.


  • Comment by Derick Rethans (Xdebug author)
  • Xdebug 2.9 is no longer supported
  • If you decide to use Xdebug v3 (which you should; it's available for your PHP 7.2) -- it uses DIFFERENT config parameters, so please go through Upgrading from Xdebug 2 to 3 Guide and update (mostly rename) your Xdebug config.
Sunday, August 22, 2021
answered 4 Months ago
Only authorized users can answer the question. Please sign in first, or register a free account.
Not the answer you're looking for? Browse other questions tagged :