|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2011-10-31 08:43 UTC] dbetz at df dot eu
Description:
------------
Hello,
when setting php_flag to Off or false, then PHP FPM sets it to the string "Off" rather than 0 or NULL.
In fpm.conf
php_flag["session.auto_start"] = Off
or
php_flag["session.auto_start"] = false
It seems that the failure is on all boolean flags.
Test script:
---------------
<?
echo "session.auto_start is : " . ini_get('session.auto_start') . "\n";
if (ini_get('session.auto_start')) {
echo "Some code here .....\n";
}
?>
Expected result:
----------------
session.auto_start is : 0
Actual result:
--------------
session.auto_start is : Off
Patchesfpm-bug60179-v2.patch (last revision 2011-11-03 15:07 UTC by fat@php.net)fpm-bug60179.patch (last revision 2011-10-31 13:00 UTC by fat@php.net) Pull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sat Nov 01 07:00:01 2025 UTC |
Hi fat, i have tested the latest snapshot with the patch and have changed the config to php_flag[session.auto_start] = Off But the problem is still here. Looking into fpm_conf.c at: static char *fpm_conf_set_array(... : if (convert_to_bool) { char *err = fpm_conf_set_boolean(value, &subconf, 0); if (err) return err; kv->value = strdup(b ? "On" : "Off"); } It looks like kv->value is either string "On" or "Off" or am i wrong ?hum ... not sure to understand your problem afterall :) without the patch: If I set php_flag[session.auto_start]=On ini_get("session.auto_start") returns "On" and session are created for each page (auto start is on as asked) If I set php_flag[session.auto_start]=Off ini_get("session.auto_start") returns "Off" and session are NOT created for each page (auto start is off as asked) For me this works as expected. Do you have the same behavior ?Hello, yes, the option is set correct, but the return value of ini_get() is different than whith php-cgi. Most apps like typo3, joomla, wordpress, eg. are checking in the installer, if php.ini settings are correct. These setting are checked thru ini_get. When ini_get(session.auto_start) is not 0 but "Off", then the check fails. Here is the sample code from typo3 installer: if (ini_get('session.auto_start')) { $sessionCreationError = 'Error: session.auto-start is enabled.<br />'; $sessionCreationError .= 'The PHP option session.auto-start is enabled. Disable this option in php.ini or .htaccess:<br />'; I hope you understand now my problem.