mod_php_install.sh: add mod_php support for versions 8.x

This commit is contained in:
Christoph 2023-07-05 16:23:42 +02:00
parent cf88af8874
commit 942b735491

View File

@ -3597,13 +3597,24 @@ if ! $WITHOUT_APACHE_MOD_PHP ; then
#fi
echononl "\tGoing to set \"LoadModule\" entries in httpd.conf .."
sed -i -r \
-e "s&(^\s*LoadModule php${PHP_MAJOR_VERSION}_module.*$)&\1\n<IfModule mod_php${PHP_MAJOR_VERSION}.c>\n AddType application/x-httpd-php .php\n AddType application/x-httpd-php-source .phps\n</IfModule>&" ${APACHE_BASEDIR}/conf/httpd.conf
if [ "$?" = "0" ]; then
echo_ok
if [[ ${PHP_MAJOR_VERSION} -lt 8 ]] ; then
sed -i -r \
-e "s&(^\s*LoadModule php${PHP_MAJOR_VERSION}_module.*$)&\1\n<IfModule mod_php${PHP_MAJOR_VERSION}.c>\n AddType application/x-httpd-php .php\n AddType application/x-httpd-php-source .phps\n</IfModule>&" ${APACHE_BASEDIR}/conf/httpd.conf
if [ "$?" = "0" ]; then
echo_ok
else
echo_failed
fi
else
echo_failed
sed -i -r \
-e "s&(^\s*LoadModule php_module.*$)&\1\n<IfModule mod_php.c>\n AddType application/x-httpd-php .php\n AddType application/x-httpd-php-source .phps\n</IfModule>&" ${APACHE_BASEDIR}/conf/httpd.conf
if [ "$?" = "0" ]; then
echo_ok
else
echo_failed
fi
fi
fi
@ -7599,6 +7610,31 @@ if $ACTIVATE_PHP_FPM_INIT_SCRIPT ; then
fi
fi
if ! $WITHOUT_APACHE_MOD_PHP ; then
echo ""
echononl "\tiRestarting Apache Webserver.."
if $SYSTEMD_EXISTS ; then
systemctl restart apache2 > /dev/null 2>&1
if [[ "$?" = "0" ]]; then
echo_ok
else
echo_failed
error "Restarting Apache2 Webservice failed!"
fi
else
/etc/init.d/apache2 restart > /dev/null 2>&1
if [[ "$?" = "0" ]]; then
echo_ok
else
echo_failed
error "Restarting Apache2 Webservice failed!"
fi
fi
fi
## -----
## - Rename /etc/mysql/my.cnf if MySQL was not installed from debian package system.