I encountered a problem on a Linux Ubuntu server running Plesk 18.0.60 while upgrading the PHP version.
The server runs a PostgreSQL 14 server (ONLY version 14 and ONLY one server) and had installed PHP 8.1.
php -v
(SSH Terminal) returned version 8.1
.
After preparing my Web application for upgrading the PHP version to 8.3 in production, i installed the new PHP version via the Plesk installer and additionally executed the following command inside the SSH Terminal:
sudo apt install plesk-php83-dev make gcc
I pressed Y
to continue with the full installation process after i was asked to.The installation ran without problems and lead to the global PHP command being replaced by the newer version
php -v
returned version 8.3
as intended.
At that point, the PostgreSQL server stopped accepting any connections.
I noticed this when my application spit errors about being unable to establish connectionSQLSTATE[08006] [7] connection to server at "127.0.0.1", port 5432 failed: Connection refused. Is the server running on that host and accepting TCP/IP connections?
What i observed
Running the command
psql
returned the following:
psql: could not connect to server: No such file or directory Is the server running locally and accepting connections on Unix domain socket "/var/run/postgresql/.s.PGSQL.5432"
Running the command
pg_lsclusters
in Shell showed an offline (down)
cluster with version: 14
and name: main
Running the command sudo systemct1 status postgresql.service
showed an Active (exited)
connection.I then tried to restart the service with sudo service postgresql restart
, but it changed nothing.
I then looked at the log file with
nano /var/log/postgresql/postgresql-14-main.log
It only showed
LOG: received fast shutdown requestLOG: aborting any active transactionsLOG: background worker "logical replica>LOG: shutting downLOG: database system is shut down
with the shutdown happening exactly when i installed PHP 8.3 in Shell.