Last active
December 31, 2015 21:29
-
-
Save AdrianSchneider/8047087 to your computer and use it in GitHub Desktop.
PHP built-in server on next unused port
seq 8000 65000 defines the port range
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
for port in $(seq 8000 65000); do echo -ne "\035" | telnet 127.0.0.1 $port > /dev/null 2>&1; [ $? -eq 1 ] && echo "$port" && break; done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
php -S localhost:`bin/next-port` & # Listening on http://localhost:8000 | |
php -S localhost:`bin/next-port` & # Listening on http://localhost:8001 | |
php -S localhost:`bin/next-port` & # Listening on http://localhost:8002 | |
php -S localhost:`bin/next-port` & # Listening on http://localhost:8003 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment