0

I have a CentOs 6.7 server. I have problem to make pdo_mysql available on apache2. following shows for Command line:

myserver$ php -m PDO, pdo_mysql, pdo_sqlite 

but phpinfo(), shows only PDO and pdo_sqlite

I already included following in php.ini

extension=pdo_mysql.so extension=pdo.so 

And restarted the Apache with: sudo service httpd restart

It looks like, pdo_mysql is installed on a different php. when I search the server for pdo.so and pdo_mysql.so, I get pdo.so in three places, but pdo_mysql in two places.

myserver$ locate pdo.so /usr/lib64/php/modules/pdo.so /usr/lib64/php-zts/modules/pdo.so /var/opt/remi/php56/root/usr/lib64/php/modules/pdo.so myserver$ locate pdo_mysql.so /usr/lib64/php/modules/pdo_mysql.so /usr/lib64/php-zts/modules/pdo_mysql.so 

And Apache installation in phpinfo() shows: Loaded Configuration File /opt/remi/php56/root/etc/php.ini

So my recent php upgrade to php 5.6 is missing pdo_mysql. other php installation has it, but I don't know how to force the pdo_mysql installation to install it to /var/opt/remi/php56/

I used following for installing pdo-mysql:

yum install pdo-mysql 

So, it installed it under, /usr/lib64/php/, but not under,/var/opt/remi/php56/ Any help or advice is appreciated

3
  • this is better suited for serverfault.com Commented Mar 15, 2016 at 18:20
  • there's 2 .ini files: command line and SAPI. php -i only loads the cli config, and most likely your SAPI (in-webserver) config does NOT have pdo loaded. php -i/phpinfo will both tell you which .ini file(s) were loaded. make sure to check that. Commented Mar 15, 2016 at 18:22
  • I have two .ini files. /opt/remi/php56/root/etc/php.ini and /etc/php.ini I edited both and added pdo_mysql.so to both. and still no luck. I also tryed extension_dir changed to /usr/lib64/php/modules/ and still no luck!! Commented Mar 15, 2016 at 18:56

2 Answers 2

1

It seems you are confused by the 2 available PHP stacks in remi repository.

  • php-* packages = base packages with configuration in /etc
  • php56-php-* packages = software collections for parallel installation with configuration in /opt

Also see the FAQ

And Apache installation in phpinfo() shows: Loaded Configuration File /opt/remi/php56/root/etc/php.ini

This means you are using the SCL version. So you need php56-php-mysqlnd

I already included following in php.ini

You never have to change the php.ini, each package provides its configuration file which enable the extension (and ensure correct load order, e.g. pdo "before" pdo_mysql)

I recommend you follow the Configuration Wizard results

Sign up to request clarification or add additional context in comments.

1 Comment

thank you for your response. Those documentations are very helpful for understanding Remi better.
1

Ok, I finally found the solution to the problem. I was trying to install missing pdo_msyql extension, but yum was saying the package is not available. Then by installing following the problem was solved.

yum install php-ZendFramework-Db-Adapter-Pdo-Mysql.noarch 

Thanks everyone for your helps.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.