PHP connection with PDO/MySQLi prompting driver/class not found error

Anonymous
HOBBYOP

a month ago

Hi, I'm new into this and I have been trying to deploy one of my websites to Railways with it's MySQLi database. Deployment is successful but once I try to test the web app and interact with the database, the 500 error page appears. In the Railway logs, these errors are given:

PDO:
PHP Fatal error: Uncaught PDOException: could not find driver in /app/includes/dbh.inc.php:8

MySQLi:

PHP Fatal error: Uncaught Error: Class "mysqli" not found in /app/includes/dbh.inc.php:5

I have tried multiple ways of connecting to database, mysqli_connect(), new mysqli() and new PDO() but all of them aren't working. When tested on localhost it works fine so I'm unsure what could be the issue?

Solved$10 Bounty

1 Replies

a month ago

This thread has been marked as public for community involvement, as it does not contain any sensitive or personal information. Any further activity in this thread will be visible to everyone.

Status changed to Open itsrems about 1 month ago


Anonymous
HOBBYOP

a month ago

issue can be marked as resolved, i was missing compose.json config file for deployment, now its working as intended


Status changed to Solved noahd about 1 month ago


Loading...
PHP connection with PDO/MySQLi prompting driver/class not found error - Railway Help Station