Jump to content

session_start() Function not Working in Windows IIS


vinoindiamca

Recommended Posts

Hi,

  I have session problem in my code

 

<?php

  session_start();

  if($_SESSION["username"]!="") {

      header("location: welcome.php");

  }

?>

 

 

Here session_start() gives an error like

Warning: session_start() [function.session-start]: open(C:\DOCUME~1\ADMINI~1\LOCALS~1\Temp\php\session\sess_uvu8ver7m73v61ejvbit5jho87, O_RDWR) failed: No such file or directory (2) in C:\Inetpub\wwwroot\Ajax\ajax_datagrid\login.php on line 2

 

Please give me the solution to change any codes in PHP.ini file

 

 

  Quote
No such file or directory

 

Does any one read error messages???

 

C:\DOCUME~1\ADMINI~1\LOCALS~1\Temp\php\session\ does not exist. You either need to create that directory or you need to change the session.save_path setting to point to a directory that does exist.

  • 4 weeks later...

Thats a short answer.

 

change your php.ini

 

session.save_path = 'c:\php\sessiontemp\'

 

and go CREATE that folder.  Also, since youre in the IIS section, any changes to php.ini you'll need to restart IIS.  Start > Run > iisreset.

 

You may also have your box running in lockdown mode, and by that I mean if you create a folder, and specify it, your folder will need to have the right windows permissions for the internet guest user account to have READ AND WRITE access to this folder.  the session temp directory usually needs the user group 'IUSR_(machine_name)' to have WRITE permissions to that folder.  THen it should work.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.