Problem installing Passbolt from source | php gnupg issue

Hi,

I installed Passbolt 3.1 earlier this year from source to used on my apache server. It worked. I wanted to do the update to have the new features that are really important for me, but it seems I totally ruined my installation.

So i tried to reinstall from source, and then load the DB which is still here but no I’m encountering the following message when running sudo su -s /bin/bash -c “/var/www/passbolt/bin/cake passbolt install --force” www-data

PHP Warning:  PHP Startup: Unable to load dynamic library 'gnupg.so' (tried: /usr/lib/php/20180731/gnupg.so (/usr/lib/php/20180731/gnupg.so: cannot open shared object file: No such file or directory), /usr/lib/php/20180731/gnupg.so.so (/usr/lib/php/20180731/gnupg.so.so: cannot open shared object file: No such file or directory)) in Unknown on line 0
PHP Fatal error:  You must enable the gnupg extension to use Passbolt. in /var/www/passbolt/config/requirements.php on line 31

I tried many things, it seems gnupg is very well active but that the install script is looking it in the wrong folder. I’m at a loss and I really need to be back up.

I restored a backup of my server from yesterday, so I’m okay on this. But I would like to know how the hell can I upgrade my Passbolt to the latest version

Hi @Tritri89 :wave:

Some questions:

On which operating system did you install your Passbolt instance from source ?
Do you share your server with some other PHP applications ?
Do you have multiple PHP version installed ?
Which PHP version are you using for Passbolt ?
Can you tell me what is the output of this command on your server: php -i | grep gnupg ?

Thanks !

To answer your questions :

  • Ubuntu Server LTS 20.04
  • Yes a few
  • Yes a few too
  • It’s using 7.2, but I tried to switch on 7.3 but it didn’t work
  • No output for php -i | grep gnupg

Thanks for the answers. Passbolt don’t work with PHP 7.2, you must use at least 7.3 or 7.4 version.

Maybe should you consider to migrate to the Ubuntu package: Passbolt Help | Migrate passbolt CE from install scripts to Ubuntu package updates will be easier.

If you want to deal with multiple php version, you must use Sury’s repository: https://launchpad.net/~ondrej/+archive/ubuntu/php/

Can you show me the output of sudo update-alternatives --display php ? It will display the different php version installed on your system and the default one.

To use the bin/cake passbolt install command, you must define default php as at least php 7.3. And you also must install the php7.x-gnupg package to get the php gnupg module.

I didn’t use the Ubuntu package because it use Nginx, but my server is on Apache (and i have a few service that I can’t take down).

I already have Sury’s repo.

As for the output of sudo update-alternatives --display php here it is

php - mode manuel
  link best version is /usr/bin/php8.0
 le lien pointe actuellement sur /usr/bin/php7.3
  link php is /usr/bin/php
  slave php.1.gz is /usr/share/man/man1/php.1.gz
/usr/bin/php7.0 - priorité 70
 lien secondaire php.1.gz : /usr/share/man/man1/php7.0.1.gz
/usr/bin/php7.2 - priorité 72
 lien secondaire php.1.gz : /usr/share/man/man1/php7.2.1.gz
/usr/bin/php7.3 - priorité 73
 lien secondaire php.1.gz : /usr/share/man/man1/php7.3.1.gz
/usr/bin/php8.0 - priorité 80
 lien secondaire php.1.gz : /usr/share/man/man1/php8.0.1.gz

I understand your point. So it seems php7.3 is your default php version. To get php-gnupg module installed, you should install it:

sudo apt install php7.3-gnupg

Once done, the php -i | grep gnupg should return:

$ php -i | grep gnupg
/etc/php/7.3/cli/conf.d/20-gnupg.ini,
gnupg
gnupg support => enabled

If it is not the case, can you paste here the full output of php -i ?

Can you also paste your apache configuration ?

Thanks !

I tried and here’s what I got, some PHP-FPM error

