LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 12-07-2015, 01:10 AM   #1
tangocharlie
LQ Newbie
 
Registered: Dec 2015
Posts: 2

Rep: Reputation: Disabled
Sendmail works fine on redhat but PHP unable to use that


Hi, I have problem sending mail with PHP. on LAMP (redhat 7 server). I configured "sendmail" which I am able to send email using the following command:
$ sendmail toemail@something.com <press enter>
message body <press enter>
ctrl+d (sends message)
and the message is received by any mentioned email address, successfully.
But when I use PHP scripts (working fine on other servers), PHP scripts are unable to send any email.
No error is there in /etc/mail/maillog.
and I have tried with different paths in php.ini in sendmail_path
e.g:
usr/sbin/sendmail -t -i

usr/sbin/sendmail -t

usr/sbin/sendmail
neither of the three does anything.

permission for /usr/sbin/sendmail is 666

Please suggest.

Last edited by tangocharlie; 12-07-2015 at 01:11 AM.
 
Old 12-07-2015, 04:39 AM   #2
berndbausch
LQ Addict
 
Registered: Nov 2013
Location: Tokyo
Distribution: Mostly Ubuntu and Centos
Posts: 6,316

Rep: Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002
Quote:
Originally Posted by tangocharlie View Post
No error is there in /etc/mail/maillog
You mean there is no trace in the mail log.

What distro and version is this?
What's the PHP code?
Can you confirm that the PHP code that executes sendmail is actually executed?

To be honest, I don't know PHP, but is there any place where an error in a PHP program would be logged? I am asking because a path name without leading slash, like usr/bin/sendmail, is very unlikely to work.

EDIT: /etc/mail/maillog is a strange location for a log file. Is it a symbolic link to /var/log? Regarding mail logs, see also http://serverfault.com/questions/596...og-of-sendmail.

Last edited by berndbausch; 12-07-2015 at 04:43 AM.
 
Old 12-10-2015, 11:04 PM   #3
tangocharlie
LQ Newbie
 
Registered: Dec 2015
Posts: 2

Original Poster
Rep: Reputation: Disabled
SELinux was enabled

Thanks for the reply. It worked. The reason of it not working was SELinux was enabled.
 
  


Reply



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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Unable to send email with sendmail from PHP 5.3 on CentOS VM crmpicco Linux - Newbie 1 02-14-2014 07:42 AM
[SOLVED] Fedora 13: Unable to browse internet but, works fine with Google Chrome KinnowGrower Linux - Laptop and Netbook 7 03-04-2011 12:55 PM
Yesterday PHP worked just fine and today it wants to serve up the php code. orsty9001 Linux - Server 10 12-12-2008 10:48 AM
Sendmail on 3.0AS enterprise redhat..fine on invalid server name, not username beavt8r Linux - Networking 1 02-03-2006 09:28 PM
9600 / Redhat 9 - works fine ! xconspirisist LinuxQuestions.org Member Success Stories 6 04-20-2005 01:28 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

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

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration