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 posts, or do not close the posts. I also wrote a sentence like "haha, I have solved it myself, in this case, I despise the people who post these posts. if you ask a question, you will not be able to give an explanation if the problem is solved. I am still searching for the first few pages. I have never thought about the feelings of people who need answers. Looking at the answer with joy, I found that there was no ending post. Okay, let's just move on to the topic.
In this way, you do not need to change URL_Model to rewrite/compatible:
There are about 43rd lines. modify the code according to the following. pay attention to the symbols in detail:
Location/{root C:/Zend/workspaces; # // This is the root directory of your project. Index index.html index.htm index. php; if (! -E $ request_filename) {rewrite ^/(. *) $/index. php/$1 break ;}}
In the php configuration, set location ~ \. Php $ changed to location ~ \. Php, once again stressed, pay attention to the details. the $ symbol is removed here. at the beginning, it is also because of this reason that I have not been able to solve it.
location ~ \.php { root C:/Zend/workspaces; fastcgi_pass 127.0.0.1:9000; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME C:/wnmp/php$fastcgi_script_name; include fastcgi_params; set $path_info ""; 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; }
If the problem persists, add the configuration define ('_ PHP_FILE _', $ _ SERVER ['script _ name']) to the index. php file of the ThinkPHP Portal.
During this period, you may encounter 500,404 of problems, but remember to be careful. As long as you follow this change, there is basically no problem. If you have any questions, please leave a message.
The above is all the content of this article. I hope you will like it.