Skip to content

Commit 51692da

Browse files
authored
Pterodactyl: Pump Php to 8.4 (#3655)
1 parent 4811562 commit 51692da

File tree

2 files changed

+28
-11
lines changed

2 files changed

+28
-11
lines changed

ct/pterodactyl-panel.sh

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,27 @@ function update_script() {
2727
msg_error "No ${APP} Installation Found!"
2828
exit
2929
fi
30+
CURRENT_PHP=$(php -v 2>/dev/null | awk '/^PHP/{print $2}' | cut -d. -f1,2)
31+
32+
if [[ "$CURRENT_PHP" != "8.4" ]]; then
33+
msg_info "Migrating PHP $CURRENT_PHP to 8.4"
34+
$STD curl -fsSLo /tmp/debsuryorg-archive-keyring.deb https://packages.sury.org/debsuryorg-archive-keyring.deb
35+
$STD dpkg -i /tmp/debsuryorg-archive-keyring.deb
36+
$STD sh -c 'echo "deb [signed-by=/usr/share/keyrings/deb.sury.org-php.gpg] https://packages.sury.org/php/ $(lsb_release -sc) main" > /etc/apt/sources.list.d/php.list'
37+
$STD apt-get update
38+
$STD apt-get remove -y php"${CURRENT_PHP//./}"*
39+
$STD apt-get install -y \
40+
php8.4 \
41+
php8.4-{gd,mysql,mbstring,bcmath,xml,curl,zip,intl,fpm} \
42+
libapache2-mod-php8.4
43+
44+
msg_ok "Migrated PHP $CURRENT_PHP to 8.4"
45+
fi
46+
3047
RELEASE=$(curl -fsSL https://api.github.com/repos/pterodactyl/panel/releases/latest | grep "tag_name" | awk '{print substr($2, 3, length($2)-4) }')
3148
if [[ ! -f /opt/${APP}_version.txt ]] || [[ "${RELEASE}" != "$(cat /opt/${APP}_version.txt)" ]]; then
3249
msg_info "Stopping Service"
33-
cd /opt/pterodactyl-panel
50+
cd /opt/pterodactyl-panel || exit
3451
$STD php artisan down
3552
msg_ok "Stopped Service"
3653

install/pterodactyl-panel-install.sh

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -23,19 +23,19 @@ $STD apt-get install -y \
2323
composer
2424
msg_ok "Installed Dependencies"
2525

26-
msg_info "Adding PHP8.3 Repository"
27-
$STD curl -fsSLo /tmp/debsuryorg-archive-keyring.deb https://packages.sury.org/debsuryorg-archive-keyring.deb
26+
msg_info "Adding PHP8.4 Repository"
27+
$STD curl -sSLo /tmp/debsuryorg-archive-keyring.deb https://packages.sury.org/debsuryorg-archive-keyring.deb
2828
$STD dpkg -i /tmp/debsuryorg-archive-keyring.deb
2929
$STD sh -c 'echo "deb [signed-by=/usr/share/keyrings/deb.sury.org-php.gpg] https://packages.sury.org/php/ $(lsb_release -sc) main" > /etc/apt/sources.list.d/php.list'
3030
$STD apt-get update
31-
msg_ok "Added PHP8.3 Repository"
31+
msg_ok "Added PHP8.4 Repository"
3232

3333
msg_info "Installing PHP"
3434
$STD apt-get remove -y php8.2*
3535
$STD apt-get install -y \
36-
php8.3 \
37-
php8.3-{gd,mysql,mbstring,bcmath,xml,curl,zip,intl,fpm} \
38-
libapache2-mod-php8.3
36+
php8.4 \
37+
php8.4-{gd,mysql,mbstring,bcmath,xml,curl,zip,intl,fpm} \
38+
libapache2-mod-php8.4
3939
msg_ok "Installed PHP"
4040

4141
msg_info "Setting up MariaDB"
@@ -60,16 +60,16 @@ read -p "Enter your Last Name: " NAME_LAST
6060
msg_info "Installing pterodactyl Panel"
6161
RELEASE=$(curl -fsSL https://api.github.com/repos/pterodactyl/panel/releases/latest | grep "tag_name" | awk '{print substr($2, 3, length($2)-4) }')
6262
mkdir /opt/pterodactyl-panel
63-
cd /opt/pterodactyl-panel
63+
cd /opt/pterodactyl-panel || exit
6464
curl -fsSL "https://github.com/pterodactyl/panel/releases/download/v${RELEASE}/panel.tar.gz" -o $(basename "https://github.com/pterodactyl/panel/releases/download/v${RELEASE}/panel.tar.gz")
6565
tar -xzf "panel.tar.gz"
6666
cp .env.example .env
6767
IP=$(hostname -I | awk '{print $1}')
6868
ADMIN_PASS=$(openssl rand -base64 18 | tr -dc 'a-zA-Z0-9' | head -c13)
6969
$STD composer install --no-dev --optimize-autoloader --no-interaction
7070
$STD php artisan key:generate --force
71-
$STD php artisan p:environment:setup --no-interaction --author $ADMIN_EMAIL --url "http://$IP"
72-
$STD php artisan p:environment:database --no-interaction --database $DB_NAME --username $DB_USER --password $DB_PASS
71+
$STD php artisan p:environment:setup --no-interaction --author "$ADMIN_EMAIL" --url "http://$IP"
72+
$STD php artisan p:environment:database --no-interaction --database $DB_NAME --username $DB_USER --password "$DB_PASS"
7373
$STD php artisan migrate --seed --force --no-interaction
7474
$STD php artisan p:user:make --no-interaction --admin=1 --email "$ADMIN_EMAIL" --password "$ADMIN_PASS" --name-first "$NAME_FIRST" --name-last "$NAME_LAST" --username "admin"
7575
echo "* * * * * php /opt/pterodactyl-panel/artisan schedule:run >> /dev/null 2>&1" | crontab -u www-data -
@@ -82,7 +82,7 @@ chmod -R 755 /opt/pterodactyl-panel/storage/* /opt/pterodactyl-panel/bootstrap/c
8282
echo "pterodactyl Admin Password: $ADMIN_PASS"
8383
} >>~/pterodactyl-panel.creds
8484

85-
echo "${RELEASE}" >/opt/${APPLICATION}_version.txt
85+
echo "${RELEASE}" >/opt/"${APPLICATION}"_version.txt
8686
msg_ok "Installed pterodactyl Panel"
8787

8888
msg_info "Creating Service"

0 commit comments

Comments
 (0)