This manual describes how to upgrade Passwork from version 4 to version 5 for CentOS 7. Passwork version 5 runs on PHP 8.0, so in addition to updating the source code you will also need to install a new version of PHP.

<aside> 💡 We recommend that you make a backup of your system before you start the upgrade

</aside>

Table of contents

1**. Updating PHP to PHP 8.0**

<aside> 💡 PHP 8.0 specifically needs to be installed. PHP 8.1 is not yet supported.

</aside>

yum-config-manager --disable remi-php73
yum-config-manager --enable remi-php80
yum update

2**. Installing the PHP Mongo driver for PHP 8.0**

pecl install -f mongodb
echo "extension=mongodb.so" | tee /etc/php.d/20-mongodb.ini
systemctl restart httpd

3**. Installing Phalcon PHP extension for PHP 8.0**

yum -y install php-mysql libtool pcre-devel php-psr php-curl
git clone -b v5.0.0beta3 --depth=1 "<https://github.com/phalcon/cphalcon.git>"
cd cphalcon/build
./install
echo "extension=phalcon.so" | tee /etc/php.d/50-phalcon.ini
systemctl restart httpd

4**. Updating Passwork source codes**

Clone the repository using your username and password.

cd /var/www
git config --global --add safe.directory /var/www
git fetch
git reset --hard origin/v5
git checkout v5

<aside> 💡 The system will ask for a login and password to the repository, which you can find in your Passwork customer portal. If you don't have access to the client portal, contact us.

</aside>

Set permissions for folders and files.

find /var/www/ -type d -exec chmod 755 {} \\;
find /var/www/ -type f -exec chmod 644 {} \\;
chown -R apache:apache /var/www/
systemctl restart httpd

5**. Check configuration**

If you are using HTTPS, check if the following setting has been made after updating the PHP version, enable the session.cookie_secure parameter in /etc/php.ini: