参考文章:https://www.cnblogs.com/cinlap/p/11046023.html
目标:PHPStorm 2018.1通过配置无需安装其它Web Server
打开偏好设置窗口找到
PHP
,设置CLI Interpreter
PHP的解释器
![](https://img.haomeiwen.com/i2206137/9a9c43e62a608156.png)
![](https://img.haomeiwen.com/i2206137/2469f6fac278c617.png)
点击...
按钮,进入解释器配置界面,起一个名字Name
,PHP executable
路径填写本地PHP程序完整路径,点击刷新按钮如果填写无误将看到蓝色叹号图标,如有问题将会提示。
![](https://img.haomeiwen.com/i2206137/e8d4c68e51874f32.png)
Run -> Edit Configurations
添加 Built-in Web Server
点击菜单进入功能界面,点击+
新建PHP Built-in Web Server
,起一个名字Name
,Host
设置为localhost
,Port
可以自行设定希望的端口号,Document root
一般设置为项目目录
![](https://img.haomeiwen.com/i2206137/5786ce0d6b91a990.png)
![](https://img.haomeiwen.com/i2206137/d5e565f78834f70d.png)
启动目标 Web Server
在顶部工具栏选择要使用的 Built-in Web Server 点击运行图标启动它,此时 PHPStorm 将侦听设定的端口号接收 PHP 请求,在编辑窗口点击目标浏览器工具栏中的图标即可查看结果
![](https://img.haomeiwen.com/i2206137/72f816fa4f958c52.png)
![](https://img.haomeiwen.com/i2206137/1466008e33cab8d8.png)
![](https://img.haomeiwen.com/i2206137/f53a70b0a5a4a90e.png)
网友评论