Removed PHP 7.4

So I did something dumb, I removed PHP (7.4) and installed PHP 8.1.
Now Passbolt does not launch.
Is there any way to recover from this?
If not can I reinstall Passbolt and connect it to the current Passbolt DB?

Welcome to the forum @DSMadcow !

What distribution are you using?

On some distributions it is necessary to also edit the /etc/nginx/sites-enabled/nginx-passbolt.conf file.

There will be a line like:

 fastcgi_pass             unix:/run/php/php7.4-fpm.sock;

and you’ll want to change that to

fastcgi_pass             unix:/run/php/php8.1-fpm.sock;

and then restart nginx

2 Likes

@clayton made the change you mentioned.
nginx will not start now, fails on the nginx-passbolt.conf.

I see it has the following in the conf file as well:
root /usr/share/php/passbolt/webroot;
and that does not exist anymore. I think that may also be an issue, any idea where I need to point this or how to recreate that directory with the correct index index.php files?

server {

Managed by Passbolt

server_name bolt.lddrew.com;

client_body_buffer_size 100K;
client_header_buffer_size 1K;
client_max_body_size 5M;

client_body_timeout 10;
client_header_timeout 10;
keepalive_timeout 5 5;
send_timeout 10;

root /usr/share/php/passbolt/webroot;
index index.php;
error_log /var/log/nginx/passbolt-error.log info;
access_log /var/log/nginx/passbolt-access.log;

Managed by Passbolt

include PASSBOLT_SSL

location / {
try_files $uri $uri/ /index.php?$args;
}

location ~ .php$ {
try_files $uri =404;
include fastcgi_params;
fastcgi_pass unix:/run/php/php8.1-fpm.sock;
fastcgi_index index.php;
fastcgi_intercept_errors on;
fastcgi_split_path_info ^(.+.php)(.+)$;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param SERVER_NAME $http_host;
fastcgi_param PHP_VALUE “upload_max_filesize=5M \n post_max_size=5M”;
}

@clayton I am running Debian 11 on a cloud server.

Lauren

what steps did you take for removal of 7.4 and installing 8.1?

One way around this if you just want to get back up and running is to migrate to a new server

From what you’ve described you should still have access to the parts you need to spin up a new one with your data

mysql will not run either.
So I have screwed this server I think.

I have a snapshot from a couple of weeks ago. so I am restoring my server to that and will work on this again once that is done.

Thanks for the help.

Lauren

So I restored from a snapshot from 14 Apr.
I had moved the mariaDB data to block storage, so the passboltdb was on the block storage and not the internal storage. It did not get over written whit the snapshot restore .

Pointed mairadb to the data files on the block storage and restarted nginx and now I have access to passbolt again and have all my data without having to migrate it.

So PHP is important, if you remove it you will break everything on your server. Just don’t do that.

Lauren

If you try it again, install php8.1 first without uninstalling php7.4. The default php version will change to 8.1 and 7.4 files could be uninstalled afterwards.

Good thing you had a backup!

To check the current version of command-line PHP, run

php --version

To set PHP#.# as the system default PHP version, run the following command

sudo update-alternatives --config php