Created
March 21, 2016 20:20
-
-
Save ebylund/b3d6fef634657fb00484 to your computer and use it in GitHub Desktop.
simple php server helper to develop locally
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/bash | |
passed="false" | |
while [ $passed != "true" ] | |
do | |
read -p "What port do you want your server on?: " port; | |
if [ $port -gt "65535" ] | |
then | |
echo -e "\033[31mport:$port\033[0m too high, Please choose a port number less than 65535" | |
elif [ $port -lt "1024" ] | |
then | |
echo -e "\033[31mport:$port\033[0m too low, Please choose a port number greater than 1024" | |
else | |
echo -e "Starting server on port:\033[92m$port\033[0m" | |
passed="true" | |
fi | |
done | |
open -a "Google Chrome" http://localhost:$port | |
php -S localhost:$port | |
#x=~/Library/Preferences/com.apple.LaunchServices/com.apple.launchservices.secure.plist; \ | |
#plutil -convert xml1 $x; \ | |
#grep 'https' -b3 $x | awk 'NR==2 {split($2, arr, "[><]"); print arr[3]}'; \ | |
#plutil -convert binary1 $x |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment