aboutsummaryrefslogtreecommitdiff
path: root/serve.sh
blob: 537c9805f07b1ad2b3891986ea00b4c774d42610 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#!/bin/sh

php_bin=""
port=8000

for try_bin in {php7,php}
do
	php_bin=$(command -v $try_bin)
	if [[ -n "$php_bin" ]]
	then
		break
	fi
done

echo "Using PHP: $php_bin"

if [ -n "$1" ]
then
	port=$1
fi

$php_bin -S localhost:$port -d short_open_tag=true index.php