I found a PHP error in my server log that says:
[02:09:27 UTC] PHP Fatal error: Uncaught exception 'PDOException' with message 'SQLSTATE[HY000]  No such file or directory' in /var/www/include/db_connect.php:7
`#0 /var/www/include/db_connect.php(7): PDO->__construct('mysql:dbname=my...', 'apache', '123...')
Further examination reveals that this error occurs at a time when the server is booting up. The journal log contains the following relevant lines:
02:09:22 systemd: Starting The Apache HTTP Server... 02:09:22 systemd: Starting MariaDB database server... 02:09:22 systemd: Starting The PHP FastCGI Process Manager... 02:09:24 systemd: Started The Apache HTTP Server. 02:09:25 mysqld_safe: Logging to '/var/log/mariadb/mariadb.log'. 02:09:25 mysqld_safe: Starting mysqld daemon with databases from /var/lib/mysql 02:09:25 systemd: Started The PHP FastCGI Process Manager. 02:09:28 NetworkManager: <info> startup complete 02:09:28 systemd: Started MariaDB database server.
Since the PHP error occurs at the 27th second, three seconds after Apache has started, why does PHP complain that it couldn't find the file? In any case, should the starting sequence of Apache, PHP-FPM and MariaDB be reversed so that Apache is the last to get started?