Home >Backend Development >PHP Tutorial >Install phpredis extension on mac

Install phpredis extension on mac

WBOY
WBOYOriginal
2016-07-29 09:10:591253browse

<code>curl -O https://nodeload cd<code>phpredis-master /<code><strong></strong>phpize<code>

.

<code>/configure <code>--with-php-c/code>/usr/bin/php-config

<code>make<code>

sudo<code> make

install<code><code># At this time, a path will be prompted <code><code>

# /usr/lib/php/extensions/no-debug-non-zts-20100525/

<code>

# indicating that the extension has been placed at that location

<code><code>vim <code>/etc/php

.ini

<code>

#Add the following content

<code>

extension=redis.so

<code>

#Restart apache

<code> <code>sudo <code>apachectl restart

<code>#Check the extension installation status

<code>php -m |

grep

<code>redis

<code>#The appearance of redis means the installation is successful<code>

PS: If an error occurs when executing phpize, handle it in the following way

<code>

Question 1:

<code>Execute phpize and get an error: <code><code>

<code>1

2

3

4

5

6

7

grepsudo

grep

:

/usr/include/php/main/php

.h: No such

file

or directory

:

<code>/usr/include/php/Zend/zend_modules<code>.h: No such <code>file <code>or directory<code><code>grep

:

<code>/usr/include/php/Zend/zend_extensions<code>.h: No such <code>file<code>or directory <code><code>Configuring

for

<code>:<code><code>PHP Api Version:<code><code>Zend Module Api No:<code>

Zend Extension Api No:

<code><code><code>

<code>Solution:

<code>

<code> 1

ln

-s

/

Application

s/ /Developer/SDKs/MacOSX10 Cannot
.9.sdk

/usr/include
/usr/include

<code><code><code><code><strong>PS: Tested and works with Yosemite (10.10) Xcode 6.0.1 (6A317)</strong> Question 2 :<code>If you execute phpize, the following error is prompted:<code><code><code><code>1<code>2<code>

findautoconf. Please check your autoconf installation

and the $PHP_AUTOCONF environment variable.

1

Solution:

First install Homebrew:

<code><pre class="brush:php;toolbar:false">ruby -e &lt;span&gt;&quot;&lt;/span&gt;&lt;span&gt;$(curl -fsSL https://raw.&lt;strong&gt;github&lt;/strong&gt;usercontent.com/Homebrew/install/master/install)&lt;/span&gt;</pre><code><code>Then install autoconf:

<code>

brew

install

autoconf

The above introduces how to install phpredis extension on mac, including Application and github content. I hope it will be helpful to friends who are interested in PHP tutorials.
Statement:
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
Previous article:PHP handles mht filesNext article:PHP handles mht files