Home > Backend Development > PHP Problem > How to install php environment on macbook

How to install php environment on macbook

藏色散人
Release: 2023-03-03 15:10:01
Original
3870 people have browsed it

How to install the php environment on macbook: first install brew; then install php7.1 through the command "brew install php@7.1"; then install mysql5.7 and nginx; finally start PHP through the start command.

How to install php environment on macbook

Recommendation: "PHP Video Tutorial"

mac installation php environment

Install brew

/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
Copy after login

Install php7.1

brew install php@7.1
Copy after login

Install mysql5.7

brew install mysql@5.7
Copy after login

Install nginx

brew install nginx
Copy after login

Start nginx

brew services start nginx
Copy after login

Start PHP

brew services start php@7.1
Copy after login

Start mysql

brew services start mysql@5.7
/usr/local/opt/mysql@5.7/bin/mysql.server start
Copy after login

php some paths

/usr/local/opt/php@7.1/bin/php
/usr/local/Cellar/php@7.1/7.1.28/bin/phpize
Copy after login

php-fpm configuration file (php running user changes user and group here)

/usr/local/Cellar/php@7.1/7.1.28/.bottle/etc/php/7.1/php-fpm.d/www.conf
php.ini
/usr/local/etc/php/7.1/php.ini
nginx.conf
/usr/local/etc/nginx/nginx.conf
my.cnf
/usr/local/etc/my.cnf
Copy after login

The above is the detailed content of How to install php environment on macbook. 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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template