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 tophp_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?
请先登录再写评论。
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:
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.
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!
@Eugene Morozov
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?
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.So, yes, that's the other way to do that.
I use the
extension_dirparameter 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.dllin extension names whenextension_diris configured. Thank you for sharing!