PHP Startup redis: Unable to initialize module
来源:互联网 发布:蒙特卡洛算法 matlab 编辑:程序博客网 时间:2024/05/02 01:01
最近在做php连接redis的实验,遇到一个问题语法是php代码直接使用php命令来测试是没有问题的。使用lnmp环境也是没有问题的,但是lamp就是不可以,最后查看http的日志终于找到问题所在了。
php测试代码如下:
<?php session_start(); if (!isset($_SESSION['TEST'])) { $_SESSION['TEST'] = time(); } $_SESSION['TEST3'] = time(); print $_SESSION['TEST']; print "<br><br>"; print $_SESSION['TEST3']; print "<br></br><br></br>"; print session_id(); ?>
http log:
[Sun Apr 24 23:06:47 2016] [notice] SIGHUP received. Attempting to restartPHP 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 restartPHP 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<br><br>1461514249<br></br><br></br>r05vrgop80r2f75t91ss1a2lv5
0 0
- PHP Startup redis: Unable to initialize module
- PHP Warning: PHP Startup: redis: Unable to initialize module
- PHP Startup: xxxx: Unable to initialize module
- mac os 安装memcache 出现 PHP Warning: PHP Startup: memcache: Unable to initialize module 解决办法
- mcrypt: Unable to initialize module
- PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib64/php/modules/module.so'
- PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib64/php/modules/module.so'
- PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib64/php/modules/module.so'
- PHP startup: Unable to load dynamic library
- PHP Startup: Unable to load dynamic library
- php startup:unable to load dynamic openssl
- checkstyle cannot initialize module TreeWalker - Unable to instantiate TabCharacter FileLength
- centos ,Unable to initialize module mysql 和 mysqli的问题解决
- PHP Warning: PHP Startup: Unable to load dynamic library
- php报错:PHP Startup Unable to load dynamic library
- Unable to initialize TldLocationsCache
- mac下通过brew 安装的php,可能使用了 --debug 标识,php命令行时,一直出现 "Unable to initialize module"
- 解决PHP startup: Unable to load dynamic library的错误
- Android之MediaPlayer简单应用
- ToolBar和ActionBar右边三个点的图标替换
- 【XJB研究】关于几种LCA求法的时间
- 关于python中的__new__方法
- 数据库事务隔离级别
- PHP Startup redis: Unable to initialize module
- BZOJ 4539|HNOI 2016|树|可持久化线段树|LCA ******
- Sqlite的使用和一个简单的书籍管理系统(下)
- 使用Ant,第1部分:将Ant脚本引入Java项目
- Linux查看物理CPU个数、核数、逻辑CPU个数
- 学习总结二
- 深拷贝、浅拷贝以及Prototype模式
- nginx https配置以及 api接口版本号rewrite
- idea