DEB
Preparation for update
info
If Passwork is hosted in a cloud or virtual environment, create a snapshot so you can roll back if the PHP upgrade fails.
Obtain root privileges and refresh the package index:
- shell
sudo -i
apt-get update
Removing PHP
Disable the Apache2 module:
- shell
a2dismod php8.3
Remove the main package, drivers, and PHP extensions:
- shell
apt purge -y php8.3*
Clean up dependencies:
- shell
apt autoremove -y --purge
Installing PHP
Install PHP with the required extensions and drivers:
- shell
apt install -y php8.3 php8.3-cli php8.3-bcmath php8.3-fpm php8.3-curl php8.3-gd php8.3-intl php8.3-ldap php8.3-mbstring php8.3-mysql php8.3-opcache php8.3-pgsql php8.3-soap php8.3-zip php8.3-sqlite3 php8.3-xml php8.3-dev php-pear
Adjust the memory limit for PHP scripts:
- shell
sed -i 's/^memory_limit\s*=.*/memory_limit = 256M/' /etc/php/8.3/fpm/php.ini
warning
Increase memory_limit to 512M or higher if Passwork will be used by a large number of users.
Confirm that the php8.3-fpm service is running:
- shell
systemctl status php8.3-fpm
Start the service and enable auto-start if it is stopped:
- shell
systemctl start php8.3-fpm
systemctl enable php8.3-fpm
Installing the PHP MongoDB driver
Install the PHP MongoDB driver:
- shell
pecl install -f mongodb
danger
Press Enter to accept the default build options.
Create configuration files to load and enable the MongoDB extension:
- shell
echo "extension=mongodb.so" | tee /etc/php/8.3/fpm/conf.d/20-mongodb.ini
echo "extension=mongodb.so" | tee /etc/php/8.3/cli/conf.d/20-mongodb.ini
Restart the services:
- shell
systemctl restart php8.3-fpm.service
systemctl restart apache2.service