centOS, PHP mail function & xenForo

TPerry

Well-known member
Is it normal to HAVE to set the sendmail_path in php.ini with centOS to get it to work with nginx/php-fpm to send mail out? I've just finished a few hours battling with an individuals server that runs centOS 6.x and had used Centmin version 1.2.2 and installed the MariaDB 5.2.x (which does NOT work with Postfix since PostFix requires the mysql-lib's). Installed the Centmin 1.2.3 and it offers an upgrade to 5.5. Ran it and all it did was REMOVE 5.2 and never installed 5.5.
Had to update to MariaDB 5.5 via YUM manually, then install postfix. Still would not work from xenForo (and neither would the smtp setup). Once I finally figured out that maybe I needed to set the sendmail_path to the /usr/lib/sendmail-postfix (which I did) did it start working.

I'm used to Debian - where there are no hoop-jumping like the above required. Install your DB flavor of choice, install nginx, install php5-fpm and related, install postfix and then fine tune (but it works without having to remove sendmail, update the MariaDB, etc, etc.).
 
Last edited:
I am using CentOS with Postfix as I has better performance comparing with Sendmail. You do not need to configure sendmail_path, just configure your login credential in XenForo option (localhost with your login information).
 
I've never had to do that. Looking at our setup, /usr/lib/sendmail is a symlink to /etc/alternatives/mta-sendmail which is a symlink itself to /usr/sbin/sendmail.postfix (/usr/sbin/sendmail is a similar symlink setup).
 
I've never had to do that. Looking at our setup, /usr/lib/sendmail is a symlink to /etc/alternatives/mta-sendmail which is a symlink itself to /usr/sbin/sendmail.postfix (/usr/sbin/sendmail is a similar symlink setup).
Yeah, but the problem was, without putting that in, Postfix would not send. It did not start working until I did the sendmail_path (he had it set up as the default - which is sendmail). I worked with it for over 4 hours earlier yesterday before I stumbled onto the sendmail_path solution.
I know it SHOULD work without having to do it - but it wouldn't. I know that sendmail (and postfix) would work like it should from an ssh session and using mail tracy@ride-texas.org, then typing the subject, etc - it just wouldn't work with PHP without the sendmail_path.
That's what struck me as strange.
 
Strange i use xenforo and centmin mod as well and never had to set sendmail_path either for centos 5.8/5.9/6.x OS. Could be related to postfix ?

Regarding failed MariaDB 5.5 upgrade, faq #7 item at http://centminmod.com/faq.html explains the centmin mod automated logging so you can check why the upgrade and MariaDB 5.5 install failed.

edit: oh I am using Centmin v1.2.3-eva2000.03 now for new VPS, not sure if that makes a different versus v1.2.2 (although my older VPS with v1.2.2 were updated to v1.2.3 with MariaDB 5.5). If it's a test server, just start out with v1.2.3 :)

edit2: don't let Centmin Mod itself be 100% respresentative of CentOS vs Debian. Centmin Mod is just one way of setting things up on CentOS :)
 
Last edited:
Strange i use xenforo and centmin mod as well and never had to set sendmail_path either for centos 5.8/5.9/6.x OS. Could be related to postfix ?
Doubtful, as neither postfix nor sendmail worked once he installed nginx to replace Apache. Apache worked just fine with the setup he had (and using sendmail).

Regarding failed MariaDB 5.5 upgrade, faq #7 item at http://centminmod.com/faq.html explains the centmin mod automated logging so you can check why the upgrade and MariaDB 5.5 install failed.
I know basically why it failed...

