PHP Warning: PHP Startup: redis: Unable to initialize module Windows版本phpredis扩展

摘要:
phpinfo、NTS和x86中的重要信息,当我们使用phpinfo时,大多数时候我们会查看模块是否已安装,但其他重要信息会被忽略。例如,为什么我的扩展总是没有安装,下载的长串扩展的含义是什么?以上几个重要参数:1.编译器:编译器2A架构:CPU架构3ConfigurationFilePath:php配置文件的位置。这是加载配置文件的真实位置。小心!4ThreadSafety:线程是否安全5PHPExtensionBuild:php扩展创建的数字与您是否可以安装扩展有关,因此您应该仔细查看!

版权声明:经验之谈,不知能否换包辣条,另,转载请注明出处。https://www.cnblogs.com/zmdComeOn/category/1295248.html

[root@VM_0_2_centos phpredis-master]# /usr/local/php5.6/sbin/php-fpm reload
[06-Sep-2018 18:19:35] NOTICE: PHP message: PHP Warning:  PHP Startup: redis: Unable to initialize module
Module compiled with module API=20100525PHP    compiled with module API=20131226These options need to match
 in Unknown on line 0Usage: php-fpm [-n] [-e] [-h] [-i] [-m] [-v] [-t] [-p <prefix>] [-g <pid>] [-c <file>] [-d foo[=bar]] [-y <file>] [-D] [-F [-O]]
  -c <path>|<file> Look for php.ini file in thisdirectory
  -n               No php.ini file will be used
  -d foo[=bar]     Define INI entry foo with value 'bar'
  -e               Generate extended information for debugger/profiler
  -h               This help
  -i               PHP information
  -m               Show compiled inmodules
  -v               Version number
  -p, --prefix <dir>Specify alternative prefix path to FastCGI process manager (default: /usr/local/php5.6).
  -g, --pid <file>Specify the PID file location.
  -y, --fpm-config <file>Specify alternative path to FastCGI process manager config file.
  -t, --test       Test FPM configuration and exit
  -D, --daemonize  force to run in background, and ignore daemonize option fromconfig file
  -F, --nodaemonize
                   force to stay in foreground, and ignore daemonize option fromconfig file
  -O, --force-stderr
                   force output to stderr in nodaemonize even if stderr isnot a TTY
  -R, --allow-to-run-as-root
                   Allow pool to run as root (disabled by default)

我是在安装redis的时候碰到类似问题,当时没有记录,因为很快就被修复了,说一说出现这个问题的原因,只有一个:
你下载的拓展和你的php版本不符合!

phpinfo里面的重要信息,nts,x86

当我们使用phpinfo的时候,多数时候都是在看模块有没有装上,但是其他重要信息却忽略了,例如,为啥我的拓展老是装不上,下载的拓展上面一长串啥意思?nts x86 5.5等等,这些都是重要的信息,对于安装拓展来说尤其重要!
这里写图片描述

上面的几个重要参数:

1 compiler :编译器
2 Architecture :CPU架构
3 Configuration File (php.ini) Path :php配置文件的位置,这里才是你的配置文件加载的真正地方,apache的同学小心了!
4 Thread Safety :线程安全与否
5 PHP Extension Build :php拓展建立的编号

以上几个参数关系到你能不能装上拓展,要认真看!下载拓展.dll文件的时候很多选项,那里面的选项就和这里的对应!
例如下面:
随便取一个来分析下:

1 php_igbinary-1.2.1-5.3-nts-vc9-x86.zip

意思是:1.2.1版本的php_igbinary拓展,适合的php版本是5.3及以上,vc9编译的这个拓展,,不支持线程安全,可以用在x86 cpu架构上,注意64位的机器也可以用!但是反过来就不行了。

这里写图片描述

是不是清楚很多了?我是在安装redis的时候碰到这个问题的。

免责声明:文章转载自《PHP Warning: PHP Startup: redis: Unable to initialize module Windows版本phpredis扩展》仅用于学习参考。如对内容有疑问,请及时联系本站处理。

上篇C# 共享内存(转)数据库编程基本练习题下篇

宿迁高防,2C2G15M,22元/月;香港BGP,2C5G5M,25元/月 雨云优惠码:MjYwNzM=

相关文章

php倒序显示中英文字符串

前面我们有讲过,使用php倒序显示字符串。 最后有提到,如果是中文的时候会乱码。 今天分享的就是“解决倒序显示中文字符串而不出现乱码”的问题。 function descstr($str){ $len=strlen($str); //函数返回字符串的长度: $newstr=""; for($i=$le...

PHP socket 接收 java端口 netty 网络字节序

java 服务端测试代码: @Override public void write(ChannelHandlerContext ctx, Object msg, ChannelPromise promise) throwsException { buffer.writeShort(5); buffer.writeI...

黄聪:PHP字符串操作(string替换、删除、截取、复制、连接、比较、查找、包含、大小写转换、切割成数组等)

一、字符串替换 str_replace("iwind", "kiki", "i love iwind, iwind said"); 将输出 "i love kiki, kiki said" str_replace(find,replace,string,count)参数 描述  find 必需。规定要查找的值。 replace 必需。规定替换 find...

php 在docker 中使用composer 报内存溢出的解决方法

最近 需要用到有盟的推送,不想自己写,准备在github上面找个来改改,本地用的环境是docker 镜像,然后在docker 中 composer 时的时候,报了一个错 docker exec -it www /bin/bash root@85c8ee9b5e27:/var/www/html/newyouchengdu# composer require...

php中mysql数据库操作类 -李盛鹏 -博客园

本白演示的代码属于较为简单的数据库封装类,较适合初学。因为水平有限,见谅。 接着稍微说说整体的思路。整个类的封装,包含一个连接数据库的私有属性$conn和若干操作函数。$conn在对象实例化的时候,由构造函数处理传入的参数后返回一个资源型的连接句柄。而后即可通过调用该实例化的对象的相应方法对数据库进行增删查改的操作。 talk less and show...

laravel excel 导入

<pre name="code" class="php"> /**       * 导入       * 保存       * fyj       */       public function importexambank(Request $request)       {              // dd($examfilename...