3

Ok, I got an codeigniter app. it works fine in localhost, works fine in a php hosting that I got. But my client wants it running in IIS. I've passed the web.config pitfall but now I get the following error:

An uncaught Exception was encountered

Type: Exception

Message: Session: Configured save path 'c:\windows\temp' is not writable by the PHP process.

Filename: E:\home\emconexao.com\site3\system\libraries\Session\drivers\Session_files_driver.php

Line Number: 124

I know it's a PHP configuration trouble, but where ?

In my application/config/autoload.php file if I remove session from libraries it works... until I login the site, then obviously it can't generate session and it crashes...

Can anyone help me?

Tom Tom
  • 3,680
  • 5
  • 35
  • 40
  • You could set the app pool for the virtual to an actual user that has permissions to windows\temp (NOT AN ADMIN) – Anthony Horne Apr 11 '15 at 22:00
  • A little formatting on your posts can go a long way, I edited it for you. Also you should avoid abbreviations like "obv". – Tom Tom Apr 12 '15 at 01:37
  • Possible duplicate of [Session: Configured save path 'C:\Windows\Temp' is not writable by the PHP process](http://stackoverflow.com/questions/39472209/session-configured-save-path-c-windows-temp-is-not-writable-by-the-php-proce) – megz Mar 05 '17 at 14:55
  • You can just change the permissions to c:\windows\temp to allow users to have full access. If your lazy like me. – Menace Feb 04 '19 at 19:53

6 Answers6

6

Here’s a fix that worked for me:

  • Open php.ini
  • Set: session.save_path = C:\inetpub\temp\sessions
  • Create C:\inetpub\temp\sessions and give IUSR and NETWORK SERVICE (or whatever is the identity of app pool) full rights.
  • Save php.ini

This was a good reference: http://forums.iis.net/post/1735092.aspx

Elijah Lofgren
  • 1,437
  • 3
  • 23
  • 39
  • Note that one location of php.ini might be C:\Program Files (x86)\IIS Express\PHP\v5.3\php.ini and that file might still be used even if C:\Program Files (x86)\IIS Express\PHP\v5.4 exists. – Elijah Lofgren Jan 22 '16 at 15:28
2

give config.php

$config['sess_save_path'] = 'writable absolute path';
rink.attendant.6
  • 44,500
  • 61
  • 101
  • 156
User123456
  • 2,492
  • 3
  • 30
  • 44
1

create folder sessions under '/application/chache' and in config.php change

$config['sess_save_path'] = NULL;

TO

$config['sess_save_path'] = FCPATH . 'application/cache/sessions/';

and Change File Permissions

https://www.wikihow.com/Change-File-Permissions-on-Windows-7

0

this worked for me make changes on some places .user.ini which is in httpdocs,type there session.save_path = 'C:\your dir' then in config.php change the session.save_path ='null' to the above dir and make same changes on php settings set the session.save_path to the above dir

Maaz
  • 3
  • 2
0
1= create file .user.ini
2= copy this code and edit
[PHP]
open_basedir=""
safe_mode=off
sendmail_from=noreply@secureserver.net
SMTP=relay-hosting.secureserver.net
session.save_path=server drive:\PleskVhosts\your main domain.com\yout sub domain name/tmp;

    enter code here

example

[PHP]
open_basedir=""
safe_mode=off
sendmail_from=noreply@secureserver.net
SMTP=relay-hosting.secureserver.net
session.save_path=G:\PleskVhosts\gfor.com\onlineshope.org\tmp;
-2

I couldnt solve my problem using 'files' to store session because of the hosting service, instead i changed to 'database' option on config.php and created a ci_sessions table using the model on codeigniter. Here the link that helped me:

http://www.codeigniter.com/userguide3/libraries/sessions.html#database-driver