.[1;33;40m* Adjust old MariaDB 5.2.x /etc/my.cnf
.(B.[m.[1;33;40m for MariaDB 5.5 my.cnf compatibility
.(B.[m*************************************************
inc/mariadb_upgrade55.inc: line 242: unalias: cp: not found
sed -i 's/skip-pbxt/#skip-pbxt/g' /etc/my.cnf
sed -i 's/innodb_use_purge_thread = 4/innodb_purge_threads=1/g' /etc/my.cnf
sed -i 's/innodb_extra_rsegments/#innodb_extra_rsegments/g' /etc/my.cnf
sed -i 's/innodb_adaptive_checkpoint/innodb_adaptive_flushing_method/g' /etc/my.cnf

grep: /etc/init.d/mysql: No such file or directory
sed: can't read /etc/init.d/mysql: No such file or directory
mysql: unrecognized service

edit: oh I am using Centmin v1.2.3-eva2000.03 now for new VPS, not sure if that makes a different versus v1.2.2 (although my older VPS with v1.2.2 were updated to v1.2.3 with MariaDB 5.5). If it's a test server, just start out with v1.2.3 :)
His is an existing system he had to quickly set up before he shipped out with the Navy. He can't get in from remote to work on it as they block the ports needed.

edit2: don't let Centmin Mod itself be 100% respresentative of CentOS vs Debian. Centmin Mod is just one way of setting things up on CentOS :)
That's why I was wondering. I personally like to be 100% hands on, that way when something like this comes up I can usually figure out WHY it did what it did (or didn't do :p). Once I installed the 5.5 version with MariaDB compatible the forum came back up.

The main thing is, he's up and running now.
 
Oh the server is someone elses not yours ? I assumed it was your own setup :)

Yeah i like being hands on too, the automated logging has helped me a few times figure out what went wrong i.e. failed downloads or changed download urls (when was on v1.2.2.x)
 
Oh the server is someone elses not yours ? I assumed it was your own setup :)
Yeah i like being hands on too, the automated logging has helped me a few times figure out what went wrong i.e. failed downloads or changed download urls (when was on v1.2.2.x)
Yes, it belongs to a fellow forum owner that is currently on ship. He'd sent me a convo asking if I would mind helping out as it had quit working.
All my servers are running Debian 7.0 - and the only centOS system I have is a Gateway server sitting here at the house that I haven't turned on lately to play with. That's why I wasn't sure if that (the php sending mail issue) was a normal problem or not. I know when I googled it, several others had reported errors with nginx and centOS and php() mail problems but none of their solutions seemed to work.
 
I see, so the CentOS server wasn't a fresh clean OS but already running LAMP setup prior ? Centmin Mod really is only used for fresh CentOS from my experience.

Doubtful, as neither postfix nor sendmail worked once he installed nginx to replace Apache. Apache worked just fine with the setup he had (and using sendmail).
if you mean Nginx from Centmin Mod, probably one of problems was, with Centmin Mod v1.2.2 to prepare MariaDB 5.2 removed a YUM package which IIRC has a dependency for postfix so postfix might have gotten removed as well. So could be it ?

Anyway, nice way to get your hands dirty on CentOS side :D

I'm the opposite, have ~80x CentOS based servers (alot using Centmin Mod) and 1x Debian 6.x and 1x Debian 7.x server :)
 
I see, so the CentOS server wasn't a fresh clean OS but already running LAMP setup prior ? Centmin Mod really is only used for fresh CentOS from my experience.
From what I understood, he installed centOS and then was using Apache. He then decided to move over to nginx due to better resource utilization.

if you mean Nginx from Centmin Mod, probably one of problems was, with Centmin Mod v1.2.2 to prepare MariaDB 5.2 removed a YUM package which IIRC has a dependency for postfix so postfix might have gotten removed as well. So could be it ?
The install of v5.2 of MariaDB removed the necessary mysql-libs, which Postfix is dependent upon. Upgrading to 5.5 and installing MariaDB-compat fixed that issue - the problem was that apparently not all packages were installed with with CentMin Mod 1.2.2 that was needed to allow the upgrade from it to 5.5. He had never installed Postfix, and was using the default install of Sendmail under Apache.

Anyway, nice way to get your hands dirty on CentOS side :D

I'm the opposite, have ~80x CentOS based servers (alot using Centmin Mod) and 1x Debian 6.x and 1x Debian 7.x server :)

My hands definitely got dirty (as did my mind as I was cussing it out!). :p
I'm just more used to the .DEB type format now and aptitude. I used to run nothing but RedHat (that was before they split into RedHat being the commercial and Fedora/centOS) and you didn't have YUM at that time. It's not a bad OS, just different that what I am used to (and the reason I had set up a local server to play with it on - just haven't had time to play with it).
 
Top Bottom