D
D
Denis2014-05-18 22:21:01
PHP
Denis, 2014-05-18 22:21:01

How to install PDO on Mac OSX 10.9.2?

Installed php, mysql, apache via mac ports, everything works. When trying to make migrations to yii 1.x, I got an error:

exception 'CDbException' with message 'CDbConnection failed to open the DB connection: could not find driver' in /Users/den-shapkin/Sites/www/yii/framework/db/CDbConnection.php:382

After a little poking around, the problem was defined as the lack of installed PDO, in php.ini extension=pdo.so extension=pdo_mysql.so is missing.
When outputting phpinfo() via terminal:
PDO

PDO support => enabled
PDO drivers =>

But, when outputting phpinfo() in an index file, viewed through a browser, the following picture:
screen.png

Answer the question

In order to leave comments, you need to log in

3 answer(s)
I
Ivan, 2014-05-18
@0neS

>> When trying to make migrations to yii
Does everything else work? Or does this error only occur in migrations?
At the same time, show what $ php -m produces

D
Denis, 2014-05-19
@sch_den

[PHP Modules]
bcmath
bz2
Core
ctype
date
dom
ereg
fileinfo
filter
hash
json
libxml
mhash
mysqlnd
pcre
PDO
Phar
readline
Reflection
session
SimpleXML
SPL
standard
tokenizer
xml
xmlreader
xmlwriter
zlib

[Zend Modules]

Yes, PDO is present there, does that mean it is active and working?

V
Vik411, 2014-10-20
@Vik411

I had the same problem.
The default extension_dir was set to an incorrect address.
Corrected, now everything works as it should work.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question