[Ubuntu] How to install memcache in Ubuntu 10.10 with xampp

[Ubuntu] How to install memcache in Ubuntu 10.10 with xamppWhatineedtodownload:zlib-1.2.5.tar.gzhttp://zlib.net/zlib-1.2.5.tar.gzlibxml2-2.7.2.tar.gzftp://xmlsoft.org/libxml2/libxml2-2.7.2.tar.gzphp-5.3.4.tar.bz2http://ar.php.net/distributions/php-5.3.4.t…

大家好,又见面了,我是你们的朋友全栈君。

What i need to download:
zlib-1.2.5.tar.gz
http://zlib.net/zlib-1.2.5.tar.gz
libxml2-2.7.2.tar.gz
ftp://xmlsoft.org/libxml2/libxml2-2.7.2.tar.gz
php-5.3.4.tar.bz2
http://ar.php.net/distributions/php-5.3.4.tar.bz2
memcache-2.2.6.tgz
http://pecl.php.net/get/memcache-2.2.6.tgz
libevent-2.0.10-stable.tar.gz
http://www.monkey.org/~provos/libevent-2.0.10-stable.tar.gz
memcached-1.4.5.tar.gz
http://memcached.googlecode.com/files/memcached-1.4.5.tar.gz

All the files above are locate in /home/davidhhuan/Software 

 

1. Install the libevent-2.0.10-stable.tar.gz 

cd 
/
home
/
davidhhuan
/
Software
tar zxf libevent


2.0
.
10

stable.tar.gz
cd libevent


2.0
.
10

stable
.

/
configure
sudo make
sudo make instsall

 

2. Install memcached-1.4.5.tar.gz 

cd 
/
home
/
davidhhuan
/
Software
tar zxf memcached


1.4
.
5
.tar.gz
cd memcached


1.4
.
5

.

/
configure
sudo make
sudo make install

  

3. Install memcache-2.2.6.tgz 

cd 
/
home
/
davidhhuan
/
Software
tar zxf memcache


2.2
.
6
.tgz
cd memcache


2.2
.
6


/
opt
/
lampp
/
bin
/
phpize

Ok, here i got these error: 

[Ubuntu] How to install memcache in Ubuntu 10.10 with xampp
ExpandedBlockStart.gif
代码

grep: 
/
opt
/
lampp
/
include
/
php
/
main
/
php.h: No such file or directory
grep: 

/
opt
/
lampp
/
include
/
php
/
Zend
/
zend_modules.h: No such file or directory
grep: 

/
opt
/
lampp
/
include
/
php
/
Zend
/
zend_extensions.h: No such file or directory
Configuring 

for
:
PHP Api Version:
Zend Module Api No:
Zend Extension Api No:

That is because i am using xampp, and xampp does NOT provide these files which only exist in php directory! Thought I don’t want to install another php in my host, but i still have to compile it to get the files, please follow the step 4. 

 

4. Compile php5 

cd 
/
home
/
davidhhuan
/
Software
tar zxf php


5.3
.
4
.tar.bz2
cd php


5.3
.
4

.

/
configure

Too bad, when i try to compile the php5, that said i don’t have the libxml2! ok, see the step 5 

 

5. Install libxml2-2.7.2.tar.gz 

cd 
/
home
/
davidhhuan
/
Software
tar zxf libxml2


2.7
.
2
.tar.gz
cd libxml2


2.7
.
2

.

/
configure
sudo make
sudo make install

 

6. Install php-5.3.4 again 

cd 
/
home
/
davidhhuan
/
php

5.3
.
4

.

/
configure
sudo make
sudo make install

  

7. Move the php files to xampp 

After step 6, the included php files are located in /usr/local/include, follow it 

sudo cp 

rf 
/
usr
/
local
/
include
/
php 
/
opt
/
lampp
/
include
/
php

 

8. Install memcache-2.2.6 again

cd 
/
home
/
davidhhuan
/
Software
/
memcache

2.2
.
6


/
opt
/
lampp
/
bin
/
phpize

OMG, i still met some errors: 

[Ubuntu] How to install memcache in Ubuntu 10.10 with xampp
ExpandedBlockStart.gif
代码

PHP Api Version:         
20041225

Zend Module Api No:      

20060613

Zend Extension Api No:   

220060519

Cannot find autoconf. Please check your autoconf installation and the 

$PHP_AUTOCONF
 environment variable is set correctly and then rerun this script.

so, i have to install autoconf, see step 9 

 

9. Install autoconf 

[Ubuntu] How to install memcache in Ubuntu 10.10 with xampp
ExpandedBlockStart.gif
代码

cd 
/
usr
/
src
sudo wget http:

//
ftp.gnu.org
/
gnu
/
m4
/
m4

1.4
.
9
.tar.gz
sudo tar 


zvxf m4

1.4
.
9
.tar.gz
cd m4


1.4
.
9
/

.

/
configure 
sudo make
sudo make install
cd ..

/

sudo wget http:

//
ftp.gnu.org
/
gnu
/
autoconf
/
autoconf

2.62
.tar.gz
sudo tar 


zvxf autoconf

2.62
.tar.gz
cd autoconf


2.62
/

.

/
configure
sudo make
sudo make install

 

10. Install memcache-2.2.6 again again! 

cd 
/
home
/
davidhhuan
/
Software
/
memcache

2.2
.
6


/
opt
/
lampp
/
bin
/
phpize
.

/
configure

-_-! I met errors: 

[Ubuntu] How to install memcache in Ubuntu 10.10 with xampp
ExpandedBlockStart.gif
代码

checking 
for
 the location of ZLIB… no
checking 

for
 the location of zlib… configure: error: memcache support requires ZLIB. Use 

with

zlib

