Click to See Complete Forum and Search --> : PDO - MYSQL not working


infolock
05-13-2008, 05:16 PM
Hello all. I've been using PHP for about 6 years now and have run into an issue I cannot solve.


Basically, I'm trying to install PDO with MySQL support on a RedHat server.

I ran the following commands:
pecl install pdo
pecl install pdo_mysql

I edited the php.ini file and added the following 2 lines:
extension=pdo.so
extension=pdo_mysql.so

I rebooted Apache. It shows PDO installed, but ONLY with the sqlite2 and sqlite extensions installed!!!

I then tried uninstalling pdo_mysql and running this command:
PHP_PDO_SHARED=1 pecl install pdo_mysql

rebooted Apache and the SAME PROBLEM!!!

I cannot for the life of me figure out how to fix this issue. Has anyone else had this issue? It works fine for FreeBSD but for whatever reason I can't get it to work on RedHat.

Also, why is it that SQLite is installed?? I can't find it anywhere in the php.ini file as being an installed extension, and yet PDO is using it's driver by default and completely ignoring my extension.


here is what it shows in phpinfo():

PDO
PDO support enabled
PDO drivers sqlite2, sqlite

pdo_sqlite
PDO Driver for SQLite 3.x enabled
PECL Module version (bundled) 1.0.1 $Id: pdo_sqlite.c,v 1.10.2.6.2.2 2007/03/23 14:30:00 wez Exp $
SQLite Library 3.3.17

laserlight
05-13-2008, 11:55 PM
Also, why is it that SQLite is installed?? I can't find it anywhere in the php.ini file as being an installed extension, and yet PDO is using it's driver by default and completely ignoring my extension.
PDO and PDO_SQLITE are bundled with PHP 5.1+. However, you obviously should be able to have more than one PDO driver installed, so this should not be the problem.

infolock
05-14-2008, 10:53 AM
Yes, I understand that PDO_SQLITE is bundled with PHP 5.1. but that doesn't explain why I can't find an option to remove that bundle unless it's hard-coded in. And if that's the case, man, what a waste of memory...

Either way, I know I should be able to have more than one PDO driver, thus kinda why I am where I am. But I talked to the support group at php.net and they say it's an issue with PHP 5.2.3, and that the PECL installer isn't reliable enough to install PDO.

So, I'm gonna upgrade and do a ./configure and we'll see where that leaves me..