Cannot connect localhost with phpStorm REST client
Hi community,
I'm developing a REST API in PHP 7.0 with phpStorm. I'm using "PHP Built-in Web Server" as a server (screenshot of the configuration below)
Now I'm trying the integrated REST Client and I'm getting this error:
POST http://localhost:8080/api/authentication
org.apache.http.conn.HttpHostConnectException: Connect to localhost:8080 [localhost/127.0.0.1] failed: Connection refused (Connection refused)
But every other test works (browser, telnet, other REST clients...). Integrated REST client works with other services (like http://now.httpbin.org/ )
What am I doing wrong?
(Using phpStorm 2017.3.1 on macOS 10.13.3)
Please sign in to leave a comment.
You're doing everything right, it's a bug. Please try the workaround suggested here: https://youtrack.jetbrains.com/issue/WI-34339#comment=27-2714660
Also, for me, the issue is not reproducible in 2018.1 EAP, so you might wanna give it a try as well: https://www.jetbrains.com/phpstorm/eap/
Solution given (using 127.0.0.1 instead of localhost) works. Thank you!
127.0.0.1 trick does NOT work for me. I'm on 2018.3.5 Ultimate Edition trying to send request to PHP built-in server. Few months ago it worked perfectly.
UPD: Launched server on 0.0.0.0 iface -- looks like it works pretty good now. Seems like firewall issue. I'm on Mac OS btw