版權聲明:經驗之談,不知能否換包辣條,另,轉載請注明出處。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=20100525 PHP compiled with module API=20131226 These options need to match in Unknown on line 0 Usage: 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 this directory -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 in modules -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 from config file -F, --nodaemonize force to stay in foreground, and ignore daemonize option from config file -O, --force-stderr force output to stderr in nodaemonize even if stderr is not 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的時候碰到這個問題的。