Jump to content

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)

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.