Install Apache and PHP via brew under Mac

Source: Internet
Author: User
Tags install brew

The Mac comes with php5.6, and here's what to do if you want to upgrade to php7.1.

1. Install Brew

https://brew.sh/(the official website is provided with the installation command recommended)

" $ (curl-fssl https://raw.githubusercontent.com/Homebrew/install/master/install) "

2, the installation after the introduction of the Brew command (this is very important, do not skip)

Brew Update#Update Brew installable packages, it is recommended to execute each timeBrew Search Php71#Search php7.1Brew Tap josegonzalez/php#Install extensions <gihhub_user/repo>Brew Tap#View the list of installed extensionsBrew Install php71#Installing php7.1Brew Remove php71#Uninstalling php7.1Brew Upgrade Php71#Upgrade php7.1Brew Options Php71#View php7.1 installation optionsBrew Info php71#View php7.1 Related informationBrew Home php71#Visit php7.1 official websiteBrew Services List#View System-installed services through brewBrew Services Cleanup#clear uninstalled unused boot configuration filesBrew Services Restart PHP71#Restart php-fpm

3. PHP Installation

Add PHP Extension

Brew updatebrew Tap homebrew/dupesbrew tap homebrew/phpbrew tap Josegonzalez/homebrew-php
#先查询php71安装的选项. The options that follow determine whether PHP generates PHP7 extensions.
Brew Options Php71
--with-apache  Brew options php71 option, do not choose the wrong. 
Brew Install php71--with-apache

Ruby-e"$ (curl-fssl https://raw.githubusercontent.com/Homebrew/install/master/install)"

Install Apache and PHP via brew under Mac

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.