session.save_path是指向/tmp的, 由于php不是我装的,所以就不知道用ports还是其他的安装的。 session的信息如下: Session Support enabled Registered save handlers files user Directive Local Value Master Value session.auto_start Off Off session.bug_compat_42 On On session.bug_compat_warn On On 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_divisor 100 100 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 /tmp /tmp session.serialize_handler php php session.use_cookies On On session.use_only_cookies Off Off session.use_trans_sid Off Off 用vi编辑php.ini就只有以下内容了: ;php.ini for PEAR tests include_path=.. ~
当我浏览page1时,显示如下信息: the content of $test_var is: test session! next page Warning: Unknown(): 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 Unknown on line 0 当我点next page时 session的值没有被传递。 按unixdotnet(freebsd) 的说法 2.不要使用session_register生成一个session变量,使用session['key']=$value; 是不是在freebsd上面注册session变量和其他的系统不同呢?
page1.php
<?php
session_start();
session_register("test_var");
$test_var = "test session!";
echo "the content of \$test_var is: $test_var<br>";
?>
<a href = "page2.php">next page</a>page2.php
<?php
session_start();
echo "the content of \$test_var is: $test_var<br>";
session_unregister("test_var");
?>
<a href = "page3.php">next pages</a>page3.php
<?php
session_start();
echo "the content of \$test_var is: $test_var<br>";
session_destroy();
?>
测试之后发现page2.php没有输出test session,
不知道是什么原因?
一般unix系统应该在/tmp下。
你freebsd下的php引擎是用package安装的还是用port安装的啊。
如果都不是,是你自己从代码编译安装的,你就要看看你的
session.save_path
指向了哪里,并且apache对那个目录有足够的读写权限,而且前面的分号要去掉的啊。
个人比较喜欢用$_SESSION['foo']格式的数组来使用session.
一般unix系统应该在/tmp下
是指session.save_path会指向/tmp这个目录的哟。
为什么这个论坛没有修改的功能啊。好像我在这里发垃圾帖一样。
由于php不是我装的,所以就不知道用ports还是其他的安装的。
session的信息如下:
Session Support enabled
Registered save handlers files user Directive Local Value Master Value
session.auto_start Off Off
session.bug_compat_42 On On
session.bug_compat_warn On On
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_divisor 100 100
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 /tmp /tmp
session.serialize_handler php php
session.use_cookies On On
session.use_only_cookies Off Off
session.use_trans_sid Off Off 用vi编辑php.ini就只有以下内容了:
;php.ini for PEAR tests
include_path=..
~
php 是4.3.7
php.ini的位置
/usr/ports/www/mod_php4/work/php-4.3.7/pear/tests/php.ini
呵呵~~~,环境不是我配的,我也没有权限,用的是代理了,可能login不进来的。
难道这个文件可以重命名?还是我的权限太低?
the content of $test_var is: test session!
next page
Warning: Unknown(): 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 Unknown on line 0
当我点next page时
session的值没有被传递。
按unixdotnet(freebsd) 的说法
2.不要使用session_register生成一个session变量,使用session['key']=$value;
是不是在freebsd上面注册session变量和其他的系统不同呢?
session_register。
我想问的是这个对session的传递有什么影响??