Ilya Karnaukhov
Ilya Karnaukhov

Reputation: 3977

Making the php code execute in browser using PHPstorm

So PHPstorm is running the php code fine in its console when I click run, that's great but I want to see it in the browser.

So I created a new PHP web application inside PHPstorm, set up the server to "localhost:8000".

PHPstorm screenie

Now when I click RUN it opens the browser but I get an error message: "Oops! Google Chrome could not connect to localhost:8000"

What am I doing wrong??

Thanks!

Upvotes: 7

Views: 6561

Answers (1)

Ja͢ck
Ja͢ck

Reputation: 173532

You have to configure a run configuration for your project first.

Go to Run -> Edit Configurations, click on "PHP Built-in Web Server" and then press "+". You should see something like this:

Run/Debug Configurations

After saving the settings you can run the web server via Run -> Run '<project-name>'. It should now serve up the pages to your browser.

Upvotes: 3

Related Questions