moodle “Can not initialise PHP session, please verify that your browser accepts cookies.”

二次信任 提交于 2019-12-06 10:25:01

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.

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:

  1. Make a new file in your moodle install folder called info.php,
  2. add <?php phpinfo(); ?>
  3. and save.
  4. Send your browser to that page on your webserver.

This will show you a couple of things:

  • "session.save_path" is where php is trying to save your sessions files.
  • "APACHE_RUN_USER" is the user apache is running as.
  • "Loaded Configuration File" will show you which file php is reading these settings from.

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.

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.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!