/
036-php
executable file
·58 lines (49 loc) · 1.75 KB
/
036-php
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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
#!/bin/bash
echo $0 > /var/www/html/userfiles/nems-build.cur
# Get the platform before removing php (as it requires PHP)
platform=$(/usr/local/bin/nems-info platform)
# Uninstall PHP 7.0 residual packages
apt remove --purge -y php7.0-cli
apt remove --purge -y php7.0-common
apt remove --purge -y php7.0-json
apt remove --purge -y php7.0-opcache
apt remove --purge -y php7.0-phpdbg
apt remove --purge -y php7.0-readline
apt -y autoremove
# Install PHP 7.3
# Now, upgrade
apt update
apt -y upgrade
echo "Installing PHP 7.3..."
# Install PHP 7.2
apt install -y $repo php7.3
apt install -y $repo php7.3-cli
apt install -y $repo php7.3-common
apt install -y $repo php7.3-curl
apt install -y $repo php7.3-gd
apt install -y $repo php7.3-json
apt install -y $repo php7.3-mbstring
apt install -y $repo php7.3-mysql
apt install -y $repo php7.3-opcache
apt install -y $repo php7.3-phpdbg
apt install -y $repo php7.3-readline
apt install -y $repo php7.3-sqlite3
apt install -y $repo php7.3-xml
apt install -y $repo libapache2-mod-php7.3
apt install -y $repo libargon2-1
apt install -y $repo libsodium23
apt install -y $repo php-curl
apt install -y $repo php-rrd
# for check_mssql
apt install -y $repo php7.3-sybase
# Increase upload size for background images
if [[ -e /etc/php/7.3/phpdbg/php.ini ]]; then
/bin/sed -i '/post_max_size =/c\; NEMS00001\npost_max_size = 20M' /etc/php/7.3/phpdbg/php.ini
/bin/sed -i '/upload_max_filesize =/c\upload_max_filesize = 16M' /etc/php/7.3/phpdbg/php.ini
fi
if [[ -e /etc/php/7.2/phpdbg/php.ini ]]; then
/bin/sed -i '/post_max_size =/c\; NEMS00001\npost_max_size = 20M' /etc/php/7.2/phpdbg/php.ini
/bin/sed -i '/upload_max_filesize =/c\upload_max_filesize = 16M' /etc/php/7.2/phpdbg/php.ini
fi
echo "Done."
systemctl restart apache2