RPM
Preparation for update
If Passwork runs in a cloud or virtual environment, create a snapshot so you can roll back if the PHP upgrade fails.
Elevate to root and refresh the local package index:
- shell
sudo -i
dnf update
Removing PHP
Remove the main package along with its drivers and extensions:
- shell
dnf remove php php-* -y
Delete the directory that stores PHP extension configuration files:
- shell
rm -rf /etc/php.d
Installing PHP
Install PHP with the required extensions:
- shell
dnf install -y php-cli php-fpm php-curl php-devel php-pear php-gd php-intl php-ldap php-bcmath php-mbstring php-mysqlnd php-opcache php-pgsql php-soap php-zip php-sqlite3 php-xml
Increase the memory available for PHP scripts:
- shell
sed -i 's/^memory_limit\s*=.*/memory_limit = 256M/' /etc/php.ini
Increase memory_limit to 512M or higher if Passwork will serve a large number of users.
Confirm that the php-fpm service is running:
- shell
systemctl status php-fpm
Start the service and enable auto-start if it is stopped:
- shell
systemctl start php-fpm
systemctl enable php-fpm
Installing the PHP MongoDB driver
Install the PHP MongoDB driver:
- shell
pecl install -f mongodb
Press Enter to accept the default build options.
Create a configuration file to load and enable the MongoDB extension:
- shell
echo "extension=mongodb.so" | tee /etc/php.d/20-mongodb.ini
Restart services to apply the changes:
- shell
systemctl restart php-fpm.service
systemctl restart httpd.service