Paramétrage de php7.3-fpm (7.3.31-2+ubuntu20.04.1+deb.sury.org+1) ...
Not replacing deleted config file /etc/php/7.3/fpm/php.ini
NOTICE: Not enabling PHP 7.3 FPM by default.
NOTICE: To enable PHP 7.3 FPM in Apache2 do:
NOTICE: a2enmod proxy_fcgi setenvif
NOTICE: a2enconf php7.3-fpm
NOTICE: You are seeing this message because you have apache2 package installed.
Job for php7.3-fpm.service failed because the control process exited with error 
code.
See "systemctl status php7.3-fpm.service" and "journalctl -xe" for details.
invoke-rc.d: initscript php7.3-fpm, action "restart" failed.
● php7.3-fpm.service - The PHP 7.3 FastCGI Process Manager
     Loaded: loaded (/lib/systemd/system/php7.3-fpm.service; enabled; vendor pre
set: enabled)
     Active: failed (Result: exit-code) since Fri 2021-11-19 14:36:17 CET; 6ms a
go
       Docs: man:php-fpm7.3(8)
    Process: 1100500 ExecStart=/usr/sbin/php-fpm7.3 --nodaemonize --fpm-config /
etc/php/7.3/fpm/php-fpm.conf (code=exited, status=78)
    Process: 1100528 ExecStopPost=/usr/lib/php/php-fpm-socket-helper remove /run
/php/php-fpm.sock /etc/php/7.3/fpm/pool.d/www.conf 73 (code=exited, status=0/SUC
CESS)
   Main PID: 1100500 (code=exited, status=78)

nov. 19 14:36:17 kodi systemd[1]: Starting The PHP 7.3 FastCGI Process Manager..
.
nov. 19 14:36:17 kodi php-fpm7.3[1100500]: [19-Nov-2021 14:36:17] ERROR: failed 
to open configuration file '/etc/php/7.3/fpm/php-fpm.conf': No such file or dire
ctory (2)
nov. 19 14:36:17 kodi php-fpm7.3[1100500]: [19-Nov-2021 14:36:17] ERROR: failed 
to load configuration file '/etc/php/7.3/fpm/php-fpm.conf'
nov. 19 14:36:17 kodi php-fpm7.3[1100500]: [19-Nov-2021 14:36:17] ERROR: FPM ini
tialization failed
nov. 19 14:36:17 kodi systemd[1]: php7.3-fpm.service: Main process exited, code=
exited, status=78/CONFIG
nov. 19 14:36:17 kodi systemd[1]: php7.3-fpm.service: Failed with result 'exit-c
ode'.
nov. 19 14:36:17 kodi systemd[1]: Failed to start The PHP 7.3 FastCGI Process Ma
nager.
dpkg: erreur de traitement du paquet php7.3-fpm (--configure) :
 installed php7.3-fpm package post-installation script subprocess returned error
 exit status 1
Des erreurs ont été rencontrées pendant l'exécution :
 php7.3-fpm
E: Sub-process /usr/bin/dpkg returned an error code (1)


I think my server is very wanky, it’s my first one so I did a little bit of everything on it

YES, good news, I managed to reinstall PHP7.3-FPM from scratch, then I have installed gnupg and the output of php -i | grep gnupg is good !

Hum, Passbolt install is not the problem here :thinking: You have multiple problems :exploding_head: .

If I were you, I should make a list of all installed services on your server and repair them one per one, or migrate them on a new fresh server.

We have documentation here on how to migrate Passbolt: Passbolt Help | Upgrade

Yep I managed to solve a few one, I’ll try to migrate now (and if it fails my backup is working so no worries)

Great, BTW, you know now from where come your gnupg issue. And Passbolt need at least PHP 7.3 to work.

Well no I follow this tutorial, but it doesn’t work, can’t update the dependencies

Can you share the full output of the command who is failing ?

Thanks !