Bug #13716 Updated: Cannot open 'multiple' database connections while running from shell
| From: | sander@php.net | Date: | Wed, 17 Oct 2001 17:57:49 +0000 |
| Subject: | Bug #13716 Updated: Cannot open 'multiple' database connections while running from shell | ||
| References: | 1 | Groups: | php.dev |
| Request: | Send a blank email to php-dev+get-68153@lists.php.net to get a copy of this message | ||
ID: 13716
Updated by: sander
Reported By: chuckc@sonic.net
Old Status: Open
Status: Bogus
Bug Type: MySQL related
Operating System: redhat
PHP Version: 4.0.5
New Comment:
Submitted twice.
Previous Comments:
------------------------------------------------------------------------
[2001-10-17 13:43:39] chuckc@sonic.net
I'm trying to open multiple database connections to a 'non-local' mysql server from
the shell.
It is important to note that this problem only occurs while running from the shell. When running
the same code from the web server, there is no problem.
#!/usr/bin/php
<?php
//connect to database 1
$link_a = mysql_connect ("server", "uname1", "pword1")
or die ("Could not connect to db1n");
print ("Connected to db1 successfullyn");
//connect to database 2
$link_b = mysql_connect ("server", "uname2", "pword2")
or die ("Could not connect to db2n");
print ("Connected to db2 successfullyn");
?>
It does not matter which database you try to connect to first. Regardless, the first connection
succeeds, the second connection fails.
Some output:
Connected to domains successfully
<br>
<b>Warning</b>: MySQL Connection Failed: Can't connect to MySQL server on spiff
(111)
in <b>./qtest.php</b> on line <b>23</b><br>
Could not connect to users db
I compiled PHP like so:
./configure --with-mysql=/opt/mysql --with-gd --prefix=/opt/php-4.0.5
--sysconfdir=/opt/php-4.0.5/etc --with-zlib-dir=/usr/local/ --
with-dom=/usr/local/lib/libxml12.so --with-mcrypt=/usr/local/lib/libmcrypt.so
--with-cybercash=/opt/mck-3.2.0.4-linux --enable-force
-cgi-redirect
Thanks,
chuckc@sonic.net
------------------------------------------------------------------------
Edit this bug report at http://bugs.php.net/?id=13716&edit=1