Newbie Question: Why does my code run on external browser instead of in the IDE

Answered

Hello!

I am trying to learn PHP and a friend recommended PhpStorm as the best IDE. After installing the IDE and WAMP, I am able to run simple php code but when I click "Run", the output of the code (like in the "Hello World" example) runs in a new tab in my default browser. In a few tutorials, however, I notice that when the code is run, it runs in the console within the IDE. I have gone through the different documentation but can't seem to resolve this issue. How do I get my code to run within the IDE. 

Thanks.

Troja K.

1
2 comments
Avatar
Permanently deleted user

Hello,

When you right click the file and select "Run", there are two options - Run as JavaScript (top) and Run as PHP Script (bottom).

PhpStorm will then use this Run configuration by default for that file.

You can remove JS run configuration in Run | Edit Configurations and run it again as PHP CLI script.

1
Avatar
Permanently deleted user

Wow, thank you! I can't believe it was something so simple!

Thanks again!

0

Please sign in to leave a comment.