Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to configure TP5.1 in Nginx and the problems encountered

2025-01-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/02 Report--

This article will explain in detail how to configure TP5.1 in Nginx and the problems encountered. The editor thinks it is very practical, so I share it with you as a reference. I hope you can get something after reading this article.

1.Nginx user's access to the project directory

Cd / usr/local/nginx/html/setfacl-m u:nginx:rwx-R.. / html2. Make sure that the access path is correct. It is best to test the access URL path locally and access the file correctly.

3.nginx supports pathinfovi / usr/local/nginx/conf/nginx.conf of tp

The location found in the nginx.conf configuration file is modified as follows

Location ~\ .php$ {# root html; # this path points to root / usr/local/nginx/html/zh/public; fastcgi_index index.php; fastcgi_pass 127.0.0.1 root 9000; # fastcgi_pass unix:/usr/local/php/var/run/www.sock Fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; fastcgi_split_path_info ^ (. +\ .php) (. *) $; # add the sentence fastcgi_param PATH_INFO $fastcgi_path_info; # add this sentence include fastcgi_params;} 4.nginx rewrite rewriting rule vi / usr/local/nginx/conf/nginx.conf

The location found in the nginx.conf configuration file is modified as follows

Server {listen 80; server_name www.liuyuanshan.top; # charset koi8-r; # access_log logs/host.access.log main; location / {# root html; # set the www.liuyuanshan.top default access path to / usr/local/nginx/html/zh/public/ root / usr/local/nginx/html/zh/public/ Index index.php index.html index.htm; if (!-e $request_filename) {rewrite ^ (. *) $/ index.php?s=/$1 last }} this is the end of the article on "how to configure TP5.1 in Nginx and the problems encountered". I hope the above content can be of some help to you, so that you can learn more knowledge. if you think the article is good, please share it for more people to see.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report