IIS 7 and Above
IIS 8.5 PHP can't change session.save_path
Last post Apr 30, 2019 06:09 AM by JiriP
Apr 29, 2019 10:53 AM|JiriP|LINK
I can't change session.save_path in php.ini, value is ignored. I changed it to:
session.save_path = "c:\PHP\Sessions"
In php manager I can see correct value, but phpinfo() always shows session.save_path="c:\windows\temp".
Thousands of sess_* files are generated there, and aren't deleted.
Any help? Thank you.
IIS 8.5, PHP 7.3.4 (PHP 7.2.7 the same), Windows Server 2012 R2.
Apr 29, 2019 10:42 PM|mbanavige|LINK
wondering if you may have more than one copy/version of php installed.
if you check phpinfo(), it should give you that path to the php.ini file that was loaded (Loaded Configuration File)
Is that the php.ini file that you modified?
Apr 30, 2019 03:16 AM|Jalpa Panchal|LINK
As Mike suggested check that you modify the correct php.ini file or not. give IIS_IUSRS and IUSR permission to "c:\PHP\Sessions" file.Clear the cache, cookies and temp data of your browser.try to set ini_set('session.save_path', '/path/to/your/folder').
You could also follow below post for more detail:
Apr 30, 2019 06:09 AM|JiriP|LINK
Thank you Jalpa!
I've missed that forrum on serverfault during my googling for solution. That
webplatform installer section [WebPIChanges] at the end of php.ini file was the reason. It overided more settings in regular php.ini file.
It is quite confusing that something like this is done by installer, duplicating variables in php.ini without any warning.