Home >Backend Development >PHP7 >How to install php7 fpm on mac

How to install php7 fpm on mac

藏色散人
藏色散人Original
2022-01-18 09:44:183778browse

How to install php7 fpm on mac: 1. Install Homebrew; 2. Install PHP7.1 through "brew install php@7.1"; 3. Load and start PHP-FPM; 4. Install Nginx; 5. Install extensions That’s it.

How to install php7 fpm on mac

The operating environment of this article: macOS10.15 system, PHP7.1 version, macbook pro 2020 computer

Install MNMP under Mac ( Nginx PHP7) Environment

Install Homebrew

Open the terminal and enter

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

, then you can use

brew install ****

to install what you need Depend on it.


Install PHP7.1 (FPM method)

brew install php@7.1

Since OSX already comes with its own PHP environment, you need to modify the system path and run the version installed by brew first. In Add to ~/.bashrc:

export PATH="/usr/local/bin:/usr/local/sbin:$PATH"

Loading and starting of PHP-FPM

After installation, you can start and stop php-fpm through the following commands

php-fpm -D
killall php-fpm

Install Nginx

brew install nginx

After installation, you can start and shut down through

nginx
nginx -s quit

, and also support operations such as reloading configuration files

nginx -s reload|reopen|stop|quit

Start at this time After installing php-fpm and starting Nginx, you can run the php program through http://localhost


Install the extension

Use pecl to install

/usr/local/Cellar/php\@7.1/7.1.23/pecl install redis
/usr/local/Cellar/php\@7.1/7.1.23/pecl install mongodb
/usr/local/Cellar/php\@7.1/7.1.23/pecl install memcahced

Use it directly after installation. There is no need to configure the php.ini file (it has been automatically configured^_^).

Recommended learning: "PHP Video Tutorial"

The above is the detailed content of How to install php7 fpm on mac. For more information, please follow other related articles on the PHP Chinese website!

Statement:
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