Sign up ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free.

I am newbie for ubuntu and I was trying to run lamp.

I installed mysql, and pdo extensions. when i show config(with phpinfo()): Configuration File (php.ini) Path: /etc/php5/apache2

Also I see mysql and pdo_mysql tables in config table.

locate giving: /usr/lib/php5/20090626+lfs/

locate giving :

/usr/lib/perl5/auto/DBD/mysql/ /usr/lib/php5/20090626+lfs/ /usr/lib/php5/20090626+lfs/ /usr/lib/pyshared/python2.7/ /usr/lib/python2.7/dist-packages/

in php ini file I enabled like that:



But It does not help

Then I enabled

still the same, no result,

after any changes I am restarting apache2 with service apache2 restart

But Still php can not locate pdo for opening connection.

So How can I get it work?


share|improve this question

1 Answer 1

up vote 0 down vote accepted

What version of Ubuntu? Are you sure you need to add those lines to php.ini?

I have 10.03 and 11.10, and both are similar in that none of that is in php.ini, but in the directory under that one, called conf.d.

In conf.d/mysql.ini, I have

In conf.d/pdo.ini, I have

In conf.d/pdo_mysql.ini, I have

I don't have the newest version, and I also don't use any special lamp stack, just the standard apps I installed separately, if that makes any difference. But I never had any problems, and never had to explicitly install pdo that I can remember.

share|improve this answer
I found answer. In php.ini we need to point where is the extensions are located. So I wrote in php.ini: extension_dir = "/usr/lib/php5/ext" I created /usr/lib/php5/ext folder then all .so files(,, ...) files i copied to there then restart server with service apache2 restart It worked. So important thing is extension_dir Make sure it is pointing to correct folder which has all .so files. – elbek Aug 11 '12 at 5:07
Well, mine isn't set up like that at all, but I guess as long as it works, that's what matters. Mine just has extension_dir = "./". – Marty Fried Aug 12 '12 at 1:37

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.