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/] failed: Connection refused (Connection refused)


But every other test works (browser, telnet, other REST clients...). Integrated REST client works with other services (like )

What am I doing wrong?

(Using phpStorm 2017.3.1 on macOS 10.13.3)



You're doing everything right, it's a bug. Please try the workaround suggested here:

Also, for me, the issue is not reproducible in 2018.1 EAP, so you might wanna give it a try as well:


Solution given (using instead of localhost) works. Thank you!

0 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 iface -- looks like it works pretty good now. Seems like firewall issue. I'm on Mac OS btw


Please sign in to leave a comment.