dreamfactorysoftware / df-core

The DreamFactory Core services and resources.
Apache License 2.0
14 stars 32 forks source link

MySQL Connection::checkRequirements looks for wrong drivers #1

Open dao opened 8 years ago

dao commented 8 years ago

DreamFactory\Core\Database\Mysql\Connection::checkRequirements should not be looking for mysqlnd or mysql extensions. The abstract parent method already correctly checks the pdo_mysql driver.

dao commented 8 years ago

This issue prevented me from adding a mysql db service to DFE. Removing the faulty checkRequirements and relying on the parent method allowed me to add and work with a mysql service as expected.

df-admin commented 8 years ago

What platform are you running on where this is a problem? I have run this on Ubuntu and OS X with no issues. On Nov 5, 2015 7:08 PM, "dylan oliver" notifications@github.com wrote:

This issue prevented me from adding a mysql db service to DFE. Removing the faulty checkRequirements and relying on the parent method allowed me to add and work with a mysql service as expected.

— Reply to this email directly or view it on GitHub https://github.com/dreamfactorysoftware/df-core/issues/1#issuecomment-154239616 .

dao commented 8 years ago

ubuntu 14.04, but it's not about platform. If it works for you, it is because you have not only the (actually used) PDO mysql driver installed, but also one or both of the 'mysqlnd' or 'mysql' drivers which the code I removed is looking for even though they have nothing to do with the functionality of this code.

leehicks commented 8 years ago

It is my understanding that the pdo_mysql is not a standalone library, but requires one of mysql or mysqlnd, as mentioned in the PHP doc installation section. By your statement, you are saying that you have neither of those two installed and the mysql interface works for you? Could you please send me the "php -m" dump of the php that you are running DreamFactory on after removing these checks.

dao commented 8 years ago

Choosing a Library:

The mysqli, PDO_MySQL and mysql PHP extensions are lightweight wrappers on top of a C client library. The extensions can either use the mysqlnd library or the libmysqlclient library. Choosing a library is a compile time decision.

ubuntu% php5-fpm -v
PHP 5.5.9-1ubuntu4.14 (fpm-fcgi) (built: Oct 28 2015 01:38:24)
Copyright (c) 1997-2014 The PHP Group
Zend Engine v2.5.0, Copyright (c) 1998-2014 Zend Technologies
    with Zend OPcache v7.0.3, Copyright (c) 1999-2014, by Zend Technologies
    with Xdebug v2.2.3, Copyright (c) 2002-2013, by Derick Rethans
ubuntu% php5-fpm -i | grep mysql
/etc/php5/fpm/conf.d/20-pdo_mysql.ini,
PDO drivers => mysql, sqlite
pdo_mysql
pdo_mysql.default_socket => /var/run/mysqld/mysqld.sock => /var/run/mysqld/mysqld.sock
ubuntu% php5-fpm -m | grep mysql
pdo_mysql
leehicks commented 8 years ago

Thanks for the additional info. I am curious as to why you are using the libmysqlclient, as that doc you mentioned seems to have a few things that are not supported. We have not tested against that library at this point so you may run into problems that we have not seen. Obviously, we recommend using mysqlnd (primarily because it is easily installed on most of the supported platforms and recommended as per the doc you referenced).

Are you aware of a way to check for that library being used in the code? I will look into checking for that library and dropping the requirement for mysqlnd if noted.