localhost and 127.0.01 - weird behaviour
I use in my php scripts configuration files 'localhost' to get connected to the database. Works fine.
But the in same script > mail settings > I can not use 'localhost' to sent email. Getting this error:
0.66544400 1379291101 15-09-2013 19:25:01 (3)Mailer - [pear_error: message="unable to connect to smtp server localhost:25" code=0 mode=return level=notice prefix="" info="">
If I change 'localhost' to '127.0.01' in mail settings, it works. Email will be sent?
I didn't change any whm/cpanel settings. Anybody throw some light on this?
thank you!
-
It is one and the same you can either use localhost or loop back IP address that is 127.0.0.1 for your mail sending script. So not sure if this change will work for you. I would better suggest you to check why your server is not able to connect to port 25 through loop back port. 0 -
Hello :) Yes, I have seen this behavior before. It typically happens because the /etc/hosts file is not available to the account. Thus, connections to 'localhost' (which can't resolve to 127.0.0.1) will fail. Using 127.0.0.1 is a valid workaround to this issue. Thank you. 0 -
[QUOTE]It typically happens because the /etc/hosts file is not available to the account.
1. It supposed to be available to the user account by default? 2. What I need to tell the host to fix this? thank you.0 -
You can direct your web hosting provider to the following URL: Custom JailedShell Mounts One additional workaround has been to add /etc/hosts to a file that is sourced such as: /var/cpanel/exim.conf.deps Thank you. 0 -
[QUOTE]/var/cpanel/exim.conf.deps
My host went with this option. But my questions: Can this settings can be done thru WHM? If yes, how? With each cpanel update, this seting will be over written? thank you!0 -
[quote="hetch, post: 1463202">My host went with this option. But my questions: Can this settings can be done thru WHM? If yes, how? With each cpanel update, this seting will be over written?
The setting can not be modified via Web Host Manager, and should not be overwritten during cPanel updates. Could you confirm if that modification resolved the issue? Thank you.0 -
[QUOTE]Could you confirm if that modification resolved the issue?
Yes. '/var/cpanel/exim.conf.deps' resolved the issue. I am able to use localhost again. Thank you.0
Please sign in to leave a comment.
Comments
7 comments