Bizzare IMAP - PHP problem

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
MilchstrabeStern
Forum Newbie
Posts: 9
Joined: Sat Nov 19, 2005 8:06 pm

Bizzare IMAP - PHP problem

Post 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.
User avatar
John Cartwright
Site Admin
Posts: 11470
Joined: Tue Dec 23, 2003 2:10 am
Location: Toronto
Contact:

Post 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
MilchstrabeStern
Forum Newbie
Posts: 9
Joined: Sat Nov 19, 2005 8:06 pm

Post by MilchstrabeStern »

PMed!
redmonkey
Forum Regular
Posts: 836
Joined: Thu Dec 18, 2003 3:58 pm

Post 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
MilchstrabeStern
Forum Newbie
Posts: 9
Joined: Sat Nov 19, 2005 8:06 pm

Post by MilchstrabeStern »

It's not a connection problem. I tried your scripts red, here you go:

http://www.mplionhearts.com/phptesting/imaptest6.php
redmonkey
Forum Regular
Posts: 836
Joined: Thu Dec 18, 2003 3:58 pm

Post 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).
MilchstrabeStern
Forum Newbie
Posts: 9
Joined: Sat Nov 19, 2005 8:06 pm

Post 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,
redmonkey
Forum Regular
Posts: 836
Joined: Thu Dec 18, 2003 3:58 pm

Post 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.
MilchstrabeStern
Forum Newbie
Posts: 9
Joined: Sat Nov 19, 2005 8:06 pm

Post 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.
Post Reply