Home Backend Development PHP Tutorial Mac下配置phpredis扩张

Mac下配置phpredis扩张

Jun 13, 2016 pm 12:23 PM
config master php phpredis

Mac下配置phpredis扩展

  最近把开发环境从windows转到Mac下,所有的环境都要重新来配置。由于Mac是基于unix系统的不太熟悉,所以遇到了很多问题。

  安装phpredis扩展:

    首先,大家先下载phpredis的扩展包,地址如下:

    https://nodeload.github.com/nicolasff/phpredis/zip/master(建议大家手动下载再进行复制)。

    然后大家使用命令进入文件夹  

<span style="color: #008080;"> 1</span> cd phpredis-master/  <span style="color: #008080;"> 2</span> <span style="color: #000000;">phpize命令(命令可能会出问题,解决方法请见文章尾部)</span><span style="color: #008080;"> 3</span> ./configure --with-php-config=/usr/bin/php-<span style="color: #000000;">config</span><span style="color: #008080;"> 4</span> <span style="color: #0000ff;">make</span><span style="color: #008080;"> 5</span> <span style="color: #0000ff;">sudo</span> <span style="color: #0000ff;">make</span> <span style="color: #0000ff;">install</span><span style="color: #000000;"> (依次执行上面的命令)</span><span style="color: #008080;"> 6</span> <span style="color: #000000;"># 这时候会提示一个路径</span><span style="color: #008080;"> 7</span> # /usr/lib/php/extensions/no-debug-non-zts-<span style="color: #800080;">20100525</span>/<span style="color: #008080;"> 8</span> <span style="color: #000000;"># 表示已经将扩展放置在该位置</span><span style="color: #008080;"> 9</span> vim /etc/<span style="color: #000000;">php.ini</span><span style="color: #008080;">10</span> <span style="color: #000000;">#增加如下内容</span><span style="color: #008080;">11</span> extension=<span style="color: #000000;">redis.so</span><span style="color: #008080;">12</span> <span style="color: #000000;">#重启apache</span><span style="color: #008080;">13</span> <span style="color: #0000ff;">sudo</span><span style="color: #000000;"> apachectl restart</span><span style="color: #008080;">14</span> <span style="color: #000000;">#查看扩展安装情况</span><span style="color: #008080;">15</span> php -m |<span style="color: #0000ff;">grep</span><span style="color: #000000;"> redis</span><span style="color: #008080;">16</span> #出现 redis 表示安装成功
Copy after login

请注意执行phpize 命令可能会出错请参考:http://www.cnblogs.com/tianshuowang/p/4686156.html

参考:http://my.oschina.net/Twitter/blog/287544

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 AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

AI Hentai Generator

AI Hentai Generator

Generate AI Hentai for free.

Hot Article

R.E.P.O. Energy Crystals Explained and What They Do (Yellow Crystal)
2 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
Repo: How To Revive Teammates
1 months ago By 尊渡假赌尊渡假赌尊渡假赌
Hello Kitty Island Adventure: How To Get Giant Seeds
4 weeks ago By 尊渡假赌尊渡假赌尊渡假赌

Hot Tools

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)

CakePHP Project Configuration CakePHP Project Configuration Sep 10, 2024 pm 05:25 PM

In this chapter, we will understand the Environment Variables, General Configuration, Database Configuration and Email Configuration in CakePHP.

PHP 8.4 Installation and Upgrade guide for Ubuntu and Debian PHP 8.4 Installation and Upgrade guide for Ubuntu and Debian Dec 24, 2024 pm 04:42 PM

PHP 8.4 brings several new features, security improvements, and performance improvements with healthy amounts of feature deprecations and removals. This guide explains how to install PHP 8.4 or upgrade to PHP 8.4 on Ubuntu, Debian, or their derivati

CakePHP Date and Time CakePHP Date and Time Sep 10, 2024 pm 05:27 PM

To work with date and time in cakephp4, we are going to make use of the available FrozenTime class.

CakePHP File upload CakePHP File upload Sep 10, 2024 pm 05:27 PM

To work on file upload we are going to use the form helper. Here, is an example for file upload.

CakePHP Routing CakePHP Routing Sep 10, 2024 pm 05:25 PM

In this chapter, we are going to learn the following topics related to routing ?

Discuss CakePHP Discuss CakePHP Sep 10, 2024 pm 05:28 PM

CakePHP is an open-source framework for PHP. It is intended to make developing, deploying and maintaining applications much easier. CakePHP is based on a MVC-like architecture that is both powerful and easy to grasp. Models, Views, and Controllers gu

How To Set Up Visual Studio Code (VS Code) for PHP Development How To Set Up Visual Studio Code (VS Code) for PHP Development Dec 20, 2024 am 11:31 AM

Visual Studio Code, also known as VS Code, is a free source code editor — or integrated development environment (IDE) — available for all major operating systems. With a large collection of extensions for many programming languages, VS Code can be c

CakePHP Creating Validators CakePHP Creating Validators Sep 10, 2024 pm 05:26 PM

Validator can be created by adding the following two lines in the controller.

See all articles