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 solve the problem of accessing index.php without parsing?

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

Share

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

This article shows you how to solve the problem of visiting index.php without parsing. The content is concise and easy to understand, which will definitely brighten your eyes. I hope you can get something through the detailed introduction of this article.

The solution to access index.php without parsing is to configure a code in the nginx server that reads "location ~\. Php$ {try_files $uri = 404 security fastcgitized splittered pathways info ^ (. + .php)...}".

This article operating environment: Windows7 system, PHP5 version, DELL G3 computer

What if the access to index.php does not resolve?

When visiting the nginx server, the PHP is not parsed, and the php file is downloaded directly.

When configuring a server, it sometimes happens that you map the domain name to a directory and access the domain name but download the index.php file directly. How should this situation be solved?

Location ~\ .php$ {try_files $uri = 404; # add fastcgi_split_path_info ^ (. + .php) (/. +) $; # Anti-comment # # NOTE: You should have "cgi.fix_pathinfo = 0;" in php.ini # With php5-cgi alone: # fastcgi_pass 127.0.0.1uri 9000 # # With php5-fpm: fastcgi_pass unix:/var/run/php5-fpm.sock; # anti-comment fastcgi_index index.php; # anti-comment include fastcgi_params; # anti-comment # include snippets/fastcgi-php.conf;## # With php5-cgi alone:# fastcgi_pass 127.0.0.1 fastcgi_index index.php; 9000 # # With php5-fpm:# fastcgi_pass unix:/var/run/php5-fpm.sock;}

You only need to configure such a piece of code in the nginx server to parse PHP. The purpose of this code is to automatically jump to php5-fpm to parse the file when accessing the php file.

What language is php php, a nested acronym, is the abbreviation of English Hypertext preprocessing language (PHP:Hypertext Preprocessor). PHP is a kind of HTML embedded language. PHP is somewhat similar to Microsoft's ASP. It is a scripting language that embeds HTML documents on the server. The style of the language is similar to C language, and now it is widely used by many website programmers.

The above content is how to access index.php without parsing. Have you learned any knowledge or skills? If you want to learn more skills or enrich your knowledge reserve, you are welcome to follow the industry information channel.

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