1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

centOS, PHP mail function & xenForo

Discussion in 'Server Configuration and Hosting' started by Tracy Perry, Jul 23, 2013.

  1. Tracy Perry

    Tracy Perry 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: Jul 23, 2013
  2. sonnb

    sonnb Well-Known Member

    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).
  3. Mike

    Mike XenForo Developer Staff Member

    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).
  4. Tracy Perry

    Tracy Perry Well-Known Member

    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.
  5. p4guru

    p4guru Well-Known Member

    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: Jul 23, 2013
  6. Tracy Perry

    Tracy Perry Well-Known Member

    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).

    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
    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

    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.

    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.
    p4guru likes this.
  7. p4guru

    p4guru Well-Known Member

    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)
  8. Tracy Perry

    Tracy Perry Well-Known Member

    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.
  9. p4guru

    p4guru Well-Known Member

    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.

    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 :)
  10. Tracy Perry

    Tracy Perry Well-Known Member

    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.

    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.

    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).

Share This Page