|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #52054 Class 'PDO' not found
Submitted: 2010-06-11 20:31 UTC Modified: 2010-06-12 15:59 UTC
Avg. Score:3.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:1 (100.0%)
Same OS:1 (100.0%)
From: deuce at gt dot rr dot com Assigned:
Status: Not a bug Package: PDO related
PHP Version: 5.2.13 OS: linux kernel 2.6.27-grsec4
Private report: No CVE-ID: None
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
Solve the problem:
50 + 8 = ?
Subscribe to this entry?

 [2010-06-11 20:31 UTC] deuce at gt dot rr dot com
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:
	$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";

Expected result:

Failed to get DB handle: could not find driver
Failed to get DB handle: could not find module


Actual result:
PHP Fatal error:  Class 'PDO' not found in /home/../login.php on line 10


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2010-06-12 15:14 UTC]
-Status: Open +Status: Bogus
 [2010-06-12 15:14 UTC]
I got the message: "could not find driver"... PDO seems not be enabled in your instalation.
 [2010-06-12 15:59 UTC] deuce at gt dot rr dot com
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.
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat Jul 20 07:01:28 2024 UTC