Page 1 of 1

Bizzare IMAP - PHP problem

Posted: Sat Nov 19, 2005 8:13 pm
by MilchstrabeStern
Alright guys, I've been faced with a bizzare PHP problem for a couple days now.

A few days ago I was learning about imap functions to send my e-mail to a php script. I was able to connect and read e-mails using a simple script I made. However, the next day not only did the script no longer work, it told me it didn't exist. I'll click on the file on my server, and in Firefox it doesn't load and in IE it says that "The page does not exist" error or whatever.

So I created more, and more scripts, each different, simple, but they all should have worked. They all get teh same problem. However, if I take the imap functions out, they will load and work.

I know imap is installed because I created a function that checked it.

here is a very very simple imap_open script, but it wont aknowledge its existance.

Code: Select all

<?php 
    print imap_open("{mail.mplionhearts.com:143}INBOX", "mplionhe", "---"); 
?>
See for yourself:

http://www.mplionhearts.com/phptesting/imaptest5.php

you can then go back to


http://www.mplionhearts.com/phptesting/

and check all the imap scripts.

Posted: Sat Nov 19, 2005 8:56 pm
by John Cartwright
Might help to post OS, Server Version, PHP version as well as a live phpinfo();
If you do not want to disclose the location of you phpinfo() to the public please PM it to me

Posted: Sat Nov 19, 2005 9:22 pm
by MilchstrabeStern
PMed!

Posted: Sat Nov 19, 2005 9:24 pm
by redmonkey
Have you tried something like...

Code: Select all

<?php
$conn = imap_open("{mail.mplionhearts.com:143}INBOX", "mplionhe", "---") or die ("Failed to connect, imap server said: ".imap_last_error());
?>
Also, if the imap server is on the same machine, try localhost:143

Posted: Sat Nov 19, 2005 9:45 pm
by MilchstrabeStern
It's not a connection problem. I tried your scripts red, here you go:

http://www.mplionhearts.com/phptesting/imaptest6.php

Posted: Sat Nov 19, 2005 9:52 pm
by redmonkey
May be stating the obvious but have you noticed that some of your scripts are imapTest while others are impatest ?

Unclear what is expected behaviour here. How much output is expected from these scripts? I know *some* version of IE will bork if they don't recieve at least 4096 bytes of data (not sure if it also shows 'Page Cannot be found' tho).

Posted: Sat Nov 19, 2005 9:55 pm
by MilchstrabeStern
well

On thes scripts programmed to display everything in my inbox, a lot. However, I got scripts to work that only displayed the number of e-mails in my inbox.

Also it doesn't function in IE or Firefox....


I am totally confused,

Posted: Sat Nov 19, 2005 10:13 pm
by redmonkey
I had a *very quick* google round, there are some things which suggest that both sizes of inboxs and things like number of recipients in mail headers can lead to the problems you are describing, however I'm not sure if a script with a single call to imap_open would even go near the inbox?

It may be worth googling round more in depth. Essentially it seems that calls to imap functions are causing premature exit from the script, but without direct access to your machine and scripts etc.. I don't think there is much else I can suggest.

You could also try looking at your apache and PHP error logs, but again from my quick google round, it seems that a lot of errors in these cases don't actually make it into the error logs.

Posted: Sat Nov 19, 2005 10:58 pm
by MilchstrabeStern
Well, I'm assuming it's a server related issue now.

Thus, I've e-mailed my customer support for my host, hoping I can recieve some help.