Mac installs PHP and Redis extensions

Source: Internet
Author: User

Mac has a specific package management tool homebrew, also known as Brew, where the PHP installation is the brew

1 Installing PHP

Brew install [email protected].

BRW installation will automatically manage dependencies, so you don't have to install dependencies first.

After the installation is complete, two echo statements will be used to set the PHP path to the environment variable path.

2 Installing the Redis extension

On the internet for half a day, a lot of people use: Brew Install Php70-redis installed successfully, I have not been successful here, can not find the package. Later, it was installed with the source code, see the following steps:

  

Download Php-redis, Address: Https://nodeload.github.com/nicolasff/phpredis/zip/master

Extract:tar -zxvf phpredis-master.zip

Access directory: CD Phpredis-master

Execute phpize:/usr/local/cellar/php\@7.0/7.0.29_1/bin/phpize//Note here is the PHP phpize you want to install

Compile:./configure --with-php-config=/usr/bin/php-config  // 如果只有一个php就直接./configure;如果有多个php版本就选需要安装扩展的那个php-config

Installation: Make && make install

Add extension to profile: Open php config file/etc/php.ini, add codeextension=redis.so (如果找不到php.ini文件执行php --ini找到php.ini)

Then restarting FPM has the redis extension.

  

Mac installs PHP and Redis extensions

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.