définir la timezone

This commit is contained in:
2025-04-05 06:23:52 +02:00
parent b75afa7df8
commit 1b758b6161
3 changed files with 28 additions and 3 deletions

View File

@@ -16,6 +16,8 @@ PHP_VERSION="8.3"
PHP_INI_CLI="/etc/php/${PHP_VERSION}/cli/php.ini"
PHP_INI_APACHE="/etc/php/${PHP_VERSION}/apache2/php.ini"
TIMEZONE=$(timedatectl show --value --property=Timezone)
# Générer un mot de passe alphanumérique sécurisé
DB_PASSWORD=$(tr -dc 'A-Za-z0-9' </dev/urandom | head -c 16)
echo "Mot de passe généré pour la base de données : ${DB_PASSWORD}"
@@ -40,9 +42,8 @@ php${PHP_VERSION}-mbstring php${PHP_VERSION}-curl php${PHP_VERSION}-xml php${PHP
php${PHP_VERSION}-tokenizer libapache2-mod-php${PHP_VERSION} unzip
# Définir la timezone PHP pour CLI et Apache
sed -i "s|^;*date.timezone =.*|date.timezone = Europe/Paris|" ${PHP_INI_CLI}
sed -i "s|^;*date.timezone =.*|date.timezone = Europe/Paris|" ${PHP_INI_APACHE}
sed -i "s|^;*date.timezone =.*|date.timezone = ${TIMEZONE}|" "${PHP_INI_CLI}"
sed -i "s|^;*date.timezone =.*|date.timezone = ${TIMEZONE}|" "${PHP_INI_APACHE}"
# Sécuriser MariaDB
mysql_secure_installation <<EOF