Sendmail fail using php

Issues related to applications and software problems
Post Reply
User avatar
sovichea_cheth
Posts: 4
Joined: 2013/11/08 01:15:49
Location: Phnom Penh
Contact:

Sendmail fail using php

Post by sovichea_cheth » 2013/11/08 01:30:06

Hello guys,

I'm new to CentOS, so please excuse me.
I'm writing some php scripts to send mail report. This work good last day, but since yesterday it cannot send email report.
This is what I get when I run php script:

Code: Select all

sendmail: fatal: parameter inet_interfaces: no local interface found for 127.0.0.1
and this is when I run #ifconfig

Code: Select all

eth0      Link encap:Ethernet  HWaddr F6:5A:D0:02:BA:55  
          inet addr:192.168.0.78  Bcast:192.168.1.255  Mask:255.255.254.0
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:880160 errors:0 dropped:0 overruns:0 frame:0
          TX packets:1620 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:48492881 (46.2 MiB)  TX bytes:332362 (324.5 KiB)
          Interrupt:32 
I think this cause of localhost or something, so please someone help me.

Thanks & Best Regards,

Vichea
Sovichea Cheth
Web Application Developer

User avatar
sovichea_cheth
Posts: 4
Joined: 2013/11/08 01:15:49
Location: Phnom Penh
Contact:

Re: Sendmail fail using php

Post by sovichea_cheth » 2013/11/08 02:10:20

This problem was solved by run this command # vi /etc/postfix/main.cf
then edit this statement to my vserver:

Code: Select all

inet_interfaces = 192.168.0.78
Thanks

Vichea
Sovichea Cheth
Web Application Developer

User avatar
TrevorH
Site Admin
Posts: 32401
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: Sendmail fail using php

Post by TrevorH » 2013/11/08 06:57:50

It's not good that you have no interface named 'lo' though. Check in /etc/sysconfig/network-scripts and see if you have a file called ifcfg-lo that should look something like

Code: Select all

DEVICE=lo
IPADDR=127.0.0.1
NETMASK=255.0.0.0
NETWORK=127.0.0.0
# If you're having problems with gated making 127.0.0.0/8 a martian,
# you can change this to something else (255.255.255.255, for example)
BROADCAST=127.255.255.255
ONBOOT=yes
NAME=loopback
CentOS 8 died a premature death at the end of 2021 - migrate to Rocky/Alma/OEL/Springdale ASAP.
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 and 6 are dead, do not use them.
Use the FAQ Luke

User avatar
sovichea_cheth
Posts: 4
Joined: 2013/11/08 01:15:49
Location: Phnom Penh
Contact:

Re: Sendmail fail using php

Post by sovichea_cheth » 2013/11/08 07:17:52

Dear Trevor,

Yes, I have this file and the content look like yours. What can I do with this file?

Code: Select all

[root@localhost network-scripts]# ls
ifcfg-eth0  ifdown       ifdown-ippp  ifdown-post    ifdown-sit     ifup-aliases  ifup-ippp  ifup-plip   ifup-ppp     ifup-tunnel       net.hotplug
ifcfg-eth1  ifdown-bnep  ifdown-ipv6  ifdown-ppp     ifdown-tunnel  ifup-bnep     ifup-ipv6  ifup-plusb  ifup-routes  ifup-wireless     network-functions
ifcfg-lo    ifdown-eth   ifdown-isdn  ifdown-routes  ifup           ifup-eth      ifup-isdn  ifup-post   ifup-sit     init.ipv6-global  network-functions-ipv6
[root@localhost network-scripts]# cat ifcfg-lo 
DEVICE=lo
IPADDR=127.0.0.1
NETMASK=255.0.0.0
NETWORK=127.0.0.0
# If you're having problems with gated making 127.0.0.0/8 a martian,
# you can change this to something else (255.255.255.255, for example)
BROADCAST=127.255.255.255
ONBOOT=yes
NAME=loopback
Sovichea Cheth
Web Application Developer

User avatar
TrevorH
Site Admin
Posts: 32401
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: Sendmail fail using php

Post by TrevorH » 2013/11/08 07:48:51

Try `ifup lo`
CentOS 8 died a premature death at the end of 2021 - migrate to Rocky/Alma/OEL/Springdale ASAP.
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 and 6 are dead, do not use them.
Use the FAQ Luke

User avatar
sovichea_cheth
Posts: 4
Joined: 2013/11/08 01:15:49
Location: Phnom Penh
Contact:

Re: Sendmail fail using php

Post by sovichea_cheth » 2013/11/08 08:55:56

Wow, It's working now. Trevor, you are amazing. Thank you so much.

Code: Select all

[root@localhost wowza_visitor_count]# ifup lo
[root@localhost wowza_visitor_count]# ifconfig
eth0      Link encap:Ethernet  HWaddr F6:5A:D0:02:BA:55  
          inet addr:192.168.0.78  Bcast:192.168.1.255  Mask:255.255.254.0
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:1668962 errors:0 dropped:0 overruns:0 frame:0
          TX packets:12235 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:106388125 (101.4 MiB)  TX bytes:2039540 (1.9 MiB)
          Interrupt:32 

lo        Link encap:Local Loopback  
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:16436  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0 
          RX bytes:0 (0.0 b)  TX bytes:0 (0.0 b)
Sovichea Cheth
Web Application Developer

User avatar
TrevorH
Site Admin
Posts: 32401
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: Sendmail fail using php

Post by TrevorH » 2013/11/08 09:15:11

As long as ONBOOT=yes is present in that file (with that capitalisation) then the lo interface ought to be brought up on boot.
CentOS 8 died a premature death at the end of 2021 - migrate to Rocky/Alma/OEL/Springdale ASAP.
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 and 6 are dead, do not use them.
Use the FAQ Luke

Post Reply