0
votes

After I uploaded my php files to the server, I received a message...

PDOException Object ( [message:protected] => could not find driver

I know there is a solution.

Just add "extension=pdo.so" and "extension=pdo_mysql.so" in php.ini

but I am not permitted to change php.ini or to access the Linux server, which really distressed me.

Is there a solution to install pdo_mysql in my php files? (not php.ini )

I just need my files to be enabled to use PDO.

And the version is PHP Version 5.5.38

Server API: Apache 2.0 Handler

Thank you.

1
There is secure.php.net/dl but it's likely blocked or removed from your version of PHP.Cobra_Fast
Possible duplicate of Load extension dynamicallyCobra_Fast

1 Answers

0
votes

use dl.

dl('/path/to/pdo_mysql.so');

but be warned that dl is disabled in many php environments (like shared hosting providers, apache's mod_php, the enable_dl php.ini directive, and php-fpm - edit: dl was disabled in php-fpm at 7.0, but should work in 5.5)