moodle“无法初始化PHP会话,请确认您的浏览器接受cookie。” [英] moodle "Can not initialise PHP session, please verify that your browser accepts cookies."
问题描述
我正在尝试在本地安装MOODLE
,并且遇到了这个问题
I'm trying to install MOODLE locally and i face this problem
Can not initialize PHP session, please verify that your browser accepts cookies.
我正在尝试按照以下步骤启用Cookie(我使用的是chrome)
https://support.google。 com / accounts / bin / answer.py?hl = zh-CN& answer = 61416
I'm trying to enable cookie (I'm using chrome) following these steps https://support.google.com/accounts/bin/answer.py?hl=en&answer=61416
我也尝试配置php.ini
http://support.qualityunit.com / 021373-如何启用对PHP的会话支持
and I also tried to config php.ini
http://support.qualityunit.com/021373-How-To-Enable-Session-Support-for-PHP
但仍然无法解决
有人可以帮助我吗?
php configuration <br/>
session
Session Support enabled
Registered save handlers files user
Registered serializer handlers php php_binary wddx
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_httponly Off Off
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 1000 1000
session.gc_maxlifetime 1440 1440
session.gc_probability 1 1
session.hash_bits_per_character 5 5
session.hash_function 0 0
session.name PHPSESSID PHPSESSID
session.referer_check no value no value
session.save_handler files files
session.save_path D:\EasyPHP-12.1/tmp D:\EasyPHP-12.1/tmp
session.serialize_handler php php
session.upload_progress.cleanup On On
session.upload_progress.enabled On On
session.upload_progress.freq 1% 1%
session.upload_progress.min_freq 1 1
session.upload_progress.name PHP_SESSION_UPLOAD_PROGRESS PHP_SESSION_UPLOAD_PROGRESS <br/>
session.upload_progress.prefix upload_progress_ upload_progress_ <br/>
session.use_cookies On On <br/>
session.use_only_cookies On On <br/>
session.use_trans_sid 0 0 <br/>
推荐答案
通常,这是一个php配置问题,php可以这样做。 t写入会话文件夹。
确切的路径和用户因操作系统而异,但我将尝试进行总结。
Usually this is a php config problem where php can't write to the session folder. The exact path and user vary by operating system but I'll attempt to summarize.
首先,我们需要查看会话是否是问题所在,但我们需要知道php使用哪个配置文件以及保存会话的路径。
为此:
First we need to see if sessions are the problem but we need to know which config file php using and which path its saving sessions to. To do that:
- 在您的安装文件夹中新建一个名为info.php的文件,
- 添加
<?php phpinfo(); ?>
- 并保存。
- 将浏览器发送到
网络服务器上的页面。
- Make a new file in your moodle install folder called info.php,
- add
<?php phpinfo(); ?>
- and save.
- Send your browser to that page on your webserver.
这将向您展示几件事:
- session.save_path是php试图保存您的会话文件的地方。
- APACHE_RUN_USER是用户apache运行的身份。
- 已加载的配置文件将显示php从哪个文件读取这些
设置。
如果设置了session.save_path,请检查该文件夹的权限。它们应该由Web服务器用户拥有。修复该问题后,重新加载显示屏幕。
If your session.save_path is set, check the permissions of that folder. They should be owned by the web server user. Once you've fixed that, reload the moodle screen.
如果未设置session.save_path,请暂时将其设置为 / tmp /。
这是一个始终可写但不太安全的位置。
重新启动您的Web服务器并重新加载moodle屏幕。
If your session.save_path is not set, set it to "/tmp/" for now. This is a location which is always writable but isn't very secure. Restart your web server and reload the moodle screen.
这篇关于moodle“无法初始化PHP会话,请确认您的浏览器接受cookie。”的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!