0

I am trying to make changes to my .yml files during the run time and the php bin/console cache:clear command must be executed so these changes can affect the application.

I tried running the cache:clear command with the Controller during the run time, but I got the same error every time in different methods.

Error:

"warning: ini_set (): A session is active. You cannot change the session module's ini settings at this time at NativeFileSessionHandler.php"

I am aware that executing the cache:clear command during the run time is not a good method as seen in the error, so are there any other ways to execute this command programmatically or to see the effect of changes in .yml files during the execution of the application without using console?

Dhia Djobbi
  • 1,176
  • 2
  • 15
  • 35

1 Answers1

0

This error is discussed here: ErrorException: Warning: ini_set(): A session is active. You cannot change the session module's ini settings at this time in /../../

Possible sollution would be to:

Make sure your php configuration php.ini has this configured: session.auto_start = 0.

When clearing cache for prod environment you must specify the environment since dev is the default. use --env parameter like so:

php bin/console cache:clear --env=prod

Laurynas
  • 736
  • 4
  • 14