php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #7816 Imap + mysql fails
Submitted: 2000-11-14 12:44 UTC Modified: 2001-02-27 17:28 UTC
From: jlhaase at iland dot net Assigned:
Status: Closed Package: IMAP related
PHP Version: 4.0.3pl1 OS: Linux Redhat 6.2
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: jlhaase at iland dot net
New email:
PHP Version: OS:

 

 [2000-11-14 12:44 UTC] jlhaase at iland dot net
Opening a connection to a mysql database server before opening a connection to an imap server appears to fail.

In a script that I was testing a opened a mysql database to authenticate a user to a RADIUS table before opening an imap connection for the user.  The imap_open function returned something other than false, however subsequent calls to that imap connection would fail.

Specifically doing...

<?
$db_server = "my.db.server";
$db_username = "username";
$db_password = "*****";
$mailbox = "{myimap.server.com:143}INBOX";
$imap_user = "myimapuser";
$imap_password = "myimappassword";

$mysql_connection = mysql_open($db_server, $db_username, $db_password);

$mbox = imap_open($mailbox, $imap_user, $imap_password);
   || die("imap didn't work: " . imap_last_error());

echo "This is my imap stream: " . $mbox . "<br>";
if (imap_ping($mbox))
{
   echo "Imap is alive!<br>";
}
else
{
   echo "Imap is dead!<br>";
}
?>

Will always result in an output of 
This is my imap stream: 1 (or some other number)
Imap is dead!

However simply reversing the order of the mysql_open and imap_open statements so that you open the imap connection first seems to allow both imap and mysql to function correctly.

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2001-02-27 17:28 UTC] sniper@php.net
||?--> OR


 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Tue Apr 23 18:01:34 2024 UTC