Skip to content

Commit 20e5b1a

Browse files
Paymenter: bump php to 8.3 (#3825)
* Update paymenter.json * Update paymenter-install.sh * Update paymenter.json Updated json notes * Update paymenter-install.sh * Update paymenter-install.sh * Update paymenter-install.sh * Update paymenter.sh --------- Co-authored-by: CanbiZ <[email protected]>
1 parent e5800a0 commit 20e5b1a

File tree

3 files changed

+21
-19
lines changed

3 files changed

+21
-19
lines changed

ct/paymenter.sh

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,17 +29,19 @@ function update_script() {
2929
exit
3030
fi
3131
CURRENT_PHP=$(php -v 2>/dev/null | awk '/^PHP/{print $2}' | cut -d. -f1,2)
32-
if [[ "$CURRENT_PHP" != "8.4" ]]; then
33-
msg_info "Migrating PHP $CURRENT_PHP to 8.4"
32+
if [[ "$CURRENT_PHP" != "8.3" ]]; then
33+
msg_info "Migrating PHP $CURRENT_PHP to 8.3"
3434
$STD curl -fsSLo /tmp/debsuryorg-archive-keyring.deb https://packages.sury.org/debsuryorg-archive-keyring.deb
3535
$STD dpkg -i /tmp/debsuryorg-archive-keyring.deb
3636
$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'
3737
$STD apt-get update
3838
$STD apt-get remove -y php"${CURRENT_PHP//./}"*
3939
$STD apt-get install -y \
40-
php8.4 \
41-
php8.4-{common,cli,gd,mysql,mbstring,bcmath,xml,curl,zip,intl,fpm}
42-
msg_ok "Migrated PHP $CURRENT_PHP to 8.4"
40+
php8.3 \
41+
php8.3-{common,cli,gd,mysql,mbstring,bcmath,xml,curl,zip,intl,redis,fpm}
42+
sed -i 's|php8\.2-fpm\.sock|php8.3-fpm.sock|g' /etc/nginx/sites-available/paymenter.conf
43+
$STD systemctl reload nginx
44+
msg_ok "Migrated PHP $CURRENT_PHP to 8.3"
4345
fi
4446
RELEASE=$(curl -fsSL https://api.github.com/repos/paymenter/paymenter/releases/latest | grep '"tag_name"' | sed -E 's/.*"tag_name": "([^"]+)".*/\1/')
4547
if [[ ! -f /opt/${APP}_version.txt ]] || [[ "${RELEASE}" != "$(cat /opt/${APP}_version.txt)" ]]; then

frontend/public/json/paymenter.json

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,5 +30,10 @@
3030
"username": "[email protected]",
3131
"password": "paymenter"
3232
},
33-
"notes": []
33+
"notes": [
34+
{
35+
"text": "After installation, navigate to the directory with `cd /opt/paymenter` and run `php artisan app:init`. An interactive setup will prompt you to enter your company name and application URL.",
36+
"type": "info"
37+
}
38+
]
3439
}

install/paymenter-install.sh

Lines changed: 8 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -25,18 +25,18 @@ $STD apt-get install -y \
2525
redis-server
2626
msg_ok "Installed Dependencies"
2727

28-
msg_info "Adding PHP8.4 Repository"
28+
msg_info "Adding PHP Repository"
2929
$STD curl -sSLo /tmp/debsuryorg-archive-keyring.deb https://packages.sury.org/debsuryorg-archive-keyring.deb
3030
$STD dpkg -i /tmp/debsuryorg-archive-keyring.deb
3131
$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'
3232
$STD apt-get update
33-
msg_ok "Added PHP8.4 Repository"
33+
msg_ok "Added PHP Repository"
3434

3535
msg_info "Installing PHP"
3636
$STD apt-get remove -y php8.2*
3737
$STD apt-get install -y \
38-
php8.4 \
39-
php8.4-{common,cli,gd,mysql,mbstring,bcmath,xml,curl,zip,intl,fpm}
38+
php8.3 \
39+
php8.3-{common,cli,gd,mysql,mbstring,bcmath,xml,curl,zip,intl,fpm}
4040
msg_info "Installed PHP"
4141

4242
msg_info "Installing Composer"
@@ -78,13 +78,7 @@ $STD php artisan migrate --force --seed
7878
msg_ok "Set up database"
7979

8080
msg_info "Creating Admin User"
81-
$STD php artisan p:user:create <<EOF
82-
83-
paymenter
84-
admin
85-
paymenter
86-
0
87-
EOF
81+
$STD php artisan app:user:create paymenter admin [email protected] paymenter 1 -q
8882
msg_ok "Created Admin User"
8983

9084
msg_info "Configuring Nginx"
@@ -103,7 +97,7 @@ server {
10397
10498
location ~ \.php\$ {
10599
include snippets/fastcgi-php.conf;
106-
fastcgi_pass unix:/var/run/php/php8.2-fpm.sock;
100+
fastcgi_pass unix:/var/run/php/php8.3-fpm.sock;
107101
fastcgi_param SCRIPT_FILENAME \$document_root\$fastcgi_script_name;
108102
include fastcgi_params;
109103
}
@@ -140,7 +134,8 @@ RestartSec=5s
140134
[Install]
141135
WantedBy=multi-user.target
142136
EOF
143-
$STD systemctl enable --now paymenter
137+
systemctl enable --now paymenter
138+
systemctl enable --now redis-server
144139
msg_ok "Setup Service"
145140

146141
msg_info "Cleaning up"

0 commit comments

Comments
 (0)