next Posted August 2, 2008 Share Posted August 2, 2008 I'm trying to add path to Zend Framework through ini_set but it's not working. Code: $current_includes = ini_get('include_path'); $zend_path = $_SERVER['DOCUMENT_ROOT'] . '/Zend'; $incs = explode(';', $current_includes); if(!in_array($zend_path, $incs)) { if(ini_set('include_path', ';' . $incs . $zend_path)) echo 'path to Zend successfully added to configuration file, restart the server to apply changes.'; else echo 'unable to write to ini file'; } else echo 'Zend already exists'; When i run this code, i do get a success message, but ini remains the same. What am i doing wrong here? Link to comment https://forums.phpfreaks.com/topic/117861-solved-ini_set-not-working/ Share on other sites More sharing options...
DeanWhitehouse Posted August 2, 2008 Share Posted August 2, 2008 try running a phpinfo file after to see if it is changed Link to comment https://forums.phpfreaks.com/topic/117861-solved-ini_set-not-working/#findComment-606225 Share on other sites More sharing options...
genericnumber1 Posted August 2, 2008 Share Posted August 2, 2008 ini_set() only sets the config for the scripts execution.. it changes it back after the script completes. Link to comment https://forums.phpfreaks.com/topic/117861-solved-ini_set-not-working/#findComment-606234 Share on other sites More sharing options...
next Posted August 2, 2008 Author Share Posted August 2, 2008 Oh, so doesn't actually write to file? Link to comment https://forums.phpfreaks.com/topic/117861-solved-ini_set-not-working/#findComment-606235 Share on other sites More sharing options...
genericnumber1 Posted August 2, 2008 Share Posted August 2, 2008 Oh, so doesn't actually write to file? Nope. http://us2.php.net/ini_set You might consider using php_flag in a .htaccess file or actually changing the value manually in the .ini file (though I assume that isn't an option since you are trying to implement it in a script) Link to comment https://forums.phpfreaks.com/topic/117861-solved-ini_set-not-working/#findComment-606239 Share on other sites More sharing options...
next Posted August 2, 2008 Author Share Posted August 2, 2008 Yeah, i'm forcing myself to write portable code, so manually adding values is not really an option. Thanks for the help! Link to comment https://forums.phpfreaks.com/topic/117861-solved-ini_set-not-working/#findComment-606241 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.