1

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?

2 Answers 2

1

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.

[WebPIChanges]
error_log=C:\Windows\temp\PHP72x64_errors.log
upload_tmp_dir=C:\Windows\temp
session.save_path=C:\Windows\temp
cgi.force_redirect=0
cgi.fix_pathinfo=1
fastcgi.impersonate=1
fastcgi.logging=0
max_execution_time=300
date.timezone=Europe/Berlin
extension_dir="C:\Program Files\PHP\v7.2\ext\"

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

1
  • Your provided solution help me to avoid crash my server. I am really very grateful to you. Thanks for your solution.
    – riad
    Jan 21, 2021 at 10:03
0

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

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

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .