无法在 ARM 上的 PHP 中启动会话
我在ARM91上安装了PHP。在我使用 session_start 之前它工作正常。然后我得到以下内容 警告:session_start():读取返回的字节数少于请求的字节数 这似乎不是权限问题 - sess_* 文件已创建。当您尝试将任何内容放入此类会话时,它会为会话创建稀疏文件(17GB 大小),实际大小为 12 字节(正是我想在那里写入的内容)。做 strace 我认为问题出在 __llseek 中的某个地方,导致创建如此巨大的稀疏文件。我对 SQLITE 有类似的问题(无法打开任何数据库,磁盘 I/O 错误,但我可以捕获数据库文件,并且在创建数据库日志文件时似乎也是 llseek 问题)。我不知道在哪里进一步寻找或如何解决这个问题,无法通过谷歌搜索任何类似的报告。
I have PHP installed on ARM91. It works fine until I use session_start. Then I get the following
Warning: session_start(): read returned less bytes than requested
This does not seem to be a permission problem - the sess_* files are created. When you try to put anything into such session, it creates sparse file (17GB size) for the session with real size 12 bytes (exactly what i wanted to write there). Doing strace I think the problem is somewhere in __llseek that cause creation of such huge sparse file. I have similar issue with SQLITE (cannot open any DB, disk I/O error but i can cat the DB file and also seems it's llseek issue when creating DB journal file). I have no idea where to look further or how to solve that, fail to google any similar reports.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
看来是uclibc不兼容的问题。使用仔细检查的设置重新编译所有内容后,它开始工作。
Seems it was issue of incompatible uclibc. After recompiling everything with carefully reviewed settings it started to work.
这听起来像是值得向 PHP 错误跟踪器报告的事情。
如果没有任何帮助,您可以使用 session_save_handler()。如果您查看手册页,有一个完整的替代重写基于文件的会话处理程序的示例。
This sounds like something worthy of reporting to the PHP bug tracker.
If nothing comes up that helps, you could roll your own session storage functions using session_save_handler(). If you check out the manual page, there is an example for a complete alternative rewrite of the file based session handler.