Again: PHP4 and IMAP: Bug?
| From: | mheumann at sei dot cl | Date: | Wed, 23 May 2001 14:05:49 +0000 |
| Subject: | Again: PHP4 and IMAP: Bug? | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-54061@lists.php.net to get a copy of this message | ||
Hi,
I'm growing rather desperate about this issue that's been causing me several sleepless
nights already.
All I want is to be able to use IMAP to access POP3 mailboxes with PHP4 (4..0.5). I had no trouble
compiling both imap and PHP4, and actually I also compiled PHP3 with the same IMAP library. My
little
test script (see below) works fine on PHP3, but on PHP4 I get the following message(s), being the
first
the most relevant one:
Warning: Couldn't open stream {mail.host.tld/pop3:110}INBOX in
/usr/data/htdocs/intranet/mail.php on line
6
Warning: Unable to find stream pointer in /usr/data/htdocs/intranet/mail.php on line 7
Warning: Variable passed to each() is not an array or object in /usr/data/htdocs/intranet/mail.php
on line 8
Warning: Unable to find stream pointer in /usr/data/htdocs/intranet/mail.php on line 10
The code is ok, as far as I can tell (and I'm not a newbie anymore):
<html>
<head><title>Mail Test</title></head>
<body>
<?php
$host = "mail.host.tld/pop3";
$mbox = imap_open ("\{$host:110}INBOX", "test", "test");
$aHeaders = imap_headers( $mbox );
while( list( $Key, $Val ) = each( $aHeaders ) )
echo $Val . "<br>";
imap_close( $mbox );
?>
</body>
</html>
The $host in the imap_open line has already been replaced by the literal string, I have left out the
\ before
the {, everything in vain.
I use apache 1.3.20, PHP 4.0.5, the IMAP snapshot from a couple of days ago and I configured PHP
like
this:
'./configure' '--with-apxs=/usr/sbin/apxs' '--with-gd=yes'
'--with-xpm-dir' '--with-jpeg-dir=/usr/local' '--with-
ttf=/usr/src/freetype-1.3.1' '--with-zlib' '--with-xml'
'--with-ftp' '--with-mcal=../libmcal' '--with-imap' '--with-
sybase=/opt/sybase-11.9.2' '--with-mysql=/usr' '--with-mcrypt=/usr/local'
'--with-mhash' '--with-config-file-
path=/etc/httpd/conf' '--enable-versioning' '--enable-track-vars'
according to phpinfo().
I tried to track down the problem by inserting messages in various PHP and IMAP source code places.
I
couldn't get beyond the call to tcp_open in IMAP's mail_open function. It seems that
this tcp_open is not
being called by PHP4, while PHP3 calls it perfectly. I think maybe the tcp driver is not loaded,
or so.
The pop3 driver seems to be ok.
I really don't know, I'm just speculating here. But what could be the problem? Is there
anything I may
have missed during configure and compile of PHP4 that differs from the PHP3 procedure?
Please, you PHP makers out there, try to help me. I would really appreciate this. If I can't
solve this
problem, I can't port my project to PHP4.
Thanks in advance,
Greetings,
Michael Heumann.
#########################################################
# Michael Heumann
# S&I Chile - Software e Informatica Limitada
# Arlegui 440, Of. 403, Viña del Mar, Chile
# Fonofax: (56)(32) 710833
# Email: mheumann@softwareinformatica.cl
# Web: http://www.softwareinformatica.cl
#########################################################