php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #23479 session settings in php.ini ignored
Submitted: 2003-05-04 16:23 UTC Modified: 2003-05-15 13:01 UTC
Votes:1
Avg. Score:4.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:1 (100.0%)
Same OS:1 (100.0%)
From: seven at nimrod-online dot com Assigned:
Status: Not a bug Package: Session related
PHP Version: 4.3.2RC2 OS: Windows 98
Private report: No CVE-ID: None
 [2003-05-04 16:23 UTC] seven at nimrod-online dot com
Currently I am running Apache 2.0.45 with PHP 4.3.2RC2, and not any of my scripts store sessions. When i use the script:
<?php
//ini_set("session.save_path","e:\\program files\\webserver\\php\\tmp");
$foo = "bar";
session_start();
session_register("foo");
session_write_close();
?>
i get the following error messages:
Warning: session_start(): open(/tmp\sess_c61f98f39e73fa535a14be0dde19a36e, O_RDWR) failed: No such file or directory (2) in E:\program files\Webserver\www-docs\session.php on line 4

Warning: session_write_close(): Your script possibly relies on a session side-effect which existed until PHP 4.2.3. Please be advised that the session extension does not consider global variables as a source of data, unless register_globals is enabled. You can disable this functionality and this warning by setting session.bug_compat_42 or session.bug_compat_warn to off, respectively. in E:\program files\Webserver\www-docs\session.php on line 6

Warning: session_write_close(): open(/tmp\sess_c61f98f39e73fa535a14be0dde19a36e, O_RDWR) failed: No such file or directory (2) in E:\program files\Webserver\www-docs\session.php on line 6

Warning: session_write_close(): Failed to write session data (files). Please verify that the current setting of session.save_path is correct (/tmp) in E:\program files\Webserver\www-docs\session.php on line 6.
When i remove the slashes, the errors stop(except for the 2nd, but that's because i didn't set session.bug_compat_warn to off). The most strange error for me is 'Warning: session_write_close(): Failed to write session data (files). Please verify that the current setting of session.save_path is correct (/tmp) in E:\program files\Webserver\www-docs\session.php on line 6', because in my php.ini, session.save_path isn't set to /tmp, but to e:\\program files\\webserver\\php\\tmp. Also, PHP doesn't take over the settings for session.name or any other session related option. I am sure thou that I am editing the right php.ini, because phpinfo() tells me the exact path to my php.ini, that I was editing. I always reset the server after I made changes to my php.ini, so that isn't the problem either, and I know that the path is valid, because sessions work when I use the command ini_set("session.save_path","the path"), sessions DO get stored.
One more note: when I read my phpinfo, it also gives the 'standard settings' for sessions, even thou I have edited the php.ini. All the other settings are taken over perfectly by PHP.

How can I solve this problem, without having to add ini_set to every file(or including a file which does this for me)? In other word, can this be fixed, and if yes, how?

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2003-05-04 16:32 UTC] seven at nimrod-online dot com
Some notes:
with 'When i remove the slashes', i mean the slashes before ini_set(. Also, the question in the end was somewhat misplaced, since i have asked this on 3 different ways to other people. The most likely problem is a bug in the php4apache2.dll.

Also, i have tried setting something totally useless(like error_append_string) at the bottom of my php.ini, but this doesn't seem to work either. Probably this problem has much to do with the reading of this file in Windows 98(like, a 32KB limit or something?)
 [2003-05-05 16:41 UTC] sniper@php.net
What exactly did you write in php.ini for these settings?
And have you tried with Apache 1.3.27 yet?

 [2003-05-08 11:26 UTC] seven at nimrod-online dot com
the following session settings are set:
session.save_handler = files
session.save_path = E:\\program files\\webserver\\php\\tmp
session.use_cookies = 1
session.name = SESSION
The rest is default. I have not tried Apache 1.3.27 yet, because I am not interested in running Apache 1.3.27. Several friends of mine had the same problem when using the php4apache2.dll. Using a different server like IIS will work, and using the cgi binary isn't safe enough for me.
 [2003-05-14 11:59 UTC] seven at nimrod-online dot com
no luck with that latest snapshot.
 [2003-05-15 13:01 UTC] sniper@php.net
Sorry, but your problem does not imply a bug in PHP itself.  For a
list of more appropriate places to ask for help using PHP, please
visit http://www.php.net/support.php as this bug system is not the
appropriate forum for asking support questions. 

Thank you for your interest in PHP.

Works fine here.

 
PHP Copyright © 2001-2026 The PHP Group
All rights reserved.
Last updated: Tue Oct 06 11:00:02 2026 UTC