How do I debug connection problems while testing Deploy module while using local host?
There are few issues with your examples.


You're missing routing-script for the built-in PHP web server. It's recommended to use since you're using PHP built-in web server and by default it may have some problems handling certain clean URLs (for example URI containing dots are treated as direct files). So you should apply this patch from #1543858 and re-run you server as below (same file you can use for both Drupal 7 &amp; 8):

php -S localhost:8000 .ht.router.php

You should use -l in order to specify URI of the Drupal site to use, so your code knows what's your proper hostname (since the fail is related to the connectivity issue).

drush -v -l http://localhost:8000/ cron



If you still have Connection refused, you should check where the code is trying to connect and check the connection (e.g. wrong configuration or firewall in place). To debug the connectivity issue, on OS X you can use dtruss, on Linux this can be debugged by strace, e.g.

strace -e trace=network -fp $(pgrep -fn php)