I tried to changed the session path for PHP 7.2 on a Windows Server 2016 but the phpinfo shows only the default path to the windows temp folder.

PHP 7.2 was installed by the webplatform installer.

What I have tried so far:

  1. created a new folder

    path: "C:\Program Files\PHP\v7.2\session"

  2. changed the folder security properties for the IIS_IUSERS

    for test the user has full access

  3. then changed the entry "session.save_path" in the php.ini to the folder path

    session.save_path = "C:\Program Files\PHP\v7.2\session"

  4. restart the IIS server / restart the whole window server

If I printed out the php settings with the function phpinfo it said that the session path is located under "C:\Windows\temp". It looks like that my option will not be loaded.

The screenshot shows the session part from the phpinfo output

But if I changed other option in the php.ini the phpinfo shows me the correct value. And in the entry "Loaded Configuration File" it shows that my php.ini file is used as configuration file.

The screenshot shows the "Loaded Configuration File" entry from the phpinfo output

So my question is what do I have to do to change the session path under windwo server 2016?


Check which php.ini is used. session.save_path in your php.ini is the right place, iisreset is the right thing to do.

  • Thx for your answer, it points me to the right direction. – JohnDoe Sep 28 '18 at 14:41

The problem was the webplatform installer.

The installer added the new section [WebPIChanges] to the php.ini.

In this section it overrides the session.save_path with an hardcode string.

extension_dir="C:\Program Files\PHP\v7.2\ext\"

Because the section was at the end of the php.ini, it overrides my changes.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.