Link to home
Create AccountLog in
Avatar of Victor Kimura
Victor KimuraFlag for Canada

asked on

Uncaught exception 'PDOException' with message 'could not find driver'

Error message:
Failed: could not find driver<font color=ff0000><br />
<b>Fatal error</b>:  Uncaught exception 'PDOException' with message 'could not find driver' in C:\Program Files\Apache Software Foundation\Apache2.2\htdocs\test\trunk\code\registration\register_7.php:722

I'm not quite certain why this message keeps coming up. I have the PDO installed for mysql. I checked with this function: print_r(PDO::getAvailableDrivers());

I also have mysql running. I ran phpinfo();

I'm using Zend Studio Pro 5.5. I never noticed this error before. Anyone have a clue?

Thanks,
Victor
Avatar of ncoo
ncoo

Check your php.ini have you got extension=pdo.so uncommented

Should be:

extension=pdo.so

and not

;extension=pdo.so
You are using windows so ignore the first comment, enable the following in php.ini

extension=php_pdo.dll
extension=php_pdo_mysql.dll

You can find the location of php.ini by using phpinfo(); look at Loaded Configuration File.
Avatar of Victor Kimura

ASKER

Hi ncoo,

They were enabled.

Here is the full error message. I'm working locally and I tested the pdo as it works fine but when I use the Zend Studio Pro 5.5 debugger I receive this message. It's odd.

Status: 500
X-Powered-By: PHP/5.2.4
Content-type: text/html

Failed: could not find driver<font color=ff0000><br />
<b>Fatal error</b>:  Uncaught exception 'PDOException' with message 'could not find driver' in C:\Program Files\Apache Software Foundation\Apache2.2\htdocs\test\trunk\code\registration\register_7.php:723
Stack trace:
#0 C:\Program Files\Apache Software Foundation\Apache2.2\htdocs\test\trunk\code\registration\register_7.php(723): PDO->__construct('mysql:dbname=ho...', 'root', 'htmys2007')
#1 C:\Program Files\Zend\ZendStudio-5.5.0\bin\php5\dummy.php(1): include('C:\Program File...')
#2 {main}
  thrown in <b>C:\Program Files\Apache Software Foundation\Apache2.2\htdocs\test\trunk\code\registration\register_7.php</b> on line <b>723</b><br />
</font>
When you disable the Zend debugger in php.ini does it work? In which case it's a compatibility issue.
Hi ncoo,

It works normally and data is retrieved properly when I'm debugging. So do you mean then that the Zend debugger is not compatible? If so, what is there different debugger versions for Zend Studio Pro 5.5? If there are different Zend debugger versions then where can I download a compatible version. I don't believe I've seen different debugger versions on the Zend website.

It's strange because I don't think this occurred before. I believe the only recent change I made was changing the preferences section to debug on a server but I didn't have Zend Platform installed so I had to revert back to local. I made all the necessary changes or so I think I did to debug locally again.

ASKER CERTIFIED SOLUTION
Avatar of ncoo
ncoo

Link to home
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
See answer
The problem when using the Zend Debugger is that it does not have the php_pdo_mysql.dll loaded. The php.ini ou need to modify is
%PROGRAMFILES%\ZendStudio*\bin\php5\php.ini
With those modifications my ZendDebugger works and has pdo with mysql and sqlite support.
Hi hernst42,

I have it commented out and I still receive this error. I'm beginning to wonder if this is a Zend bug.

I'm also thinking of simply using Eclipse and move away from Zend. I do like Zend but it's difficult to resolve this particular error.
Hm works perfect on my ZendStudio. We don't use eclipse/ZendStudio 6.0 because debugging is awful slow with that tool.
I am certain it's a compatibility isssue did you manage to contact Zend?

Hernst42 there could be any number of differences between your setup and vkimura2007. I agree with zend eclipse being a machine hog though.
Hi ncoo,

Sorry about this extremely tardy response and allocation of credits. I forgot about this and it actually is still an oustanding issue. If I ever get this resolved I'll try and post it for someone. Perhaps, I'll try and install it on my mother's mac ox 10.4 and see if I get any errors. It'll be awhile before I can do this since I'm super busy these days. Thank you for your help though.

Cordially,
Victor