This manual describes how to upgrade Passwork from version 4 to version 5 for Debian. 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>

apt-get update
apt-get install -y php8.0 php8.0-dev php8.0-ldap php8.0-xml php8.0-bcmath php8.0-mbstring php8.0-curl

2**. Selecting PHP 8.0 as the primary version of PHP**

sudo a2dismod php7.3 # If necessary, disable all versions of PHP except version 8.0
sudo a2enmod php8.0
update-alternatives --set php /usr/bin/php8.0
update-alternatives --set phar /usr/bin/phar8.0
update-alternatives --set phar.phar /usr/bin/phar.phar8.0
update-alternatives --set phpize /usr/bin/phpize8.0
update-alternatives --set php-config /usr/bin/php-config8.0
systemctl restart apache2

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

pecl install -f mongodb
echo "extension=mongodb.so" | tee /etc/php/8.0/apache2/conf.d/20-mongodb.ini
echo "extension=mongodb.so" | tee /etc/php/8.0/cli/conf.d/20-mongodb.ini

4**. Installing PhalconPHP extension for PHP 8.0**

pecl install -f psr
echo "extension=psr.so" | tee /etc/php/8.0/apache2/conf.d/20-psr.ini
echo "extension=psr.so" | tee /etc/php/8.0/cli/conf.d/20-psr.ini
pecl install -f phalcon-5.0.0beta3
echo "extension=phalcon.so" | tee /etc/php/8.0/apache2/conf.d/30-phalcon.ini
echo "extension=phalcon.so" | tee /etc/php/8.0/cli/conf.d/30-phalcon.ini
systemctl restart apache2

5**. 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 www-data:www-data /var/www/
systemctl restart apache2