how to configure PHPstorm for Yii2 project under Windows
Hello,
Let start by saying that I am new to PHPstorm / Yii2 and even PHP for that matter.
I installed WAMP and created an Apache Virtual Host and I cloned a Yii2 project.
Maybe worth to say that my WAMP install and the Yii2 project are under 2 different location (I mean the project is not located in a subdirectory of wamp/www/).
If I go with my browser on http://myserver it works but I can't find a configuration to run it from PHPstorm:
- Debug button is greyed (it is what I want to be able to do)
- And if I click on run I got the following error
The thing is that if I click on the supposedly invalid address, it opens correctly on my web browser.
Thank you in advance for your help.
请先登录再写评论。
Hi there,
Based on your screenshot:
So ... my conclusion so far (without knowing what you have got there in details) is that you are using wrong type of Run/Debug Configuration and trying to launch a new server on a port that is already occupied by another service (Apache).
Check phpinfo() output to see the web server footprint info (will be in $_SERVER section).
Hi Andriy,
Thank you for your reply.
I guess this might be the issue, but then which can of configuration should I select in PHPstorm ? I could not find which entry I should select to match my configuration (i.e using/listening the already running Apache virtual host hoserver.loc:80).
I will put here the output of phpinfo() in couple of days. I won't have access to that machine before that.
Again, thank you for your help.
>but then which can of configuration should I select in PHPstorm ?
The most obvious: "PHP Web Page" type -- it works without starting any additional servers.
Or do not use any and use Zero-config approach (I'm using it -- use browser to navigate to the needed page and use Xdebug browser extension to set Xdebug cookie): https://www.jetbrains.com/help/phpstorm/2019.2/zero-configuration-debugging.html
I think the Zero-config approach was what I was looking for, I will try this.
Thank you for the (fast) support. It is very much appreciated.
Best regards !