-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathinstall-php-version-8.4.sh
More file actions
executable file
·41 lines (31 loc) · 1.35 KB
/
install-php-version-8.4.sh
File metadata and controls
executable file
·41 lines (31 loc) · 1.35 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
#!/bin/bash
# THIS WILL INSTALL PHP 8.4 FASTCGI PROCESS MANAGER HANDLER WHICH ARE USED AS OF DECEMBER 2024
# ASSUMES YOU ALREADY HAVE LAMP RUNNING EITHER ON 5.6/7.0/7.1/7.2/7.3/7.4/8.0/8.1/8.2/8.3 PHP VERSIONS
# VERSIONS CAN BE SWITCHED USING switch_php_version.sh SCRIPT
# RUN IT LIKE THIS (the second argument should be your Ubuntu username):
# sh install-php-version-8.4.sh emerson
# RESTART YOUR APACHE SERVER AND PHP FPM AFTER RUNNING THIS.
# AND AFTER RESTARTING, IT WOULD BE BEST TO ALSO RESTART YOUR COMPUTER!
# Script validation checks
if [ "$(id -u)" != "0" ]; then
echo "This script must be run as root" 1>&2
exit 1
fi
# add PHP PPA
add-apt-repository ppa:ondrej/php;
# Remove any pending packages
apt-get autoremove;
# Run an update
apt-get update;
# Install PHP 8.4 FastCGI process manager (FPM)
apt-get install php8.4-fpm;
# Install PHP 8.4 MySQL driver
apt-get install php8.4-mysql;
# Install important PHP developer libraries in their version 8.4
apt-get install php8.4-curl php8.4-gd php8.4-intl php8.4-imap php8.4-ps php8.4-pspell php8.4-snmp php8.4-sqlite3 php8.4-tidy php8.4-xmlrpc php8.4-xsl php8.4-zip php8.4-xml php8.4-dev;
# Run an update
apt-get update;
# Install phpMyadmin and its dependencies if needed in 8.4
apt-get install php8.4-mbstring;
# Update user targeting default PHP 8.4 FPM
rpl "www-data" $1 /etc/php/8.4/fpm/pool.d/www.conf;