时间:2021-07-01 10:21:17 帮助过:2人阅读
php测试代码如下:
"; print $_SESSION['TEST3']; print "
"; print session_id(); ?>
http log:
[Sun Apr 24 23:06:47 2016] [notice] SIGHUP received. Attempting to restart PHP Warning: PHP Startup: redis: Unable to initialize module\nModule compiled with module API=20121212\nPHP compiled with module API=20100525\nThese options need to match\n in Unknown on line 0 [Sun Apr 24 23:06:47 2016] [notice] Apache/2.2.29 (Unix) PHP/5.4.45 configured -- resuming normal operations [Sun Apr 24 23:24:21 2016] [notice] SIGHUP received. Attempting to restart PHP Warning: PHP Startup: redis: Unable to initialize module\nModule compiled with module API=20121212\nPHP compiled with module API=20100525\nThese options need to match\n in Unknown on line 0 [Sun Apr 24 23:24:21 2016] [notice] Apache/2.2.29 (Unix) PHP/5.4.45 configured -- resuming normal operations
分析:
日志非常明显的说明当时编译php使用的api为“API=20100525”,而redis编译使用的api为“API=20121212”
ps:由于之前多次安装过不同版本的apache,所以我自己都不清楚当时编译php时使用的那个版本了(有点尴尬:()
解决方法如下:使用yum安装一个高版本的httpd,然后重新启动一个httpd服务就可以了(把配置文件和webroot更新一下)。
测试:
curl -x 127.1.1.1:80 www.cf.com/session.php 1461514249
1461514249
r05vrgop80r2f75t91ss1a2lv5
以上就介绍了PHP Startup redis: Unable to initialize module,包括了initialize,startup方面的内容,希望对PHP教程有兴趣的朋友有所帮助。