Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

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 pdo_mysql.so giving: /usr/lib/php5/20090626+lfs/pdo_mysql.so

locate mysql.so giving :

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

in php ini file I enabled like that:

extension=/usr/lib/php5/20090626+lfs/mysql.so

extension=/usr/lib/php5/20090626+lfs/pdo_mysql.so

But It does not help

Then I enabled

extension=mysql.so
extension=pdo_mysql.so

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?

thanks.

share|improve this question
add comment

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
extension=mysql.so

In conf.d/pdo.ini, I have
extension=pdo.so

In conf.d/pdo_mysql.ini, I have
extension=pdo_mysql.so

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(mysql.so, pdo_mysql.so, ...) 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
add comment

Your Answer

 
discard

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.