Beginner trying to set up debugging in PHPStorm

I am using Windows 10. I have downloaded PHP 8.1 from XAMPP, although I would have no objection to using a different source for PHP / Maria.

I have been trying to follow the instructions to set up a debugger, and ended up on 
https://xdebug.org/docs/install#windows
As XAMPP has no debugger installed, I followed the link to the wizard, where I pasted phpinfo, and was told that there was no debugger.

I see the feedback:

Summary

  • Xdebug installed: no
  • Server API: Apache 2.0 Handler
  • Windows: yes
  • Compiler: MS VS16
  • Architecture: x64
  • Zend Server: no
  • PHP Version: 8.1.0
  • Zend API nr: 420210902
  • PHP API nr: 20210902
  • Debug Build: no
  • Thread Safe Build: yes
  • OPcache Loaded: no
  • Configuration File Path: no value
  • Configuration File: D:\xampp7\php\php.ini
  • Extensions directory: D:\xampp7\php\ext

    As requested, I downloaded the file, php_xdebug-3.1.6-8.1-vs16-x86_64.dll, copied it to D:\xampp7\php\ext, and renames it to php_xdebug.dll
    Update the php.ini, and then try the phpinfo() paste again - but the result is the same.

    That's so simple, I can't imagine what I have done wrong!
    Any suggestions?





0
5 comments

I am a bit confused - in my last message in our private ticket, I described what is wrong exactly and how to fix that. Did you not get it?
Just in case, I am quoting my reply there:

Thank you! The issue is that you specify the Xdebug extension as zend_extension = xdebug; it won't work this way unless you're on Linux.
Please use the absolute file path like zend_extension = "C:\Program Files\php-8.1.0-Win32-vs16-x64\ext\php_xdebug-3.1.5-8.1-vs16-x86_64.dll"

0

Yes, but the message here didn't seem to get any attention, and I wrote to you *after* posting the message here and getting no response.

As it was my first post, I didn't know how the forum worked, and didn't expect any staff to reply to the post.

Thank you very much for the info - of course, it worked, and I have it on my joblist for today to write and thank you.

... which I suppose that I have just done! Thanks for your rapid and accurate response.

0

Oh, that is my bad then - the notification about the thread only arrived today, that's why you got no response here, and then I just didn't pay attention to when the thread was created.
Happy to hear the recommendation helped!

0

@Eugene Morozov

The issue is that you specify the Xdebug extension as zend_extension = xdebug; it won't work this way unless you're on Linux.
Please use the absolute file path like zend_extension = "C:\Program Files\php-8.1.0-Win32-vs16-x64\ext\php_xdebug-3.1.5-8.1-vs16-x86_64.dll"

Why is that?

I'm on Windows .. and this works just fine for me for both CLI and IIS (PHP 8.1, x64 NTS)

Perhaps it's because I have extension_dir set up with the full path?

1

Why is that?

I didn't know why exactly and had to google it: https://bugs.php.net/bug.php?id=70142

On *nix, the interpreter package is always kept in a predefined path, so, during build, it's possible to configure where to resolve relative paths in INI files from.

On Windows, the interpreter could be located anywhere, so the default path is defined as C:\php, and if you put the interpreter there, it would behave as on *nix.

Perhaps it's because I have extension_dir set up with the full path?

So, yes, that's the other way to do that.
I use the extension_dir parameter too as it makes the transition to a newly released PHP version much easier.
What I also didn't know, however, is that it's possible to omit the php_ prefix and .dll in extension names when extension_dir is configured. Thank you for sharing!

0

Please sign in to leave a comment.