Go Back   HostGator Peer Support Forums > General Discussion > Webhosting

Notices

Reply
 
Thread Tools
  #1  
Old 04-25-2006, 09:52 AM
jeff_s jeff_s is offline
Baby Croc
 
Join Date: Feb 2005
Posts: 69
Default php imap functions

Has anybody ever written a php script that does an imap_open() call on these cPanel shared servers? Mine fails miserably. What is the correct syntax for the "mailbox", and "user" arguments on cPanel shared servers?

I have tried:
Code:
$mbox = imap_open("{localhost}","user@host.com", "password");
$mbox = imap_open("{localhost}INBOX","user@host.com", "password");
$mbox = imap_open("{host.com:143}INBOX","user@host.com", "password");
But the script just blows up completely (browser says DNS error!) if I include any of these calls. If I comment out the imap_open() call, the script does run from beginning to end.
Reply With Quote
  #2  
Old 04-25-2006, 06:46 PM
Serra's Avatar
Serra Serra is offline
Veteran Croc
 
Join Date: Feb 2005
Location: Orange Park, FL
Posts: 5,073
Default Re: php imap functions

I get:

Fatal error: Call to undefined function: imap_open() in /home/magican2/public_html/link/imap.php on line 11

Odd...
__________________
Six stages of Dedi Ownership

Fashionable broken link
image included
Reply With Quote
  #3  
Old 04-25-2006, 07:50 PM
jeff_s jeff_s is offline
Baby Croc
 
Join Date: Feb 2005
Posts: 69
Default Re: php imap functions

Serra, I think the issue on your (dedicated) server is different than mine (on a reseller box). I believe yours may be that your php is not compiled or configured for imap support.

If I call phpinfo(), I see:
-----------------------
Configure Command './configure' '--with-apxs=/usr/local/apache/bin/apxs' '--prefix=/usr/local' '--with-xml' '--enable-bcmath' '--enable-calendar' '--with-curl' '--with-dom' '--with-dom-xslt' '--with-dom-exslt' '--enable-exif' '--enable-ftp' '--with-gd' '--with-jpeg-dir=/usr/local' '--with-png-dir=/usr' '--with-xpm-dir=/usr/X11R6' '--with-gettext' '--with-imap' '--with-imap-ssl' '--with-kerberos' '--enable-mbstring' '--enable-mbstr-enc-trans' '--enable-mbregex' '--with-mcrypt' '--with-mhash' '--with-ming=../ming-0.2a' '--enable-magic-quotes' '--with-mysql=/usr' '--with-openssl' '--enable-discard-path' '--with-pear' '--with-pspell' '--enable-xslt' '--with-xslt-sablot' '--enable-sockets' '--enable-track-vars' '--with-ttf' '--with-freetype-dir=/usr' '--enable-gd-native-ttf' '--enable-versioning' '--enable-wddx' '--with-xmlrpc' '--with-zip' '--with-zlib'
--------------------------
imap

IMAP c-Client Version 2001 SSL Support enabled Kerberos Support enabled
-----------------------------

So it looks like my php is configured for imap support. I found some posts on WHT that imply that the "no response" I'm getting can result from the imap server login timing out due to wrong parameters to imap_open()

I found lots of recipes in the WHT posts showing the "right" way, but none have worked for me.
Reply With Quote
  #4  
Old 04-26-2006, 09:16 AM
Serra's Avatar
Serra Serra is offline
Veteran Croc
 
Join Date: Feb 2005
Location: Orange Park, FL
Posts: 5,073
Default Re: php imap functions

Correct, I just checked, Imap is not supported on my box. I do have mod_imap for email, but php isn't configured for imap. Bummer.
__________________
Six stages of Dedi Ownership

Fashionable broken link
image included
Reply With Quote
  #5  
Old 04-26-2006, 09:24 AM
jeff_s jeff_s is offline
Baby Croc
 
Join Date: Feb 2005
Posts: 69
Default Re: php imap functions

Well, it didn't work yesterday, but today it works fine!! Maybe the server or some service got rebooted?

It works fine with this syntax, but it is slower.
PHP Code:
$mbox imap_open("{localhost}","user@host.com""password"); 
</DIV>
If you eliminate the name lookups, it works MUCH faster.
PHP Code:
$mbox imap_open("{nn.nn.nn.nn:143}","user@host.com""password"); 
Reply With Quote
Reply

Bookmarks

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

All times are GMT -5. The time now is 10:08 PM.