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

How to install php7 fpm on mac

藏色散人
Release: 2023-02-18 10:00:02
Original
3837 people have browsed it

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)"
Copy after login

, then you can use

brew install ****
Copy after login

to install what you need Depend on it.


Install PHP7.1 (FPM method)

brew install php@7.1
Copy after login

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"
Copy after login

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
Copy after login

Install Nginx

brew install nginx
Copy after login

After installation, you can start and shut down through

nginx
nginx -s quit
Copy after login

, and also support operations such as reloading configuration files

nginx -s reload|reopen|stop|quit
Copy after login

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
Copy after login

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!

Related labels:
source:php.cn
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
Latest Issues
macos - connect docker mongodb container
From 1970-01-01 08:00:00
0
0
0
macos - install youcompleteme under mac
From 1970-01-01 08:00:00
0
0
0
Can't install Brain.js on macOS
From 1970-01-01 08:00:00
0
0
0
macos - git command line on mac
From 1970-01-01 08:00:00
0
0
0
macos - switch php version on mac
From 1970-01-01 08:00:00
0
0
0
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template