1.phpstorm 软件默认 ser:port ==>6434php
测试 :'GET' 请求效果web
能够看到端口号: 6434apache
测试 'POST' 请求: 1.输入user/pass 而后提交浏览器
404...not find post.php 咱们能够看到port:6434 端口上的post失败。 项目路径中:咱们能够看到post.php就在同一级目录。服务器
可是6434端口的post就是返回了404phpstorm
因此咱们能够得出一下结论: HTTP s: HTTP c: 127.0.0.1:6434 --------- 127.0.0.1:6434 'GET': OK 'POST':errpost
查了不少教程,有大神说是软件问题,因此咱们使用PHP -S启动php内置webser来测试。 port:6435 (6434 bind by phpstorm) 首先启动ser: htdocs$ php -S 127.0.0.1:6435 测试
2.在浏览器中直接测试 config phpstorm port with 6435 (which as client) 'GET' ok
'POST' Ok 咱们配置phpstorm ser的启动端口为6435来测试postorm
test 'GET': ok test 'POST':ok教程
结论:ser使用php自带的webser 端口为6435 HTTP s: HTTP c: 127.0.0.1:6435 --------- 127.0.0.1:6435 'GET': OK 'POST':ok 能够正常请求。
因此证实出,phpstorm的确在6434这个端口上作了其余处理,致使post失败。
网上有教材指引:配置localhost 就能够正常访问。 咱们分析其原理。
测试 80 port: 1.first we kill httpd
2.we start php webser in 80 port:
3.咱们直接使用浏览器测试 先不修改phpstrom port:6435
测试成功,须要注意,咱们的post发送到了 127.0.0.1:80端口,而127.0.0.1:80端口咱们本身启动了phpwebser。因此正常。 若是你没有本身在80端口启动phpwebser,则能够使用apache直接代替phpwebser。
4.如今咱们大体理解了http的请求过程: 咱们来配置phpstorm 来支持post-->connect-->apache 本质: 127.0.0.1:80 (apache 服务器,我配置localhost后cli端也是post到80端口,即apache)
http://localhost:80 == http://localhost
POST: OK
总结:若是想要发送到其余端口,配置 http://localhost:xxxx 便可.