Skip to content

Instantly share code, notes, and snippets.

@masakielastic
Forked from ircmaxell/php.sh
Created September 1, 2012 21:41
Show Gist options
  • Save masakielastic/3588290 to your computer and use it in GitHub Desktop.
Save masakielastic/3588290 to your computer and use it in GitHub Desktop.
PHP Run Script
#!/bin/bash
BIN=""
if [ "$PHP" == "/usr/local/bin/php" ]
then
PHP=""
fi
BIN="/usr/local/php/$1/bin/php"
if [ -x "$BIN" ]
then
shift
else
if [ -x "$BIN" ]
then
BIN="$PHP"
else
if [ -x "/usr/local/php/$PHP/bin/php" ]
then
BIN="/usr/local/php/$PHP/bin/php"
else
BIN="/usr/local/bin/php"
fi
fi
fi
$BIN $@
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment