PHP Startup redis: Unable to initialize module deinitialize 夢三國initialize oleinitializ

來源:互聯網
上載者:User
最近在做php串連redis的實驗,遇到一個問題文法是php代碼直接使用php命令來測試是沒有問題的。使用lnmp環境也是沒有問題的,但是lamp就是不可以,最後查看http的日誌終於找到問題所在了。

php測試代碼如下:


"; print $_SESSION['TEST3']; print "



"; 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

1461514249



r05vrgop80r2f75t91ss1a2lv5

以上就介紹了PHP Startup redis: Unable to initialize module,包括了initialize,startup方面的內容,希望對PHP教程有興趣的朋友有所協助。

  • 聯繫我們

    該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

    如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.