ini_set() is a PHP function that changes a configurable setting for the duration of the current script. It takes a directive name and a value, and returns the previous value when the change succeeds, or false if it fails. Some directives cannot be changed at runtime.
Runtime changes can affect security-sensitive behavior, so defenders should review application code as well as server configuration. In PHP session handling, for example, changing session.serialize_handler with ini_set() before session_start() can create a risky configuration path when combined with other session features. Attackers may be able to exploit a vulnerable code path, while administrators can reduce exposure by checking for runtime overrides and applying vendor guidance. A setting changed in code may not be visible in the main PHP configuration file.


