douxuanou2787 2018-11-06 11:52
浏览 264
已采纳

在session.save_path Codeigniter中使用模式格式

I'm facing a problem using the session library in Codeigniter. On this page it specifically says

To be more specific, it doesn’t support PHP’s directory level and mode formats used in session.save_path, and it has most of the options hard-coded for safety. Instead, only absolute paths are supported for $config['sess_save_path'].

Now what I want is to create session files with permissions 777. I've set the session_save_path in php.ini to 0;0777;/home/sessions/. This is overwritten by the local value by Codeigniter to /home/sessions. How can I force Codeigniter to create these session files with 777 permissions, as it doesn't support this in the config file.

Please don't mind about the 777 permissions on session files.

  • 写回答

2条回答 默认 最新

  • doulouli8686 2018-11-08 14:35
    关注

    About changing the default dir permissions which ic 0700 by default, i don't recommend this at all cause you'll have to change the core system files which is a very bad practice but if you must have a look at Session_files_driver.php and change mkdir($save_path, 0700, TRUE) to mkdir($save_path, 0777, TRUE) if you must and if it doesn't exist already with 0777 permission... btw, i think its way better to use db to store sessions.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?

悬赏问题

  • ¥15 乌班图ip地址配置及远程SSH
  • ¥15 怎么让点阵屏显示静态爱心,用keiluVision5写出让点阵屏显示静态爱心的代码,越快越好
  • ¥15 PSPICE制作一个加法器
  • ¥15 javaweb项目无法正常跳转
  • ¥15 VMBox虚拟机无法访问
  • ¥15 skd显示找不到头文件
  • ¥15 机器视觉中图片中长度与真实长度的关系
  • ¥15 fastreport table 怎么只让每页的最下面和最顶部有横线
  • ¥15 java 的protected权限 ,问题在注释里
  • ¥15 这个是哪里有问题啊?