php - Debian - Apache MySQL PDO issue but all logs are empty
one text
Solution:
Make sure PDO is configured to throw errors, otherwise SQL queries may fail silently and you'll see nothing in your logs.
Add this to your code just after you create the connection (in this example $conn is a variable created from the PDO constructor (e.g. $conn = new PDO(... etc.).
$conn->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
Once this is configured, SQL errors resulting from a PDO command will be thrown as PHP exceptions. If PHP's normal error logging is configured correctly, these errors will then appear in your PHP error_log file.
Documentation: https://www.php.net/manual/en/pdo.error-handling.php
Source