Bug #73492 [NEW]: PHP 5.6 ini_set no longer supports sendmail_path; must be hard-coded in php.ini
| From: | php dot net at ii0 dot net | Date: | Thu, 10 Nov 2016 22:41:47 +0000 |
| Subject: | Bug #73492 [NEW]: PHP 5.6 ini_set no longer supports sendmail_path; must be hard-coded in php.ini | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-205292@lists.php.net to get a copy of this message | ||
From: php dot net at ii0 dot net
Operating system: Red Hat
PHP version: 5.6.28
Package: PHP options/info functions
Bug Type: Bug
Bug description:PHP 5.6 ini_set no longer supports sendmail_path; must be hard-coded in php.ini
Description:
------------
---
From manual page: http://www.php.net/function.ini-set
---
Historically, we have been able to dynamically set the path to a
sendmail binary:
ini_set('sendmail_path','/path/to/sendmail -xyz');
and everything worked well.
However, after upgrading PHP to 5.6, it seems that PHP suddenly ignores
that particular setting (or quietly fails to use it) because all
PHP-initiated mail totally stops working and the PHP error log gives us
[a cryptic and ultimately unhelpful] error "sh: -t: command not found".
Hard-coding the path in the php.ini file works fine:
sendmail_path = /path/to/sendmail -xyz
Fortunately for us, the dynamic setting via ini_set() is unnecessary
because we only have one version of the sendmail binary and all
PHP-initiated mail can use the same parameters. Hard-coding it is
acceptable in our case.
Whether this behavior change is a feature or a bug, it should be
documented. If this is the new intentional behavior then ideally,
ini_set() should raise a deprecation/warning/etc. when someone tries to
use it for sendmail_path.
BTW: It appears that all our other ini_set() besides sendmail_path are
still working in 5.6 just as they did before.
Here is the "configure" entry from phpinfo(), in case anyone finds it
useful:
'./configure' '--prefix=/opt/lampp' '--with-apxs2=/opt/lampp/bin/apxs'
'--with-config-file-path=/opt/lampp/etc' '--with-mysql=mysqlnd'
'--enable-inline-optimization' '--disable-debug' '--enable-bcmath'
'--enable-calendar' '--enable-ctype' '--enable-ftp'
'--enable-gd-native-ttf' '--enable-magic-quotes' '--enable-shmop'
'--disable-sigchild' '--enable-sysvsem' '--enable-sysvshm'
'--enable-wddx' '--with-gdbm=/opt/lampp' '--with-jpeg-dir=/opt/lampp'
'--with-png-dir=/opt/lampp' '--with-freetype-dir=/opt/lampp'
'--with-zlib=yes' '--with-zlib-dir=/opt/lampp'
'--with-openssl=/opt/lampp' '--with-xsl=/opt/lampp'
'--with-ldap=/opt/lampp' '--with-gd'
'--with-imap=/bitnami/xamppunixinstallerstackDev-linux-x64/src/imap-2007e'
'--with-imap-ssl' '--with-gettext=/opt/lampp'
'--with-mssql=shared,/opt/lampp' '--with-pdo-dblib=shared,/opt/lampp'
'--with-sybase-ct=/opt/lampp'
'--with-mysql-sock=/opt/lampp/var/mysql/mysql.sock'
'--with-oci8=shared,instantclient,/opt/lampp/lib/instantclient'
'--with-mcrypt=/opt/lampp' '--with-mhash=/opt/lampp'
'--enable-sockets'
'--enable-mbstring=all' '--with-curl=/opt/lampp' '--enable-mbregex'
'--enable-zend-multibyte' '--enable-exif' '--with-bz2=/opt/lampp'
'--with-sqlite=shared,/opt/lampp' '--with-sqlite3=/opt/lampp'
'--with-libxml-dir=/opt/lampp' '--enable-soap' '--with-xmlrpc'
'--enable-pcntl' '--with-mysqli=mysqlnd'
'--with-pgsql=shared,/opt/lampp/' '--with-iconv=/opt/lampp'
'--with-pdo-mysql=mysqlnd' '--with-pdo-pgsql=/opt/lampp/postgresql'
'--with-pdo_sqlite=/opt/lampp' '--with-icu-dir=/opt/lampp'
'--enable-fileinfo' '--enable-phar' '--enable-zip'
'--enable-intl'
'CC=gcc' 'CFLAGS=-I/opt/lampp/include/c-client
'-I/opt/lampp/include/libpng' '-I/opt/lampp/include/freetype2' '-O3'
'-fPIC' '-L/opt/lampp/lib' '-I/opt/lampp/include'
'-I/opt/lampp/include/ncurses'' 'LDFLAGS=-Wl,--rpath
'-Wl,/opt/lampp/lib' '-L/opt/lampp/lib' '-I/opt/lampp/include'
'-L/opt/lampp/lib' '-L/opt/lampp''
'CPPFLAGS=-I/opt/lampp/include/c-client '-I/opt/lampp/include/libpng'
'-I/opt/lampp/include/freetype2' '-O3' '-fPIC'
'-L/opt/lampp/lib'
'-I/opt/lampp/include' '-I/opt/lampp/include/ncurses'' 'CXX=g++'
'CXXFLAGS=-I/opt/lampp/include/c-client '-I/opt/lampp/include/libpng'
'-I/opt/lampp/include/freetype2' '-I/opt/lampp/include/ncurses' '-O3'
'-L/opt/lampp/lib' '-I/opt/lampp/include''
Test script:
---------------
<?php
// to reproduce the problem, ensure php.ini has no hard-coded
sendmail_path
ini_set("sendmail_path", "/usr/sbin/sendmail -t -i");
// this returns false, and "sh: -t: command not found" will appear in
the error log
mail( "recipient@ii0.net", "subject here", "body here", "From:
sender@ii0.net\r\n" );
--
Edit bug report at https://bugs.php.net/bug.php?id=73492&edit=1
--
Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=73492&r=trysnapshot54
Try a snapshot (PHP 5.5): https://bugs.php.net/fix.php?id=73492&r=trysnapshot55
Try a snapshot (trunk): https://bugs.php.net/fix.php?id=73492&r=trysnapshottrunk
Fixed in SVN: https://bugs.php.net/fix.php?id=73492&r=fixed
Fixed in release: https://bugs.php.net/fix.php?id=73492&r=alreadyfixed
Need backtrace: https://bugs.php.net/fix.php?id=73492&r=needtrace
Need Reproduce Script: https://bugs.php.net/fix.php?id=73492&r=needscript
Try newer version: https://bugs.php.net/fix.php?id=73492&r=oldversion
Not developer issue: https://bugs.php.net/fix.php?id=73492&r=support
Expected behavior: https://bugs.php.net/fix.php?id=73492&r=notwrong
Not enough info: https://bugs.php.net/fix.php?id=73492&r=notenoughinfo
Submitted twice: https://bugs.php.net/fix.php?id=73492&r=submittedtwice
register_globals: https://bugs.php.net/fix.php?id=73492&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=73492&r=php4
Daylight Savings: https://bugs.php.net/fix.php?id=73492&r=dst
IIS Stability: https://bugs.php.net/fix.php?id=73492&r=isapi
Install GNU Sed: https://bugs.php.net/fix.php?id=73492&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=73492&r=float
No Zend Extensions: https://bugs.php.net/fix.php?id=73492&r=nozend
MySQL Configuration Error: https://bugs.php.net/fix.php?id=73492&r=mysqlcfg