php – 调用未定义的函数session_start()
作者:互联网
我正在尝试用php启动会话,但我总是收到此错误:
Fatal error: Call to undefined function session_start() in /www/test/test.php on line 2
我的代码(复制表格http://php.net/manual/en/session.examples.basic.php):
<?php
session_start();
if (!isset($_SESSION['count'])) {
$_SESSION['count'] = 0;
} else {
$_SESSION['count']++;
}
?>
在我的php.ini中,我得到了extension = session.so.此外,我在会话部分的设置是:
[Session]
session.save_handler = files
session.save_path = "/tmp"
session.use_cookies = 1
;session.cookie_secure =
session.use_only_cookies = 1
session.name = PHPSESSID
session.auto_start = 0
session.cookie_lifetime = 0
session.cookie_path = /
session.cookie_domain =
session.cookie_httponly =
session.serialize_handler = php
session.gc_probability = 1
session.gc_divisor = 100
session.gc_maxlifetime = 1440
session.bug_compat_42 = On
session.bug_compat_warn = On
session.referer_check =
session.entropy_length = 0
;session.entropy_file = /dev/urandom
session.entropy_file =
;session.entropy_length = 16
session.cache_limiter = nocache
session.cache_expire = 180
session.use_trans_sid = 0
session.hash_function = 0
session.hash_bits_per_character = 4
url_rewriter.tags = "a=href,area=href,frame=src,input=src,form=,fieldset="
我使用的是PHP版本5.4.17.服务器在Arduino Yun(Linux)上运行.
任何人都可以帮助我,或给你一个提示?
标签:fatal-error,php,session 来源: https://codeday.me/bug/20190725/1529137.html