PHP causes IMAP problem

Whether you are using Linux on the desktop or as a server, it's still good that you're using Linux. Linux related questions go here.

Moderator: General Moderators

Post Reply
grey_juce
Forum Newbie
Posts: 6
Joined: Wed Aug 10, 2005 8:13 pm

PHP causes IMAP problem

Post by grey_juce »

We are trying to build mail server.
Right now project in development and can be viewed at:
http://mail.photorain.com

We had PHP programmer working on this project. But seems we're running into one problem after another and not be able to solve it ourselves.

Our PHP connection script doesn't connect to IMAP server.

Considering bringing somebody into troubleshooting process.

Required knowledge of PHP (application written in PHP) and good practical knowledge of Linux administration. Possible needs to re-compile PHP. Quite likely, one of PHP's library causing problem.

What’s specifically wrong, when we run PHP connecting script to connect to IMAP server, for some unknown reason process calls SSL. And as SSL not installed, it give an error. But why it calls SSL in a first place, which is not suppose to – that is a big question!
timvw
DevNet Master
Posts: 4897
Joined: Mon Jan 19, 2004 11:11 pm
Location: Leuven, Belgium

Post by timvw »

Where/how did you get the imap extension? My guess is that php was compiled --with-imap-ssl=/path/to/openssl/
grey_juce
Forum Newbie
Posts: 6
Joined: Wed Aug 10, 2005 8:13 pm

How practically fix it

Post by grey_juce »

Where/how did you get the imap extension? My guess is that php was compiled --with-imap-ssl=/path/to/openssl/
------------------------------------------------

Interesting thing, when we got new server - it worked for without errors. But after a while, it began producing error.

So we requested to re-instal server OS and a packages.
It's been done. We uploaded scripts, and everything waqs working fine. And again after a while IMAP began givng same problem.

So we are on a second cirle at the sme spot. Difference, at first we had PHP version 4 something. Now we have 5.0.4 (I think) -- the same problem.
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

erroneously posted by grey_juce wrote:Having problem connecting to IMAP server from PHP scripts.
Example
http://mail.photorain.com/test.php
... in a broser, after some waiting time (30 - 50 sec) .. giving this error:


Warning: imap_open() [function.imap-open]: Couldn't open stream {localhost:143/notls}INBOX in /home/photorain/wwwroot/photorain.com/test.php on line 9
[CLOSED] IMAP connection broken (server response)

Can use some help ti solve this ...


Sergei
grey_juce
Forum Newbie
Posts: 6
Joined: Wed Aug 10, 2005 8:13 pm

Re: How practically fix it

Post by grey_juce »

[quote="grey_juce"]Where/how did you get the imap extension? My guess is that php was compiled --with-imap-ssl=/path/to/openssl/
------------------------------------------------

IMAP extensions ca,e with Linux OS.

Does any one know how to fix it?
grey_juce
Forum Newbie
Posts: 6
Joined: Wed Aug 10, 2005 8:13 pm

still IMAP problem

Post by grey_juce »

Still having problem and asking for help .. please, please, please !!!
We even willing to hire a right person to solve this problem.

1) on this server:
phpinfo ();
http://mail.photorain.com/phpinfo.php
... this test script doesn't work
http://mail.photorain.com/test.php

2) on this server
phpinfo();
http://www.fligel.com/info.php
... the same IMAP connecting script - working fine
http://www.fligel.com/test.php

On both servers same PHP version with same extensions set
timvw
DevNet Master
Posts: 4897
Joined: Mon Jan 19, 2004 11:11 pm
Location: Leuven, Belgium

Post by timvw »

Does the IMAP server allow access from both hosts? (It appears you are connecting to localhost, so you would need an imap server on both hosts running...) Is there a firewall blocking tcp/ip connections?
grey_juce
Forum Newbie
Posts: 6
Joined: Wed Aug 10, 2005 8:13 pm

Post by grey_juce »

No, there is no firewall blocking.

On this troubled server we even requested to reinstall OS.
After reinstallation IMAP connection worked for a day or two and after a while began producing the same as was before errors.

Company I host servers with trying to help, but they don't know exactly what causing this problem.
At first we thought this is a PHP extensions like "timvw" mentioned previously "My guess is that php was compiled --with-imap-ssl=/path/to/openssl/"
.. it still possibilities.

But looking and comparing two servers, looks like PHP versions are identical with same extensions sets. On one machine IMAP connection works, on another doesn't.

Still unsolved mistery!!
grey_juce
Forum Newbie
Posts: 6
Joined: Wed Aug 10, 2005 8:13 pm

Post by grey_juce »

Another fact ...
While connecting via SSH, we tried both, port 143 (without SSL) and 993 (with encryption) - both work fine.

Start thinking, may it Apache version 1.3 ???
timvw
DevNet Master
Posts: 4897
Joined: Mon Jan 19, 2004 11:11 pm
Location: Leuven, Belgium

Post by timvw »

But you need an imap on both servers.. (As your script is connecting on localhost).

Anyway, time to tail your error.log and imapd.log files ;)
Post Reply