As you know, thinkphp is a widely used PHP development framework, so you need to support URLs rewrite and pathinfo in Nginx.Add the following lines to our Nginx configuration file.Accompanying text section:Location ~. php{Fastcgi_pass 127.0.0.1:9000;
Locate the nginx.conf file below the Nginxare generally in#vim/usr/local/nginx/conf/nginx.conf Find here if pathinfo.conf is present will include pathinfo.conf; The previous # Delete if not addedLocation ~ [^/]\.php (/|$) {
This article is only for operation, explain the explanation section to be updated.1. Modify Nginx configuration file (my profile is in/etc/nginx/nginx.conf)[[Email protected] ~] # Find/-name nginx.conf [[Email protected] ~] #
Using the parameters of automatically loading and parsing URLs, the implementation calls to different controllers, implementing the PathInfo mode and the normal URL pattern
File structure:
|--controller|--index|--index.php
|--application.php
Overview
In the previous article Nginx configuration thinkphp support URL Rewrite has described how to configure Nginx thinkphp URL Rewrite, but for some special reasons, this is the CentOS platform. The server environment must use Ubuntu,
TP frame upload Linix, solve pathinfo path problem
Today again encountered this problem, the thinkphp frame upload Linix found that the page can not find a jump. Today, the solution to this problem is recorded and shared with the blow.
The original
solve the problem of thinkphp in not supporting PathInfo NginxAugust 23, 2015 Linux No comment read 339 views
Recently used thinkphp and Redis wrote a small imitation microblogging project, but when deployed to the Nginx server unexpectedly are 404,
Nginx default does not support thinkphp PathInfo mode, but can only modify the Nginx configuration. The modified configuration is as follows:1.nginx.conf:User Apache Apache;Worker_processes 16;Worker_cpu_affinity
Refer to the corresponding changes, restart Nginx can be
Copy Code code as follows:
server {
Listen 80;
server_name www.leiyongbo.com www.leiyongbo.com;
Root/usr/local/web;
Index index.php;
Error_page 400/errpage/400.html;
Command line mode, the different controllers are invoked according to the arguments. The specified method is executed periodically in the controller according to the configuration
application.php
$v) {if ($k ==0) continue;
$_server['
Copy Code code as follows:
http://serverName/appName/module/action/id/1/
This is PathInfo mode.
Without considering routing, the first parameter is resolved to the module name (if grouping is enabled, then recursion backwards),
Development environment
CodeIgniter 2.14PHP 5.4.18Nginx 1.4.2
CodeIgniter Configuration
The config.php file that opens Codeignite is modified as follows:
$config [' uri_protocol '] = "path_info";
Nginx Configuration
Open the Nginx
Let Nginx support ThinkPHP URL rewriting and PATHINFO sharing methods. After a day of research, I found that the following configuration can perfectly support URL_MODEL2. The Copy code is as follows: locationproject {I found that many methods on the
This article describes how to solve the problem that does not support the pathinfo mode in nginx + thinkphp. For more information, see The nginx environment issue for two days, I found that many people on the internet either copy and paste their
This article to share the content is about PHP nginx server configuration Support PathInfo, has a certain reference value, the need for friends can refer to
The first method:
Modification of Nginx configuration not seen nginx.conf
Location ~ \.php {
This article describes how to solve the problem that does not support the pathinfo mode in nginx + thinkphp. For more information, see The nginx environment issue for two days, I found that many people on the internet either copy and paste their
Today, write the program encountered a small problem, pathinfo in the processing of Chinese file name when the problem arises, if the Chinese in the first word on the occurrence of the filename is empty, English in the first word after the Chinese
Enter Nginx directory and open nginx.confFor example, the URL of my visit to thinkphp is (TP5 is the directory I created under nginx/html/, called the level Two directory below): Https://192.168.139.128/tp5/index.php?s=index/index/indexPathInfo mode
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.