Use homebrew to switch PHP versions and manage PHP extensions ____php

Source: Internet
Author: User
Tags install php redis
Toggle PHP Version:
Brew Install php-[version]

[Version]=56|70 etc

Brew Unlink php-Previous version

Brew Link php-now version

The appropriate configuration is to manage PHP extensions in/usr/local/etc/php/:

First: Brew Tap homebrew/php

View related extensions: Brew search

Installation expansion: Brew install php-[version]-extension name

such as: Brew Install Php56-redis

Uninstall expansion: Brew Uninstall php-[version]-expand name

Delete the appropriate profile: Rm-rf/usr/local/etc/php/5.6/conf.d/ext-imagick.ini

Note: If you need to install pthreads and so on, because this kind of expansion relies on PHP zts version (Zend thread Safety), and Brew By default install NTS version (Thread Safety), will cause expansion and PHP version conflict. At this point, you can only iterate from the source code, that is, add--build-from-source to the installation command such as Brew install--build-from-source Php56-redis

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.