Session under Win32
Question :
How can I get rid of the errors generated by PHP when creating a session :
Warning: open(/tmp\sess_1243d01f1b06d133deb6b9894ed040ed, O_RDWR) failed: m (2) in C:\apache\htdocs\path\to_document\login.php on line 12
Answer :
PHP comes with a php.ini file that contains all configuration variables. The configuration is the default configuration that will suit most user...hem most UNIX user should I say because there is a small config variable that needs some change under Win32.
The session.save_path variable indicates where PHP should store files containing session information.
For UNIX user :
session.save_path = /tmp
For Win32 user :
session.save_path = C:\WINNT\TEMP (Or wherever your TEMP directory is)
If you don't know where can be found the php.ini files, just try this :
<?php
echo phpinfo()
?>
System | Windows NT 5.1 build 2600 |
Build Date | Dec 30 2001 |
Server API | CGI |
Virtual Directory Support | enabled |
Configuration File (php.ini) Path | C:\WINDOWS\php.ini |
ZEND_DEBUG | disabled |
Thread Safety | enabled |
You should find where the php.ini files is.
Then a little further, you have the Session table :
session
Session Support | enabled |
Directive | Local Value | Master Value |
---|---|---|
session.auto_start |
Off | Off |
session.cache_expire |
180 | 180 |
session.cache_limiter |
nocache | nocache |
session.cookie_domain |
no value | no value |
session.cookie_lifetime |
0 | 0 |
session.cookie_path |
/ | / |
session.cookie_secure |
Off | Off |
session.entropy_file |
no value | no value |
session.entropy_length |
0 | 0 |
session.gc_maxlifetime |
1440 | 1440 |
session.gc_probability |
1 | 1 |
session.name |
PHPSESSID | PHPSESSID |
session.referer_check |
no value | no value |
session.save_handler |
files | files |
session.save_path |
C:\WINDOWS\TEMP | C:\WINDOWS\TEMP |
session.serialize_handler |
php | php |
session.use_cookies |
On | On |
Comments
Login Failure
Thanks for posting this FAQ. It has saved me from ripping my hair out yet again.
WollombiWombat
You must me logged in to write a comment.