Run a PHP script directly in PhpStorm

断了今生、忘了曾经 提交于 2020-01-01 07:39:58

问题


  1. How can I instantly run the current PHP file in PhpStorm?
  2. How can I execute PHP command in PHPstorm like PyCharm?

回答1:


Right click in the editor, choose Run (or press ctrl+shift+f10) for command line script execution. If you want to test it on a web server, use Open in Browser from the same menu (you must have browser and server with mappings properly configured for this).




回答2:


On top of @CrazyCoder's solution, in version 2016.3 I came across this issue where I just saw 2 icons like this,

You should hit the 2nd one!

IF you hit the 2nd (like me) next thing I know, it opened in a browser tab. It is a configuration to open in an embeded web server.

So I wanted to delete this configuration and start a new one. So, I found the entry to through this drop down in the top right corner,

While picking Edit Configuration, I could change the test configuration.

Hope that helps someone like me, although clearly not the initial poster.

Cheers



来源:https://stackoverflow.com/questions/7739076/run-a-php-script-directly-in-phpstorm

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