Updated php and iocube scripts for Ubuntu Jammy and PHP version 8.1

This commit is contained in:
ifrancisme 2024-02-09 09:52:41 +00:00
parent e0784e8c6c
commit e7c098eef8
3 changed files with 27 additions and 1 deletions

View File

@ -26,5 +26,5 @@ database_port=5432 # port number
database_backup=false # true or false database_backup=false # true or false
# General Settings # General Settings
php_version=7.4 # PHP version 5.6 or 7.0, 7.1, 7.2 php_version=8.1 # PHP version 5.6 or 7.0, 7.1, 7.2, 8.1
letsencrypt_folder=true # true or false letsencrypt_folder=true # true or false

View File

@ -92,3 +92,14 @@ if [ ."$php_version" = ."7.4" ]; then
#restart the service #restart the service
service php7.4-fpm restart service php7.4-fpm restart
fi fi
if [ ."$php_version" = ."8.1" ]; then
#copy the php extension .so into the php lib directory
cp ioncube/ioncube_loader_lin_8.1.so /usr/lib/php/20210902
#add the 00-ioncube.ini file
echo "zend_extension = /usr/lib/php/20210902/ioncube_loader_lin_8.1.so" > /etc/php/8.1/fpm/conf.d/00-ioncube.ini
echo "zend_extension = /usr/lib/php/20210902/ioncube_loader_lin_8.1.so" > /etc/php/8.1/cli/conf.d/00-ioncube.ini
#restart the service
service php8.1-fpm restart
fi

View File

@ -13,6 +13,11 @@ verbose "Configuring PHP"
#add the repository #add the repository
if [ ."$os_name" = ."Ubuntu" ]; then if [ ."$os_name" = ."Ubuntu" ]; then
#22.04.x - /*jammy/
if [ ."$os_codename" = ."jammy" ]; then
echo "Ubuntu 22.04 LTS\n"
php_version=8.1
fi
#20.04.x - /*bionic/ #20.04.x - /*bionic/
if [ ."$os_codename" = ."focal" ]; then if [ ."$os_codename" = ."focal" ]; then
echo "Ubuntu 20.04 LTS\n" echo "Ubuntu 20.04 LTS\n"
@ -53,6 +58,9 @@ fi
if [ ."$php_version" = ."7.4" ]; then if [ ."$php_version" = ."7.4" ]; then
apt-get install -y php7.4 php7.4-cli php7.4-fpm php7.4-pgsql php7.4-sqlite3 php7.4-odbc php7.4-curl php7.4-imap php7.4-xml php7.4-gd php7.4-mbstring apt-get install -y php7.4 php7.4-cli php7.4-fpm php7.4-pgsql php7.4-sqlite3 php7.4-odbc php7.4-curl php7.4-imap php7.4-xml php7.4-gd php7.4-mbstring
fi fi
if [ ."$php_version" = ."8.1" ]; then
apt-get install -y php8.1 php8.1-cli php8.1-fpm php8.1-pgsql php8.1-sqlite3 php8.1-odbc php8.1-curl php8.1-imap php8.1-xml php8.1-gd php8.1-mbstring
fi
#update config if source is being used #update config if source is being used
if [ ."$php_version" = ."5" ]; then if [ ."$php_version" = ."5" ]; then
@ -75,6 +83,10 @@ if [ ."$php_version" = ."7.4" ]; then
verbose "version 7.4" verbose "version 7.4"
php_ini_file='/etc/php/7.4/fpm/php.ini' php_ini_file='/etc/php/7.4/fpm/php.ini'
fi fi
if [ ."$php_version" = ."8.1" ]; then
verbose "version 8.1"
php_ini_file='/etc/php/8.1/fpm/php.ini'
fi
sed 's#post_max_size = .*#post_max_size = 80M#g' -i $php_ini_file sed 's#post_max_size = .*#post_max_size = 80M#g' -i $php_ini_file
sed 's#upload_max_filesize = .*#upload_max_filesize = 80M#g' -i $php_ini_file sed 's#upload_max_filesize = .*#upload_max_filesize = 80M#g' -i $php_ini_file
sed 's#;max_input_vars = .*#max_input_vars = 8000#g' -i $php_ini_file sed 's#;max_input_vars = .*#max_input_vars = 8000#g' -i $php_ini_file
@ -102,6 +114,9 @@ fi
if [ ."$php_version" = ."7.4" ]; then if [ ."$php_version" = ."7.4" ]; then
systemctl restart php7.4-fpm systemctl restart php7.4-fpm
fi fi
if [ ."$php_version" = ."8.1" ]; then
systemctl restart php8.1-fpm
fi
#init.d #init.d
#/usr/sbin/service php5-fpm restart #/usr/sbin/service php5-fpm restart
#/usr/sbin/service php7.0-fpm restart #/usr/sbin/service php7.0-fpm restart