2ndmouse — 2013-01-04T06:04:12-05:00 — #1
I have a PHP script which uses session_start(); which works perfectly on linux server. However, when I try the same script on windows server, I run into permissions problems, presumably on the /tmp directory. I can get round the problem by first creating a 'session' directory just above wwwroot level and then using:
session_save_path('../../session'); // from a sub-directory in the main web, and then:
In the PHP info file, session support is enabled, but session.auto_start is off - could this be the reason?
cups — 2013-01-04T07:15:21-05:00 — #2
I found the easiest way is to create a folder called /tmp on the hdd your server uses. eg c:/tmp (change c:/ to your servers' recognised hdd)
2ndmouse — 2013-01-04T07:47:32-05:00 — #3
Unfortunately, I don't have that kind of access to the server. However, if I first detect whether the server is windows and then, if it is, use my workaround. This seems to be adequate for my purposes. I think I'll leave at that. Thanks anyway.
cups — 2013-01-04T11:38:50-05:00 — #4
Good on you for posting the workaround then, its here if someone searches for it.
spacephoenix — 2013-01-04T14:05:15-05:00 — #5
An alternative is to store sessions in the database using a custom session handler
logic_earth — 2013-01-04T20:53:17-05:00 — #6
Regardless of what server you are running on, it is always a good idea to create your own temporary directory for your site (or on a per site bases) this will keep your temp files and session files away from other people/site's temp files and session files. Less chance of mix ups, or premature clean up.
2ndmouse — 2013-01-05T08:13:49-05:00 — #7
Thanks logic_earth - I think that's good advice.