|
本帖最后由 mchobby 于 2019-1-31 00:02 编辑
尝试移植一份比较老旧的源码到新的环境上。旧环境在apache + php5 + redis下,表现一切正常。
现在移植到 php 7.2 + nginx + redis 4.0.3 下,发现定制化的redis驱动(只实现了构造函数、open、read、write)得到的session_id一直在变,导致controller里写的$this->session->userdata()总是获取到空的内容。
我在定制驱动里写了log_message输出,看log是这样:- ERROR - 2019-01-30 22:48:12 --> [Redis driver] successfully read tsk9hp41tpikb8r5lr7d1on1hs =
- ERROR - 2019-01-30 22:48:12 --> [Redis driver] successfully write tsk9hp41tpikb8r5lr7d1on1hs with content:
- ERROR - 2019-01-30 22:48:25 --> [Redis driver] successfully read gvdltgtnomvgs6tlr3jnm98osa =
- ERROR - 2019-01-30 22:48:25 --> [Redis driver] successfully write gvdltgtnomvgs6tlr3jnm98osa with content:
- ERROR - 2019-01-30 22:48:38 --> [Redis driver] successfully read keh9b77789f410slb329bjnaf3 =
- ERROR - 2019-01-30 22:48:38 --> [Redis driver] successfully write keh9b77789f410slb329bjnaf3 with content:
- ERROR - 2019-01-30 22:48:51 --> [Redis driver] successfully read krsg3h7iatnhqssamhvb5lqk4c =
- ERROR - 2019-01-30 22:48:51 --> [Redis driver] successfully write krsg3h7iatnhqssamhvb5lqk4c with content:
- ERROR - 2019-01-30 22:49:04 --> [Redis driver] successfully read h6f4tmnobpj0n46374dtc4il20 =
- ERROR - 2019-01-30 22:49:04 --> [Redis driver] successfully write h6f4tmnobpj0n46374dtc4il20 with content:
- ERROR - 2019-01-30 22:49:17 --> [Redis driver] successfully read n0fl5o0isq4cufc5773tsaasn6 =
- ERROR - 2019-01-30 22:49:17 --> [Redis driver] successfully write n0fl5o0isq4cufc5773tsaasn6 with content:
复制代码 项目源代码以及定制化的session_redis_driver驱动在这里:https://github.com/roastduck/fortuna-oj/blob/new-env/application/libraries/Session/drivers/MY_Session_redis_driver.php。
请问我应该往哪个方向去寻找问题?提前谢谢帮助!
|
|