PHP Web base run configuration.

Windows 10
Intellij Ultimate Version: 2019.1  w/ php plugin

So I followed the instructions to get an amp based php development environment (windows) setup from here:
Have confirmed that my local Apache server is running fine and integrated, the mysql server is primed and integrated, and the php interpreter is properly defined and accessible (php v7.3.3) with xdebug installed and configured.
I've confirmed that at least I can run/debug the php files as scripts and functioning properly (added a debug breakpoint, selected my index.php and debug it from the context menu and breaks accordingly).
But I'm scratching my head on how to configure what I believe is a PHP Web Page configuration for the run/debug configuration.

I've already defined my Deployment server like and it has mappings to my local source path for my project... but when trying to create the PHP Web Page configuration I'm not sure if the Deployment configuration is even considered? It looks like I have to reconfigure much of this same information? Do I have to specify that I need the code from my project to be copied into the C:\xampp\htdocs folder?

It feels that I'm trying to do too much with this, it can't really be that hard? Ultimately, what I want to wind up with when I run is the web server will be hit with the url:
http://localhost:80/index.php?foo=xxx

 

12 comments
Comment actions Permalink

so I sorta worked out this by creating a symlink to my project in the xampp/htdocs folder (though I'm still not sure if this should be necessary) but the problem I have now is my debugging environment isn't working, e.g., set breakpoint, start run target with debug... no break.

0
Comment actions Permalink

Could someone from JetBrains please get back to me on this? I'm burning a huge chunk of time trying to get something so basic running here.

Please don't make me go back to netbeans on this.

0
Comment actions Permalink

Please don't use Run/Debug configurations for web debugging, it's cumbersome and requires manual adjustment of the URL each time you want to change it. The zero-configuration way is so much more convenient: https://www.jetbrains.com/help/phpstorm/zero-configuration-debugging.html

Personally, I prefer using the Debug This Page bookmarklet from here: https://www.jetbrains.com/phpstorm/marklets/

When you proceed with zero-configuration debugging and a debug session is started, PhpStorm will ask you how contents of your web root relate to your project, and this mapping will be added into Settings/Preferences | Languages & Frameworks | PHP | Servers.

0
Comment actions Permalink

thanks for the information! and this should work exactly like this using intellij ultimate with the PHP plugin?

0
Comment actions Permalink

Yep, exactly like this. Here's the same article but for IDEA: https://www.jetbrains.com/help/idea/zero-configuration-debugging.html

0
Comment actions Permalink

Okay... seems I still have something in arrears here. Here's what I have.

when I run my app I expect this url to work:

http://localhost/QuoteTool/index.php?authcode=eueue888dd&username=myaddress@foobar.com 

so here's my interpreter config:

here's my php configuration:

here's my deployment configuration:

with the mappings (not sure how this is supposed to work)

Do I have to set "Web path" to something here?

So I set Start Listening For Debug PHP Connections on,
from Chrome turn on Debug from extension:

but when I hit the url I'd expect to use I get:404 site not found error. but I just hit http://localhost, a breakpoint does get hit on a partially generated index.php page that looks like:

 

I'm guess it has something to do with my mappings?

I did have a symlink to my project in the exampp/htdocs folder, bur removed it because I'm pretty sure mapping the project as I have in the deployment configuration should take care of this?

0
Comment actions Permalink

okay... well after all of that, if I put my symlink to my project back into /c/xampp/htdocs this does work, but I would have thought the mapping setting from the deployment configuration would somehow avoid this?

but now I'm looking at two different sets of scripts? When it break, I'm now stopped at c:\xampp\htdocs\QuoteTool\* file. Is this what's supposed to happen?

0
Comment actions Permalink

And on top of that, I can't break in any of my classes after the first level. There must be something in this mapping stuff that I'm not just not getting.

0
Comment actions Permalink

great, I'm having a private conversion with myself.

so the only way I have been successful in getting a reliable debug session to work is to run the project directly out of the htdocs folder of the server and forego the mapping configuration entirely.

I'd prefer not to do this, so if someone could provide some pointers on how to properly set up this mapping stuff I would be overjoyed.

0
Comment actions Permalink

so here's my interpreter config

You don't really need it, you are using a standalone web server (and not the built-in one) and don't run any CLI PHP tools, so it sits there doing nothing. You can leave it intact nevertheless, it does no harm.

but I would have thought the mapping setting from the deployment configuration would somehow avoid this?

For debugging, it's the debugging mappings that solve these things and not the deployment mappings: Languages & Frameworks | PHP | Servers.

a breakpoint does get hit on a partially generated index.php page that looks like

That's because you didn't set any debug mappings, this setting is called Force break at first line when no mapping specified. Alternatively, it may be Run | Break at first line in PHP scripts.

What you need to do now is set appropriate mappings at Languages & Frameworks | PHP | Servers: C:\Users\kkrasnowsky\QuoteTools should be mapped to C:\xampp\htdocs\QuoteTool\. Remove any kind of symlinks you have.

I think that after that it should work as expected.

great, I'm having a private conversion with myself.

Frankly, we don't process forums threads in a high priority - it makes sense to contact support directly if you need us to respond in a timely manner: https://intellij-support.jetbrains.com/hc/en-us/requests/new?ticket_form_id=66731

2
Comment actions Permalink

Nope, this isn't working again... followed all of this and not break points are hit.

Why is php debugging in intellij so difficult to configure?

0
Comment actions Permalink

Why is php debugging in intellij so difficult to configure?

It's not when you get the idea. But this initial learning curve is steep, that's true.

Nope, this isn't working again... followed all of this and not break points are hit.

Please show screenshots of:

  1. Settings | Languages & Frameworks | PHP | Debug
  2. Settings | Languages & Frameworks | PHP | Servers (the one you're using)

And let me know what happens:

  1. When you enable Run | Break at first line in PHP scripts
  2. When you disable it
0

Please sign in to leave a comment.