Home Backend Development PHP Tutorial ubuntu下安装phpredis的模块扩充

ubuntu下安装phpredis的模块扩充

Jun 13, 2016 pm 12:16 PM
color gt quot span style

ubuntu下安装phpredis的模块扩展

1.前提是先安装好redis,然后再安装phpredis。。。

2.先下载phpredis-master.tar.gz安装包。。。

具体详情如下:

<span style="color:#33CC00;"><span style="background-color: rgb(0, 0, 0);">1.tar zxvf phpredis-master.tar.gz </span></span>
Copy after login

<span style="color:#33CC00;"><span style="background-color: rgb(0, 0, 0);">2.cd phpredis-master/</span></span>
Copy after login

<span style="color:#33CC00;"><span style="background-color: rgb(0, 0, 0);">3./opt/lampp/bin/phpize ./configure --with-php-config=/opt/lampp/bin/php-config</span></span>
Copy after login
注意phize和php-config的路径,我的php是在lampp下面,具体路径根据你的php路径来
<span style="color:#33CC00;"><span style="background-color: rgb(0, 0, 0);">4.sudo /opt/lampp/bin/phpize-5.5.15</span></span>
Copy after login
运行到这一步会出现下面问题

<span style="color:#33CC00;"><span style="background-color: rgb(0, 0, 0);">Configuring for:PHP Api Version:         20121113Zend Module Api No:      20121212Zend Extension Api No:   220121212Cannot find autoconf. Please check your autoconf installation and the$PHP_AUTOCONF environment variable. Then, rerun this script.</span></span>
Copy after login

这时就需要安装两个东西

<span style="color:#33CC00;"><span style="background-color: rgb(0, 0, 0);">5.sudo apt-get install m4</span></span>
Copy after login
如果安装过程中出现以下错误

<span style="color:#33CC00;"><span style="background-color: rgb(0, 0, 0);">dpkg: error processing package install-info (--unpack): 子进程 已安装 post-installation 脚本 返回了错误号 127在处理时有错误发生: install-infoE: Sub-process /usr/bin/dpkg returned an error code (1)</span></span>
Copy after login

则在这里有解决办法:http://blog.csdn.net/hearain528/article/details/44173069

然后重新安装即可成功安装m4...

<span style="color:#33CC00;"><span style="background-color: rgb(0, 0, 0);">6.sudo apt-get install autoconf</span></span>
Copy after login
如果也出现上面5的问题,则和第5步的解决办法一样。。。

<span style="color:#33CC00;"><span style="background-color: rgb(0, 0, 0);">7.sudo /opt/lampp/bin/phpize-5.5.15 </span></span>
Copy after login

<span style="color:#33CC00;"><span style="background-color: rgb(0, 0, 0);">8.sudo ./configure --with-php-config=/opt/lampp/bin/php-config</span></span>
Copy after login

<span style="color:#009900;"><span style="background-color: rgb(0, 0, 0);">9. sudo make</span></span>
Copy after login

<span style="color:#33CC00;"><span style="background-color: rgb(0, 0, 0);">10.sudo make install    Installing shared extensions: /opt/lampp/lib/php/extensions/no-debug-non-zts-20121212/    </span></span>
Copy after login
上面出现的路径则是redis.so的路径,然后在php.ini里面增加

<span style="color:#33CC00;"><span style="background-color: rgb(0, 0, 0);">11.extension="/opt/lampp/lib/php/extensions/no-debug-non-zts-20121212/redis.so"</span></span>
Copy after login

然后重启服务器,或者重启php,然后运行phpinfo.php查看phpredis扩展是否安装成功。。。


Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot Article Tags

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

What are the differences between Huawei GT3 Pro and GT4? What are the differences between Huawei GT3 Pro and GT4? Dec 29, 2023 pm 02:27 PM

What are the differences between Huawei GT3 Pro and GT4?

How to modify element.style How to modify element.style Nov 24, 2023 am 11:15 AM

How to modify element.style

Fix: Snipping tool not working in Windows 11 Fix: Snipping tool not working in Windows 11 Aug 24, 2023 am 09:48 AM

Fix: Snipping tool not working in Windows 11

What are the new features in Vue3 style and how to use them What are the new features in Vue3 style and how to use them May 14, 2023 pm 10:52 PM

What are the new features in Vue3 style and how to use them

How to dynamically modify style in react How to dynamically modify style in react Dec 28, 2022 am 10:44 AM

How to dynamically modify style in react

How to Fix Can't Connect to App Store Error on iPhone How to Fix Can't Connect to App Store Error on iPhone Jul 29, 2023 am 08:22 AM

How to Fix Can't Connect to App Store Error on iPhone

php提交表单通过后,弹出的对话框怎样在当前页弹出,该如何解决 php提交表单通过后,弹出的对话框怎样在当前页弹出,该如何解决 Jun 13, 2016 am 10:23 AM

php提交表单通过后,弹出的对话框怎样在当前页弹出,该如何解决

Vue error: Unable to use v-bind to bind class and style correctly, how to solve it? Vue error: Unable to use v-bind to bind class and style correctly, how to solve it? Aug 26, 2023 pm 10:58 PM

Vue error: Unable to use v-bind to bind class and style correctly, how to solve it?

See all articles