start.sh: improve errors when PHP isn't found

This commit is contained in:
Dylan K. Taylor 2021-11-30 23:51:35 +00:00
parent d535f02096
commit cb0af44ccb
No known key found for this signature in database
GPG Key ID: 8927471A91CAFD3D

View File

@ -23,10 +23,11 @@ if [ "$PHP_BINARY" == "" ]; then
if [ -f ./bin/php7/bin/php ]; then
export PHPRC=""
PHP_BINARY="./bin/php7/bin/php"
elif [[ ! -z $(type php) ]]; then
elif [[ ! -z $(type php 2> /dev/null) ]]; then
PHP_BINARY=$(type -p php)
else
echo "Couldn't find a working PHP binary, please use the installer."
echo "Couldn't find a PHP binary in system PATH or $PWD/bin/php7/bin"
echo "Please refer to the installation instructions at https://doc.pmmp.io/en/rtfd/installation.html"
exit 1
fi
fi