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 the phpinfo mode function when nginx is enabled under linux or windows

2025-02-23 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)05/31 Report--

This article mainly introduces "how to configure the function of phpinfo mode on nginx under linux or windows". In the daily operation, I believe that many people have doubts about how to configure the function of phpinfo mode enabled by nginx under linux or windows. The editor consulted all kinds of materials and sorted out simple and easy-to-use operation methods. I hope it will be helpful to answer the doubt of "how to configure the function of phpinfo mode on nginx under linux or windows". Next, please follow the editor to study!

The copy code is as follows:

Location ~\ .php (. *) ${

Fastcgi_pass unix:/tmp/php-cgi.sock

Fastcgi_index index.php

Fastcgi_split_path_info ^ (. +\ .php) (. *) $

Fastcgi_param script_filename $document_root$fastcgi_script_name

Fastcgi_param path_info $fastcgi_path_info

Fastcgi_param path_translated $document_root$fastcgi_path_info

# include fastcgi_params

Include fcgi.conf

}

An example of a complete site configuration:

The copy code is as follows:

Log_format v.lzw.me'$remote_addr-$remote_user [$time_local] "$request"'

'$status $body_bytes_sent "$http_referer"'

'"$http_user_agent" $http_x_forwarded_for'

Server {

Listen 80

Server_name v.lzw.me

Index index.html index.htm index.php default.html default.htm default.php

Root / www/v.lzw.me

# urlrewrite

Include v.lzw.me.conf

Location ~\ .php (. *) ${

Fastcgi_pass unix:/tmp/php-cgi.sock

Fastcgi_index index.php

Fastcgi_split_path_info ^ (. +\ .php) (. *) $

Fastcgi_param script_filename $document_root$fastcgi_script_name

Fastcgi_param path_info $fastcgi_path_info

Fastcgi_param path_translated $document_root$fastcgi_path_info

# include fastcgi_params

Include fcgi.conf

}

Location. *\. (gif | jpg | jpeg | png | bmp | swf) ${

Expires 30d

}

Location. *\. (js | css)? ${

Expires 12h

}

Access_log / wwwlogs/v.lzw.me.log v.lzw.me

}

Refer to other methods (suitable for nginx under windows, etc.):

The copy code is as follows:

Location\ .php

{

Fastcgi_pass 127.0.0.1:9000

Fastcgi_index index.php

Include fcgi.conf

Set $real_script_name $fastcgi_script_name

If ($fastcgi_script_name ~ "^ (. +?\ .php) (/. +) $") {

Set $real_script_name $1

Set $path_info $2

}

Fastcgi_param script_filename $document_root$real_script_name

Fastcgi_param script_name $real_script_name

Fastcgi_param path_info $path_info

}

At this point, the study on "how to configure the phpinfo mode function on nginx under linux or windows" is over. I hope to be able to solve your doubts. The collocation of theory and practice can better help you learn, go and try it! If you want to continue to learn more related knowledge, please continue to follow the website, the editor will continue to work hard to bring you more practical articles!

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