Making the php code execute in browser using PHPstorm

蓝咒 提交于 2019-12-12 10:39:33

问题


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".

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!


回答1:


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:

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.



来源:https://stackoverflow.com/questions/15667500/making-the-php-code-execute-in-browser-using-phpstorm

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!