|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2000-07-05 02:39 UTC] eggli at giga dot net dot tw
A simple prog like this:
index.php:
{
$foo = "test";
session_register("foo");
printf('<a href="script.php?%s">Link</a>', SID);
}
script.php:
{
session_start();
echo $foo;
}
This prog works perfect in Unix-like system, but won't work under Windows 98, I've heard it won't work under any win32 system, too.
Here's my .ini:
[Session]
session.save_handler = files
session.save_path = g:\php\php\tmp\
session.use_cookies = 0 session.name = PHPSESSID
session.auto_start = 0 session.cookie_lifetime = 180
session.cookie_path = \
session.cookie_domain = session.serialize_handler = php
session.gc_probability = 1
session.gc_maxlifetime = 1440
session.referer_check = session.entropy_length = 0
session.entropy_file = 1
session.entropy_length = 16
session.entropy_file = /dev/urandom
session.cache_limiter = nocache
session.cache_expire = 180
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Mon Nov 03 18:00:01 2025 UTC |
Also, what happens if you set enable_cookies to ON? And try also: printf('<a href="script.php?%s">Link</a>', session_id());I get these 3 warnings on Windows 98 4.10.2222A, Apache 1.3.14, PHP 4.0.3pl1: Warning: open(\tmp\sess_906cf0440e666cf0f87ea4bbee139c97, O_RDWR) failed: m (2) in c:\program files\Apache Group\Apache\htdocs/session2.php on line 2 Warning: open(\tmp\sess_906cf0440e666cf0f87ea4bbee139c97, O_RDWR) failed: m (2) in Unknown on line 0 Warning: Failed to write session data (files). Please verify that the current setting of session.save_path is correct (\tmp) in Unknown on line 0 The following solved the problem: Make sure you are editing the php.ini file found in the Php\ directory, not in the windows\ directory. Set the session.save_path to an absolute path, relative paths (like /tmp) don't work. For example: session.save_path = C:\Program Files\Apache Group\Apache\htdocs\tmp I used this prog for testing: <?php session_start(); session_register("your_name"); if(!empty($your_name)) { echo "I already know your name, $your_name"; } elseif(empty($your_name)&&!isset($submit)) { echo "<form name=myform method=post action=$PHP_SELF> <input type=text name=first_name> first name<br> <input type=text name=last_name> last name<br> <input type=submit name=submit value=submit> </form>"; } elseif(isset($submit)&&empty($your_name)) { $your_name=$first_name . " " . $last_name; echo "Thank you, $your_name"; } ?>I?ve reconfigured the .ini files in both the Windows directory and PHP directory as suggested and changed my session.save_path =c:\program files\Apache group\Apache\htdocs\tmp. Unfortunately, the problem still existed. My operating system is ME and use Apache 1.3.19 and PHP 4.0. Below are the error messages and the corresponding codes that generated the error messages. Warning: open(/tmp\sess_898f989ebde72088d6c8f780496496a0, O_RDWR) failed: m (2) in c:\program files\apache group\apache\htdocs\index.php on line 4 Warning: open(/tmp\sess_898f989ebde72088d6c8f780496496a0, O_RDWR) failed: m (2) in Unknown on line 0 Warning: Failed to write session data (files). Please verify that the current setting of session.save_path is correct (/tmp) in Unknown on line 0 <? include ('book_sc_fns.php'); // The shopping cart needs sessions, so start one session_start(); do_html_header("Welcome to Book-O-Rama"); echo "<p>Please choose a category:</p>"; // get categories out of database $cat_array = get_categories(); // display as links to cat pages display_categories($cat_array); // if logged in as admin, show add, delete, edit cat links if(session_is_registered("admin_user")) { display_button("admin.php", "admin-menu", "Admin Menu"); } do_html_footer(); ?>