1. 程式人生 > >nginx+php+memcache Fatal error: Class 'Memcache' not found

nginx+php+memcache Fatal error: Class 'Memcache' not found

安裝過程:

(nginx+php已經安裝完成,僅寫與memcache相關步驟)

[[email protected] src]# yum install libevent libevent-devel

[[email protected] src]# wget http://pecl.php.net/get/memcache-2.2.5.tgz

[[email protected] src]# tar zxvf memcache-2.2.5.tgz

[[email protected] src]# cd memcache-2.2.5

[[email protected]

src]# ./configure --enable-memcache --with-php-config=/opt/php/bin/php-config

[[email protected] src]# make && make install

完成後會有“Installing shared extensions: /opt/php/lib/php/extensions/no-debug-non-zts-20090626”提示,最後這個值會不一樣

[[email protected] src]# cd /opt/php/etc

[[email protected] src]# vi php.ini


 819行: extension_dir = "/opt/php/lib/php/extensions/no-debug-non-zts-20090626"#(貌似是)

新增:extension=memche.so

[[email protected] src]# vi /var/www/html/test.php

<?php
$mem = new memcache;
$mem->connect ('127.0.0.1', 11211);
$mem->set('test','hello world!', 0, 12);
$val = $mem->get('test');
echo $val;
?>


在瀏覽器中輸入:localhost:8080,

so,問題來了,無法訪問,檢視nginx日誌:


2013/07/09 18:18:13 [error] 3855#0: *84498 FastCGI sent in stderr: "PHP message: PHP Fatal error:  Class 'memcache' not found in /var/www/tjtct/test.php on line 2" while reading response header from upstream, client: 192.168.1.193, server: 192.168.1.242, request: "GET /test.php HTTP/1.1", upstream: "fastcgi://127.0.0.1:9000", host: "192.168.1.242"

解決辦法:

重啟php-fpm

/etc/ini.d/php-fpm restart

重新瀏覽,OK,hello world! 出來了

搞定,結束

相關推薦

PHPFatal error: Class 'COM' not found in … 的解決辦法

1.檢查php目錄ext資料夾下面php_com_dotnet.dll是否存在 2.在php.ini裡面加入以下語句:     [PHP_COM_DOTNET]     extension=php_com_dotnet.dll     如圖所示:     3.php.in

nginx+php+memcache Fatal error: Class 'Memcache' not found

安裝過程: (nginx+php已經安裝完成,僅寫與memcache相關步驟) [[email protected] src]# yum install libevent libevent-devel [[email protected] src]# w

linux 下 Fatal error: Class ‘mysqli’ not found in

linux php5 erro all nbsp csdn -m 我不知道 mysql 先試用這種方法 http://blog.csdn.net/u010429424/article/details/43063211 我不知道自己安裝的php 沒他們路徑,所以用了以下這種方

svnmanager1.09:Fatal error: Class 'PEAR_ErrorStack' not found

之前使用Apache2.4.16+SVN1.7.9+PHP5.6.20+MySQL5.7+SVNManager1.09  一直沒有問題,但是因為安全原因, 升級Apache到2.4.25, PHP到5.6.30, SVN到1.8.17後,使用SVNManager1.09 遇

解決ndk-build : fatal error: 'iostream' file not found

出錯資訊如下: ./helloworld.h:1:10: fatal error: 'iostream' file not found #include <iostream>      

解決 LLVM 錯誤 fatal error: ‘csignal’ file not found

/Users/exchen/Downloads/Unity-iPhone/Classes/main.mm:3:10: fatal error: ‘csignal’ file not found#include ^~~~~~~~~1 error generated.————————–解決方法:由於專案

解決php編譯報錯configure: error: mcrypt.h not found. Please reinstall libmcrypt.

clas fig ati libmcrypt conf data -s blog bmc yum install -y epel-releaseyum install -y libmcrypt-devel 解決php編譯報錯configure: error: m

DVWA System error - config file not found.

