Home>Article>Backend Development> Tutorial on setting up a PHP development environment on Mac (detailed steps)

Tutorial on setting up a PHP development environment on Mac (detailed steps)

不言
不言 forward
2019-03-04 14:47:29 6092browse

This article brings you a tutorial (detailed steps) on setting up a PHP development environment on Mac. It has certain reference value. Friends in need can refer to it. I hope it will be helpful to you.

php's local development environment is very simple to set up. Just start three processes successfully. The steps are as follows:

1. Install the server-side programming language: PHP and start the php-fpm process. ;

php-fpm

2. Install the Web server: Nginx;

2.1 在配置文件 nginx.conf 中添加 FastCGI 模块的配置; 2.2 启动 Nginx 服务器 nginx

3. Install the database: Mysql and start:

mysql.server

At this point, the environment is set up and you can happily develop locally php project.

If you still don’t understand, it’s understandable. Maybe you have some knowledge points that need to be overcome:
1. How to install php nginx and mysql on Mac?

Use brew install * installation, where * refers to either php nginx mysql.

2. What is the php-fpm process?

implements the FastCGI protocol, manages the process of the php interpreter (php-cgi), and is started through the php-fpm process manager.
If you still don’t understand, you can refer to: https://segmentfault.com/a/1190000018374234

3. What is the FastCGI module?

FastCGI module is used by Nginx to transfer information with server-side programming languages;
There are many modules in Nginx, just like C has many class libraries, and PHP has many extensions, which can be configured or used as needed;

4. Why use mysql.server instead of mysqld?

Compared with mysqld, the biggest advantage of using msyql.server is:
When an error occurs and the mysql server goes down, it will Automatically restart the mysql server;

5. What is a server?

is not only a physical concept, but also refers to: daemon process in many contexts.

The above is the detailed content of Tutorial on setting up a PHP development environment on Mac (detailed steps). For more information, please follow other related articles on the PHP Chinese website!

Statement:
This article is reproduced at:segmentfault.com. If there is any infringement, please contact admin@php.cn delete