Can't use ini_set because session is active

 ̄綄美尐妖づ 提交于 2019-12-10 15:46:57

问题


How can I fix this?

Warning: ini_set() [function.ini-set]: A session is active. You cannot change the session module's ini settings at this time in C:\xampp\htdocs******.php on line 3

I already tried using session_destroy(); but I still get the error.

Thanks.


回答1:


use session_start(); after ini_set or @ sign before ini_set: @ini_set




回答2:


if you server is configured to auto start sessions, you can try also:

php_flag session.auto_start 0

in your .htaccess file



来源:https://stackoverflow.com/questions/11384416/cant-use-ini-set-because-session-is-active

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!