|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2004-06-22 16:24 UTC] iliaa@php.net
[2004-06-22 17:38 UTC] thetaphi@php.net
[2004-06-23 02:19 UTC] michaelw at webcentral dot com dot au
[2004-06-23 12:03 UTC] thetaphi@php.net
[2004-06-23 15:09 UTC] thetaphi@php.net
[2004-06-24 05:53 UTC] michaelw at webcentral dot com dot au
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Thu Oct 30 22:00:01 2025 UTC |
Description: ------------ Attempting to set ini values within the obj.conf file (or vserver.obj.conf if thats where your virtual hosts are pointed) fails silently. This appears to be caused by the logic in sapi/nsapi/nsapi.c ( static void nsapi_php_ini_entries(NSLS_D TSRMLS_DC) ) , in particular the following snippet: --- SNIP --- ok=1; for (j=0; nsapi_exclude_from_ini_entries[j]; j++) { ok&=(!strcasecmp(entry->param->name,nsapi_exclude_from_ini_entries[j])); } if (ok) { --- SNIP --- It appears that ok is never returning as TRUE, and thus the code never enters the if (ok) block. I modified it as follows (although I'm sure there are better ways..): --- SNIP --- ok=1; for (j=0; nsapi_exclude_from_ini_entries[j]; j++) { if (!strcasecmp(entry->param->name,nsapi_exclude_from_ini_entries[j])) { ok = 0; } } if (ok) { --- SNIP --- Additionally, the code that actually updates the ini value in the same method): --- SNIP --- if (ok) { /* change the ini entry */ if (zend_alter_ini_entry(entry->param->name,strlen(entry->param->name)+1,entry->param->value,strlen(entry->param->value),PHP_INI_USER,PHP_INI_STAGE_RUNTIME)==FAILURE) { log_error(LOG_WARN, pblock_findval("fn", NSG(pb)),NSG(sn), NSG(rq), "Cannot change php.ini key \"%s\" to \"%s\"", entry->param->name, entry->param->value); } } --- SNIP --- checks the method to see if it is PHP_INI_USER allowed, whilst since it is in a system file (obj.conf or vserver.obj.conf) I would expect it to test against PHP_INI_SYSTEM ?