Nginx+thinkphp solution does not support the PathInfo mode and the existence of a variety of 404,500 issues
Nginx environmental problems for two days, found online a lot of people's posts are either copied or pasted, or there is no knot paste, but also write their own "Haha, I solve their own" and so on, I despise these postings of compatriots, you said you asked questions, the problem solved also do not give an explanation. Still on the first few pages of the search, think about the feelings of people who need answers. Full of joy to see the answer, found there is no knot paste. Well, don't say more, get to the point.
I do not need to change Url_model to rewrite/compatible in this way:
About line 43rd, follow the following code to make changes, please note the details of the symbol:
Location/{
Root c:/zend/workspaces; #//This is the root directory of your own project.
Index index.html index.htm index.php;
if (!-e $request _filename) {
Rewrite ^/(. *) $/index.php/$1 break;
Break
}
}
In the PHP configuration, the location ~ \.php$ to location ~ \.php, again stressed, attention to detail, here to remove the $ symbol, I just started because of this reason has not been able to solve.
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 $;
Set $path _info;
}
Fastcgi_param script_filename $document _root$real_script_name;
Fastcgi_param script_name $real _script_name;
Fastcgi_param path_info $path _info;
}
If it is still unresolved, add the configuration define (' _php_file_ ', $_server[' script_name ') to the thinkphp portal file index.php;
You may encounter 500,404 of problems during the period, but remember one thing and be careful. As long as I change this, basically no problem. If you have any questions, please contact us.
Workaround Source Reference: Http://www.codesth.com/%E4%B8%8D%E7%94%A8rewrite%E5%85%BC%E5%AE%B9%EF%BC%8C%E8%A7%A3%E5%86%B3nginx%E4 %b8%8d%e6%94%af%e6%8c%81thinkphp-pathinfo%e6%a8%a1%e5%bc%8f/