Home > Backend Development > PHP Tutorial > Start nginx and php on Mac system boot

Start nginx and php on Mac system boot

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
Release: 2016-07-29 09:15:47
Original
1018 people have browsed it

I won’t go into details about the installation steps of nginx and php. It’s my first time using a MAC system and I don’t know much about it. Of course I’ve also looked at Baidu. Seeing that other people’s articles are not very detailed, I’ll write an article myself.

Step 1:

Enter the /Library/LaunchDaemons/ directory and use vim to create a file named com.nginx.plist. Save and exit. The content of the file is as follows:

<?xml version="1.0" encoding="UTF-8"?>

<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
	<key>Label</key>
	<string>com.nginx.plist</string>
	<key>ProgramArguments</key>
	<array>
		<string>/usr/local/nginx/sbin/nginx</string>  // nginx启动目录
	</array>
	<key>KeepAlive</key>
	<false/>
	<key>RunAtLoad</key>
	<true/>
	<key>StandardErrorPath</key>
	<string>/usr/local/nginx/logs/error.log</string>  // 错误日志
	<key>StandardOutPath</key>
	<string>/usr/local/nginx/logs/access.log</string>
</dict>
</plist>
Copy after login

Step 2:

Execute the command (add the file to start nginx in the startup project):

launchctl load -w /Library/LaunchDaemons /com.nginx.plist

Executing the command (check whether nginx starts successfully): ps -ef |grep nginx

The startup of PHP is the same as nginx.

Copyright Statement: This article is an original article by the blogger and may not be reproduced without the blogger's permission.

The above introduces how to start nginx and php on Mac system, including the relevant content. I hope it will be helpful to friends who are interested in PHP tutorials.

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
Error restarting nginx
From 1970-01-01 08:00:00
0
0
0
server - Nginx configuration webapp problem
From 1970-01-01 08:00:00
0
0
0
Nginx default.conf problem
From 1970-01-01 08:00:00
0
0
0
centos7 - NGINX exception occurs
From 1970-01-01 08:00:00
0
0
0
nginx load balancing
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