Jump to content

[SOLVED] ini_set not working


next

Recommended Posts

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

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)

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.