I would like to know how can I activate PDO using a php script on the server.
I have done a whole project using PDO, and when moving it to the server, I noticed that PDO is not unable there.
Thanks
I would like to know how can I activate PDO using a php script on the server.
I have done a whole project using PDO, and when moving it to the server, I noticed that PDO is not unable there.
Thanks
You can check if PDO is enabled by your provider by using the extension_loaded function:
if ( extension_loaded('pdo') ) {
echo "PDO enabled";
} else {
echo "PDO not enabled";
}
You might also want to check for the database-specific PDO driver using:
if ( extension_loaded('pdo_<database type here>') ) { // e.g., pdo_mysql
echo "PDO mysql enabled";
} else {
echo "PDO mysql enabled";
}
If it is not enabled, you must contact your provider and ask if it can be enabled.
You might also try to load the PDO extension using PHP's dl()
function, but it's unlikely to work if your provider even disabled PDO.