Questions tagged [ini-set]

The ini_set() function is used to set PHP configuration options at runtime.

ini_set is a PHP function that allows developers to set a configuration option at runtime. This is done by calling the function in any PHP script with the option name ($varname) and the value ($newvalue) to be set:

ini_set ( string $varname , string $newvalue ) : string

If the execution is successful the function returns the previously set value, otherwise it returns false. At the end of the script execution the previous value will be restored automatically.

The option name must contain a valid configuration option name. A full list of names including their default values can be found in the List of php.ini directives in the PHP Manual. Only options with the modes PHP_INI_USER or PHP_INI_ALL can be changed with ini_set(). All other options require to be changed by editing php.ini.

92 questions
4
votes
1 answer

php ini_set() changes don't take with safe mode off

I wanted to turn output buffering off. Currently it shows no value for local and master. I run ini_set('output_buffering',4092); and no changes in phpinfo(). Safe mode is off. What's the next thing to check?
Jared Eitnier
  • 7,012
  • 12
  • 68
  • 123
3
votes
9 answers

ini_set(): Headers already sent. You cannot change the session module's ini settings at this time in codeigniter

I'm using CI 3.1.10.In the index.php file i use development enviroment. MY controller When i try to access the test class then it show me…
Danish Danish
  • 43
  • 1
  • 1
  • 2
3
votes
1 answer

PHP7.2.7-fpm/Docker ini_set(): Headers already sent. You cannot change the session module's ini settings at this time

I'm trying to have a secure login page, which was working fine, whilst working with XAMPP, but now that i have switched to Docker, i am getting this error: Warning: ini_set(): Headers already sent. You cannot change the session module's ini settings…
tmzafar
  • 180
  • 3
  • 15
3
votes
1 answer

What is the PSR-1 Compliant Alternative to Using ini_set()?

I am in the process of making my code base PSR-2 compliant (and therefore PSR-1 compliant) and I have come across the following code: public function init() { parent::init(); // Allow A Larger PHP Memory Limit For This Script …
Joe Harvey
  • 193
  • 2
  • 7
3
votes
1 answer

Change sendmail_path using ini_set in PHP

Can i set sendmail_path using ini_set in php page, without changing in php.ini file ? Like this : ini_set("SMTP","smtp.gmail.com"); ini_set("smtp_port","587"); My application will run on a shared server, and we can't change server's…
user3395190
  • 39
  • 1
  • 2
3
votes
5 answers

PHP does not return errors at all

I am running PHP and nginx and I use a production version of php.ini. So the variable display_error is set to Off and there is a good reason I want it this way. But for certain files I need to enable error reporting. I used ini_set to turn on error…
ErJab
  • 6,056
  • 10
  • 42
  • 54
3
votes
0 answers

register_argc_argv can't be set via ini_set

i have following problem... i have a webapplication and i want to use register_argc_argv in my php.ini it is turned off Directive Local Value Master Value register_argc_argv Off Off now the problem is, i can't access the…
Dwza
  • 6,494
  • 6
  • 41
  • 73
3
votes
1 answer

PHP ini_set session gc_maxlifetime not working

I am trying to set gc_maxlifetime in PHP. Here is the code in 'header.php', and I include it every page. ini_set('session.cookie_lifetime', 1); ini_set('session.gc_maxlifetime', 1); session_start(); I test it with echo…
andytt
  • 83
  • 1
  • 2
  • 8
3
votes
1 answer

PHP increase memory_limit above 128M

I have running a Debian Squeeze with Standard Apache and PHP, installed via aptitude. No I try to run : Result: 128M 128M What I have…
user2554863
  • 61
  • 1
  • 2
  • 5
3
votes
1 answer

PHP display_errors = 0 not being respected

I'm using CodeIgniter and I've added the following lines into my index.php: error_reporting(E_ALL ^ E_NOTICE); ini_set('display_errors', 0); ini_set('log_errors', 1); ini_set('error_log', $_SERVER['DOCUMENT_ROOT'] . '/php_errors.log'); For some…
Anthony
  • 5,275
  • 11
  • 50
  • 86
3
votes
1 answer

How does php ini_set work?

Possible Duplicate: ini_set() scope of effect? I'm working on a site and for development I like to see my errors in the browser, so I have the following code at the top of my site: error_reporting(E_ALL); ini_set("display_errors", 1); According…
crunkchitis
  • 718
  • 2
  • 10
  • 19
2
votes
1 answer

Unable to set session.save_handler in my code

After I upgraded PHP version of my website to 7.3, I started receiving this error message: Recoverable fatal error: ini_set(): Cannot set 'user' save handler by ini_set() or session_module_name() After my investigation, I found that the problem is…
tyrlaka
  • 154
  • 1
  • 5
  • 13
2
votes
1 answer

How to mute error logging of a disabled function despite an at operator @?

Does anybody know how to make a disabled function (in my case ini_set()) stop throwing an error? I usually have it like @ini_set() but on this WP plugin, it STILL fills the error_log with: [30-Apr-2018 12:01:39 UTC] All-in-One Event Calendar:…
that-ben
  • 245
  • 1
  • 13
2
votes
3 answers

I can't specify a custom error log in PHP

ini_set('error_log', $custom_error_log_location); print ini_get('error_log'); The result of the above code? Nothing! It literally prints nothing as the value of ini_get('error_log'). I'm running this on an Apache server. I investigated the Apache…
William
  • 33
  • 1
  • 4
2
votes
2 answers

ini_set not working with nginx & php7-fpm

I recently moved a project from Apache & PHP5 to nginx & PHP7. When debugging my application I noticed that ini_set is not working anymore, at least for the following settings. ini_set( 'display_errors', 'On' ); ini_set( 'log_errors', 'On'…
redelschaap
  • 2,774
  • 2
  • 19
  • 32