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

不言
Release: 2023-04-05 14:02:02
forward
6118 people have browsed it

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

2. Install the Web server: Nginx;

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

3. Install the database: Mysql and start:

mysql.server
Copy after login

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!

Related labels:
php
source:segmentfault.com
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
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!