dvwa訪問DVWA時,出現錯誤提示,如下所示:訪問DVWA時,頁面無法顯示,出現錯誤提示,如下所示:DVWA System error - config file not found. Copy config/config.inc.PHP.dist to config/config.inc.php and

java.sql.SQLException: Column 'class' not found.異常沒有找到列

null getbean pre ret tac ram getprop 類型 string 1 /**處理當個對象的 ,rs中要麽有一條,要麽一條沒有。 2 * @param <T> 3 */ 4 public class BeanHandl

Lr運行錯誤Error: Socket descriptor not found. Hint: the problem might be

disable desc mis blog general ner time set tro 在controller中,運行時,報如下錯誤“Error: Socket descriptor not found. Hint: the problem might be sol

Class ‘mysqli’ not found in解決辦法

數據 出現 代碼 mysq name l數據庫 dll 數據庫 .dll 在使用 $conn = new mysqli($servername, $username, $password); 連接msql數據庫的時候出現錯誤:【Fatal error: C

編譯安裝zabbix error: MySQL library not found

編譯安裝zabbix error編譯安裝zabbix error: MySQL library not found 本人用編譯方式安裝的mysql ,用編譯安裝zabbix 時,使用的編譯選項為./configure --prefix=/usr/local/zabbix --enable-server --e

命令行下class redis not found 解決

img 一個 ima info inf 圖片 命令行 HP pin 1.在命令行下輸入 php --ini 2.在瀏覽器中查看 phpinfo() 可以看出,我 的phpinfo和命令行的就不是一個php.ini文件。因為我有幾個版本的php , 並且在環境變量中

xvfb-run: error: xauth command not found 解決方式

http com IT erro then and found cpp run http://tokanao.com/blog/2016/07/13/blog.html 錯誤提示 array(2) { [0]=> string(27) "which: no

Hexo - ERROR Local hexo not found in xxx

height AR spa 解決 idt .net HR 新的 wid 1.出現的問題   執行 hexo d 和 hexo g 時報錯。      此時可參考此鏈接或此鏈接 2.若上述鏈接不能解決問題,很可能是因為你的node.js的版本過低,請重新安裝更新的版本。   

Xcode10 clang error:library not found for -lstdc++.6.0.9

Xcode升級到10.0之後,編譯報錯 蘋果於北京時間6月5號凌晨,向開發者提供MacOS、iOS、WatchOS、TvOS四大系統更新,Xcode10 beat版不負眾望,繼續延續了歷史,新版本仍然出問題了。 1、找到報錯 --> 右鍵 --> Reveal in Log。

訪問本地php檔案一直報404 file not found錯誤(已解決)

環境是mac + nginx + maysql + php。 在桌面上建立了一個資料夾,路徑是/Users/wyung/Desktop/st,在st資料夾下面有html檔案和php檔案。 用nginx對這個專案分配了介面,訪問地址是http://127.0.0.1:9999/login.ht

安裝zabbix報錯: configure: error: Curl library not found 解決辦法

網上有諸多說法: 1.  yum install mysql-devel -y 2.把--with-mysql改成 --with-mysql=/usr/local/mysql/bin/mysql_config 上面的兩種都沒有解決

瀏覽器訪問IIS伺服器上面的plist檔案報錯 HTTP Error 404 3 - Not Found

分享一下我老師大神的人工智慧教程!零基礎,通俗易懂!http://blog.csdn.net/jiangjunshow 也歡迎大家轉載本篇文章。分享知識,造福人民,實現我們中華民族偉大復興!        

CentOS6.8中安裝Nginx時出現 C compiler gcc is not found問題

已經按照好gcc之後還是會顯示 C compiler gcc is not found問題,嘗試了網上很多安裝gcc的方法都不可用。 1.原因分析: configure首先會編譯一個小測試程式,通過測試其執行結果來判斷編譯器是否能正常工作,由於交叉編譯器所編譯出的程式是無法在編譯主機上執