|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2010-06-11 20:31 UTC] deuce at gt dot rr dot com
Description:
------------
When a specific database module is not installed and a PDO object of this type is
called you receive an error reporting that PDO does not exist.
Test script:
---------------
<?php
$hostname = ""; // host
$dbname = ""; // db name
$username = ""; // username like 'sa'
$pw = ""; // password for the user
try {
$dbh = new PDO ("mssql:host={$hostname};dbname={$dbname}", $username, $pw);
} catch (PDOException $e) {
echo "Failed to get DB handle: {$e->getMessage()} \n";
exit;
}
?>
Expected result:
----------------
Failed to get DB handle: could not find driver
Failed to get DB handle: could not find module
etc.
Actual result:
--------------
PHP Fatal error: Class 'PDO' not found in /home/../login.php on line 10
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Mon Nov 03 01:00:01 2025 UTC |
If you change the value to a module that is loaded on the server, in this case mysql, it goes through as expected. $dbh = new PDO ("mysql:host={$hostname};dbname={$dbname}", $username, $pw); works just fine. I do not have direct control of these machines, and at this point I believe it was a default server configuration error which the host has now corrected. That is all I know, if you wish to try and figure out as to why or how contacting site5 LLC would be the quickest solution. Beau and/or Graham are two higher ups that are familiar with the issue.