[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! 

 

 

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

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

(0)
全栈程序员-站长的头像全栈程序员-站长


相关推荐

  • 有没有提醒喝水的打卡软件_小爱同学定时打卡

    有没有提醒喝水的打卡软件_小爱同学定时打卡本文方案来自CSDN博主「机灵鹤」方案详情可查看原文:https://smartcrane.blog.csdn.net/article/details/121837850本项目实现了一个久坐提醒和喝水提醒的小助手,在检测到连续工作较长时间之后,会打印纸条,提醒我们起身活动一下;在设定的喝水时间到了以后,也会打印纸条,提醒我们去喝水。项目用到的硬件设备有:硬件都备的差不多了,在开发时我遇到了一个比较棘手的问题,就是咕咕机跟人体传感器它也不是同一家的设备啊!虽然两家都有各自的控制APP,但是它们毕竟是两套系

    2022年10月1日
    2
  • windows服务器解决挖矿程序问题

    windows服务器解决挖矿程序问题windows服务器解决挖矿程序问题

    2022年6月17日
    26
  • 用AVX2指令集优化整形数组求和

    用AVX2指令集优化整形数组求和用AVX2指令集优化高精度加法一、AVX2指令集介绍二、代码实现1.普通高精度加法2.AVX2加速高精度加法3.实现细节说明三、性能测试测试环境计时方式测试内容测试命令测试结果四、总结个人推断原因:一、AVX2指令集介绍AVX2是SIMD(单指令多数据流)指令集,支持在一个指令周期内同时对256位内存进行操作。包含乘法,加法,位运算等功能。下附Intel官网使用文档。Intel®IntrinsicsGuide我们本次要用到的指令是__m256i_mm256_add_epi8(__m2

    2022年5月7日
    50
  • oracle怎么锁表以及解锁,Oracle锁表与解锁

    oracle怎么锁表以及解锁,Oracle锁表与解锁本文讲解如何查询Oracle中锁表的Session,并如何杀掉锁表进程.查看锁表语句:方法1:selectsess.sid,sess.serial#,lo.oracle_username,lo.os_user_name,ao.object_name,lo.locked_modefromv$locked_objectlo,dba_objectsao,v$sessionsesswherea…

    2022年6月17日
    83
  • Pycharm 字体大小及背景颜色的设置

    Pycharm 字体大小及背景颜色的设置设置Pycharm的字体大小及背景颜色Pycharm设置字体的大小及风格选择File–>setting–>Editor–>Font,我们可以看到如下图所示界面,我们就可以根据自己的喜好随意调整字体的大小,字体的样式风格,文字行间距,设置之后的的效果在下面的窗口可以实时预览,调整和设置都比较方便。Pycharm设置背景颜色选择File–>…

    2022年8月26日
    7
  • C++sstream

    C++sstream#include<iostream>#include<stdio.h>#include<algorithm>#include<vector>#include<cstring>#include<sstream>#include<strstream>#include<queue>using…

    2022年6月4日
    27

发表回复

您的邮箱地址不会被公开。 必填项已用 * 标注

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