dir
=
<DIR
>
 to specify prefix where ZLIB include and library are located
No problem, just install zlib

 

Go, go, go, step 11 can help you! :) 

 

11. Install zlib-1.2.5.tar.gz 

cd 
/
home
/
davidhhuan
/
Software
tar zxf zlib


1.2
.
5
.tar.gz
cd zlib


1.2
.
5

.

/
configure
sudo make
sudo make install

 

12. Install memcache-2.2.6 again again again! 

cd 
/
home
/
davidhhuan
/
Software
/
memcache

2.2
.
6

.

/
configure
sudo make
sudo make install

Thank goodness! At last i can compile outthe memcache.so, that is the message: 

Installing shared extensions:     
/
usr
/
local
/
lib
/
php
/
extensions
/
no

debug

non

zts

20090626
/

  

13. Copy the memcache.so to xampp 

sudo cp 
/
usr
/
local
/
lib
/
php
/
extensions
/
no

debug

non

zts

20090626
/
memcache.so 
/
opt
/
lampp
/
lib
/
php
/
extensions
/
no

debug

non

zts

20090626
/
memcache.so

 

14. Configure the php.ini 

extension
=
memcache.so

 

15. Configure the service of memcache

a. start the memcache server.

/
usr
/
bin
/
memcached 




100
 

u davidhhuan 


127.0
.
0.1
 


11211
 


256
 


/
tmp
/
memcached.pid
 

  -d: set to daemon 

  -m: max running memory, units:MB

  -u: the user of memcached

  -l: the server IP

  -p: the port

  -c: The maximum number of simultaneous connections running, default is 1024

  -P: the file to save the memcache

b. stop the server.

kill ‘cat 
/
tmp
/
memcached.pid’

 

You can also start multi thread to run the server, the port must be different. 

c. Restart the apache.

sudo 
/
opt
/
lampp
/
lampp restart

 

 

Example:

<?
php

$mem
 
=
 
new
 Memcache;

$mem
->
connect(

127.0.0.1

,
 
11211
);

$mem
->
set(

key

,
 

This is a test!

,
 
0
,
 
60
);

$val
 
=
 
$mem
->
get(

key

);

echo
 
$val
;

?>

 

 

 

All are done!

Hope this article will help you to install the memcache! 

 

 

版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 举报,一经查实,本站将立刻删除。

发布者:全栈程序员-用户IM,转载请注明出处:https://javaforall.cn/139402.html原文链接:https://javaforall.cn

【正版授权,激活自己账号】: Jetbrains全家桶Ide使用,1年售后保障,每天仅需1毛

【官方授权 正版激活】: 官方授权 正版激活 支持Jetbrains家族下所有IDE 使用个人JB账号...

(0)
blank

相关推荐

  • Android 代码混淆规则

    Android 代码混淆规则1.Proguard介绍AndroidSDK自带了混淆工具Proguard。它位于SDK根目录\tools\proguard下面。ProGuard是一个免费的Java类文件收缩,优化,混淆和预校验器。它可以检测并删除未使用的类,字段,方法和属性。它可以优化字节码,并删除未使用的指令。它可以将类、字段和方法使用短无意义的名称进行重命名。最后,预校验的Java6或针对JavaMicroEdi…

  • 编程xml速度最快的语言_xml语言是什么的缩写

    编程xml速度最快的语言_xml语言是什么的缩写国际化多语言转换工具方案介绍当项目涉及到多语言国际化的时候,我们需要把string.xml翻译成其他国家语言,一般翻译公司会需要excel等格式文档,可是这翻译文件实在是不好整,幸好有大神做了个py工具实现string文件转excel.目前有两种方式:Localizable.strings2Excel(下载源码,然后在终端输入命令跑脚本进行文件转换)作者:CatchZeng,https://github.com/CatchZeng/Localizable.strings2ExcelL

  • pycharm激活码最新2022.01(JetBrains全家桶)「建议收藏」

    (pycharm激活码最新2022.01)JetBrains旗下有多款编译器工具(如:IntelliJ、WebStorm、PyCharm等)在各编程领域几乎都占据了垄断地位。建立在开源IntelliJ平台之上,过去15年以来,JetBrains一直在不断发展和完善这个平台。这个平台可以针对您的开发工作流进行微调并且能够提供…

  • HTTP协议的基础

    HTTP协议的基础HTTP协议HTTP协议一、网络基础1、TCP/IP协议族各层作用应用层传输层网络层链路层2、TCP/IP通信传输流3、关系密切的IP、TCP、DNS协议(3次握手)4、URI和URL二、简单的HTTP协议1、通过请求和响应的交换达成通信2、HTTP是一种无状态协议3、HTTP方法4、持久连接keep-alive5、cookie三、HTTP报文2、用于HTTP协议交互的信息称为HTTP报文2、…

  • java.lang.NoSuchMethodException异常「建议收藏」

    java.lang.NoSuchMethodException异常「建议收藏」在Struts2中,有时候会出现java.lang.NoSuchMethodException异常,有可能是三种情况导致的运行异常:第一种:Action类的方法被定义成private类型.Action中被访问的方法被定义成private类型.程序在访问其方法时,会抛出以上异常。第二种:Action类继承了ActionSupport类时程序在访问其方法时,也会抛出上述异常。第三种…

  • java解析json转Map

    java解析json转Map前段时间在做json报文处理的时候,写了一个针对不同格式json转map的处理工具方法,总结记录如下:1、单节点单层级、单节点多层级json转mapimportjava.util.ArrayList;importjava.util.HashMap;importjava.util.Iterator;importjava.util.List;importjava.util.Map;i

发表回复

您的电子邮箱地址不会被公开。

关注全栈程序员社区公众号