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

2 months 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

itsrems
EMPLOYEE

2 months 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 2 months ago


Anonymous
HOBBYOP

2 months 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 2 months ago


Loading...