-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathenable_php8.sh
More file actions
executable file
·20 lines (15 loc) · 945 Bytes
/
enable_php8.sh
File metadata and controls
executable file
·20 lines (15 loc) · 945 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#!/bin/bash
# Enable PHP8 & disable PHP7
# write permissions needed on /etc/httpd/conf/httpd.conf
# disable php7
sed -i '/Include conf\/extra\/php7_module.conf/c\#Include conf\/extra\/php7_module.conf' /etc/httpd/conf/httpd.conf
sed -i '/LoadModule php7_module modules\/libphp7.so/c\#LoadModule php7_module modules\/libphp7.so' /etc/httpd/conf/httpd.conf
sed -i '/AddHandler php7-script .php/c\#AddHandler php7-script .php' /etc/httpd/conf/httpd.conf
# enable php8
sed -i '/#Include conf\/extra\/php_module.conf/c\Include conf\/extra\/php_module.conf' /etc/httpd/conf/httpd.conf
sed -i '/#LoadModule php_module modules\/libphp.so/c\LoadModule php_module modules\/libphp.so' /etc/httpd/conf/httpd.conf
sed -i '/#AddHandler php-script .php/c\AddHandler php-script .php' /etc/httpd/conf/httpd.conf
# restart apache
# nopasswd in sudoers must be specified !
sudo systemctl restart httpd.service
DISPLAY=:0 notify-send "PHP8 enabled." -u normal