How to deploy php project to nginx

藏色散人
Release: 2023-03-05 06:48:02
Original
5039 people have browsed it

How to deploy php project to nginx: first install "Nginx" and "php-fpm"; then copy the project to the "nginx/html" file; then modify the configuration file; finally reload Nginx and Just start "php-fpm".

How to deploy php project to nginx

Recommended: "PHP Video Tutorial"

Using Nginx to deploy PHP projects in Linux environment

1. Install Nginx and php-fpm

2. Deploy the project

①Copy your project to this file

cd /usr/ local/nginx/html

②Modify the configuration file

cd ../
cd conf
vim nginx.conf
#  在location / {........}模块的index配置中添加index.php
#location ~ \.php$ {.......} 把该模式块的注释全部去掉,并将fastcgi_param  SCRIPT_FILENAME  /scripts$fastcgi_script_name;  改为  fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
Copy after login

③Reload Nginx

/usr/local/nginx/sbin/nginx -c /usr/local/nginx/conf/nginx.conf
/usr/local/nginx/sbin/nginx  -s reload
Copy after login

④Start php-fpm

/usr/local/php/sbin/php-fpm
Copy after login

⑤Access your project

The above is the detailed content of How to deploy php project to nginx. 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
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!