Home > Backend Development > PHP Tutorial > MAC MAMP adds memcache extension

MAC MAMP adds memcache extension

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
Release: 2016-07-29 09:13:11
Original
1147 people have browsed it

The PHP used on mamp is 5.5.26, etc. To compile the memcache module, you need to use the php source code. mamp does not come with it. Go to the php official website and download php-5.5.26.tar.gz.

After decompressing, generate zend_config.h Backup

tar -zxvf php-5.5.26.tar.gz
cd php-<span>5.5</span>.<span><span>26</span></span><span>
.</span>/configure
Copy after login

If an error is reported, you need to install dependencies according to the prompts. For example: zlib. Download it separately and decompress it in the same way. --prefix-dir=

Set the path

Download and compile:

MAC MAMP 增加 memcache 扩展

curl -O http:<span>//</span><span>pecl.php.net/get/memcache-2.2.4.tgz;</span><span>tar</span> xf memcache-<span>2.2</span>.<span>4</span><span>.tgz;
cd memcache</span>-<span>2.2</span>.<span>4</span><span>;
mkdir /<strong>Application</strong>s/MAMP/bin/php/php5.5.10/include/
</span>
Copy after login
<span># </span>/Volumes/SOFT/php-5.5.11 是 php 的目录
Copy after login
<span>ln -s /Volumes/SOFT/php-5.5.11 /<strong>Application</strong>s/MAMP/bin/php/php5.5.10/include/php

</span>
Copy after login
/<strong>Application</strong>s/MAMP/bin/php/php5.<span>5.10</span>/bin/<span>phpize;
.</span>/configure  --with-php-c/MAMP/bin/php/php5.<span>5.10</span>/bin/php-<span>config
</span><span>make</span><span>sudo</span><span>make</span><span>install</span>
Copy after login

MAC MAMP 增加 memcache 扩展

If the prompt is as follows, it means that the system does not have autoconf and needs to be installed. After installation, re-execute phpize:

Cannot <span>find</span><span> autoconf. Please check your autoconf installation and the
$PHP_AUTOCONF environment variable. Then, rerun this script.</span>
Copy after login

Install autoconf and install:

curl -O http:<span>//</span><span>ftp.gnu.org/gnu/autoconf/autoconf-2.68.tar.bz2;</span><span>tar</span> -xvf autoconf-<span>2.68</span>.<span>tar</span><span>.bz2
cd autoconf</span>-<span>2.68</span><span>
.</span>/configure && <span>make</span><span>sudo</span><span>make</span><span>install</span>
Copy after login

The installation is now complete, click the mamp menu , file->edit template -> php -> php 5.5.10 php.ini , added:

<span>[memcache]
 extension</span>=memcache.so
Copy after login

The above introduces the memcache extension added to MAC MAMP, including the application content. I hope it will be helpful to friends who are interested in PHP tutorials.

Related labels:
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
Latest Issues
php data acquisition?
From 1970-01-01 08:00:00
0
0
0
PHP extension intl
From 1970-01-01 08:00:00
0
0
0
How to learn php well
From 1970-01-01 08:00:00
0
0
0
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template