From: [EMAIL PROTECTED] Operating system: CentOS 4 PHP version: 5CVS-2006-07-19 (CVS) PHP Bug Type: Feature/Change Request Bug description: mysqli_real_connect
Description: ------------ Hi, the mysql client libs allow using a user specified "my.cnf". Such a configfile can already be set with mysqli_options and MYSQLI_READ_DEFAULT_FILE. The configfile can contain a password for connections. Such a password is only read, if the password-parameter to the mysql_real_connect c-function is NULL. Passing NULL as password to mysqli_real_connect gets converted to an empty string during zend_parse_method_parameters, so the configfile is not used for a password. At http://www.phpschlampe.de/mysqli.patch is a tiny patch to allow NULL-values for the password. This patch is against 5.2. After patching the following works: <?php $mysqli = mysqli_init(); mysqli_options($mysqli,MYSQLI_READ_DEFAULT_FILE,"/path/to/.my.cnf"); /*pass NULL as user/pass so that the values in the config-file are used*/ mysqli_real_connect($mysqli,"foo.bar.de",NULL,NULL); ?> -- Edit bug report at http://bugs.php.net/?id=38144&edit=1 -- Try a CVS snapshot (PHP 4.4): http://bugs.php.net/fix.php?id=38144&r=trysnapshot44 Try a CVS snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=38144&r=trysnapshot52 Try a CVS snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=38144&r=trysnapshot60 Fixed in CVS: http://bugs.php.net/fix.php?id=38144&r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=38144&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=38144&r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=38144&r=needscript Try newer version: http://bugs.php.net/fix.php?id=38144&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=38144&r=support Expected behavior: http://bugs.php.net/fix.php?id=38144&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=38144&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=38144&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=38144&r=globals PHP 3 support discontinued: http://bugs.php.net/fix.php?id=38144&r=php3 Daylight Savings: http://bugs.php.net/fix.php?id=38144&r=dst IIS Stability: http://bugs.php.net/fix.php?id=38144&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=38144&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=38144&r=float No Zend Extensions: http://bugs.php.net/fix.php?id=38144&r=nozend MySQL Configuration Error: http://bugs.php.net/fix.php?id=38144&r=mysqlcfg