安裝新的代碼後,發現代碼路由始終無法定位過去,一直在index/index路由下,phpInfo 中的Yaf擴充也已安裝,找了Yaf的路由解析,可以參考這篇文章:https://www.jianshu.com/p/467910b8551c
發現路由沒有重定義,application.ini中也沒有重定義,最後找到了解決辦法,是參考了這篇文章:
https://blog.csdn.net/a251137747/article/details/50988202
就是nginx的問題導緻,注釋掉PATH_INFO後,重新開機nginx就解決了,也可能跟yaf 的版本有關系,我的yaf 是3.2.3,我朋友的是3.3,他的解析是ok的,以上就是解決辦法,可以試試。
location ~ \.php$ {
root /web/data/wwwroot/demo4.helens.com.cn;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_split_path_info ^((?U).+\.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;
}