mirror of
https://github.com/postfixadmin/postfixadmin.git
synced 2024-09-19 03:02:14 +02:00
try and improve install.sh - PATH, check for php, better error/warning message etc
This commit is contained in:
parent
f83835578c
commit
aa2b21a5a6
21
install.sh
21
install.sh
@ -2,9 +2,18 @@
|
||||
|
||||
set -eu
|
||||
|
||||
# PostfixAdmin install script.
|
||||
# 1. Downloads 'composer.phar' to the current directory.
|
||||
# 2. Runs 'php composer.phar install' which should install required runtime libraries for Postfixadmin
|
||||
# 3. Runs 'mkdir templates_c && chmod 777 templates_c'
|
||||
|
||||
PATH=/bin:/usr/bin:/usr/local/bin
|
||||
export PATH
|
||||
|
||||
COMPOSER_URL=https://getcomposer.org/download/latest-stable/composer.phar
|
||||
|
||||
type php >/dev/null 2>&1 || { echo >&2 "I require php but it's not installed. Aborting."; exit 1; }
|
||||
|
||||
cd "$(dirname "$0")"
|
||||
|
||||
# Check for $(pwd)/composer.phar
|
||||
@ -34,10 +43,18 @@ php composer.phar install --prefer-dist -n --no-dev
|
||||
|
||||
if [ ! -d templates_c ]; then
|
||||
|
||||
echo " * Warning: templates_c didn't exist. I have created it, but you might want to change the ownership and reduce permissions"
|
||||
|
||||
# should really fix ownership to be that of the webserver; is there a nice way to discover which ? (www-data ?)
|
||||
mkdir -p templates_c && chmod 777 templates_c
|
||||
|
||||
echo
|
||||
echo " Warning: "
|
||||
echo " templates_c directory didn't exist, now created."
|
||||
echo
|
||||
echo " You should change the ownership and reduce permissions on templates_c to 750. "
|
||||
echo " The ownership needs to match the user used to execute PHP scripts, perhaps 'www-data' or 'httpd'"
|
||||
echo
|
||||
echo " e.g. chown www-data templates_c && chmod 750 templates_c"
|
||||
echo
|
||||
fi
|
||||
echo
|
||||
echo "Please continue configuration / setup within your web browser. "
|
||||
|
Loading…
Reference in New Issue
Block a user