上篇我们安装解决了apache占用启动
现在我们来配置 XAMPP 与Phpstormz
修改 XAMPP 路径
- 1 打开 应用程序->XAMPP->xamppfiles->etc->httpd.conf 文档 (用文本编辑器打开)
- 2
commond+f
搜索DocumentRoot
,搜到如下结果 - # DocumentRoot: The directory out of which you will serve your
# documents. By default, all requests are taken from this directory, but
# symbolic links and aliases may be used to point to other locations.
#
DocumentRoot "/Applications/XAMPP/xamppfiles/htdocs"
<Directory "/Applications/XAMPP/xamppfiles/htdocs">
修改路径 需要和Phpstorm路径一致 -
接下来 修改用户名
-
user daemon改为user yourname(你的电脑用户名)
-
XAMPP 配置结束
-
第二部分修改PhpStorm
-
点击PHPStorm—>Preferences跳到如下页面。
-
-
在
interpreter
后选择PHP环境路径。会跳转到下图1-3所示页面。添加PHP,并在PHP executable
后选择XAMPP安装目录下的bin
文件夹。系统会自动识别PHP安装版本。点击ok后,即可开发 -
如果测试文件打开显示502
-
这个时候看下 地址端口是http://localhost:63342/ 端口是63342 可以把端口改为80 是否正常,正常就是端口的问题
-
xampp端口默认是80端口
-
可以在xapmm配置文件中修改端口为63342 或者修改phpstorm的端口为80
-
建议修改phpstorm端口为80