7

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!

5
  • 6
    Do you have a web server running listening to that port? Commented Mar 27, 2013 at 19:17
  • 5
    If you using PHP 5.4, it has built-in web server .. and PhpStorm supports it as well (use PHP Built-in Web Server type of configuration). More details on built-in server functionality: php.net/manual/en/features.commandline.webserver.php Commented Mar 27, 2013 at 19:31
  • Small blog post about built-in 5.4 web server support in PhpStorm: blog.jetbrains.com/webide/2012/03/… Commented Mar 28, 2013 at 11:32
  • @LazyOne maybe you should write up those comments as an answer so that this question can be marked 'answered' Commented Mar 30, 2013 at 11:53
  • Guys so I tried using PHP's built in server thingy, I also tried to initialize the PHP server through the terminal, it says that the server is initialized and listening to the localhost:8000... But still no success, chrome is still telling me there's nothing there, any ideas? Commented Mar 30, 2013 at 12:08

1 Answer 1

3

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.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.