杉德支付php代码实现,nginx配置tp5 505 404 错误

## 500 Internal Server Error 如果文件名中前后有t的可能会出错 ,会出现转义

```

版本:phpstudy 2018

报错:500 Internal Server Error

解决办法:找到nginx的配置文件,改正路径就行

// 错误 \

root "C:\Users\xxx\Desktop\test\public";

// 正确 将路径改为正斜杠

root "C:/Users/xxx/Desktop/test/public";

```

## 修改完后可能会报404错误 那么需要在配置虚拟主机中加上

```

//添加的代码

if (!-e $request_filename) {

rewrite ^(.*)$ /index.php?s=/$1 last;

}

//完整实例 详见:https://www.kancloud.cn/manual/thinkphp5\_1/353955

server {

listen 80;

server_name test.cn ;

root "C:/Users/xxx/Desktop/test/public";

location / {

index index.html index.htm index.php;

#autoindex on;

#添加的

if (!-e $request_filename) {

rewrite ^(.*)$ /index.php?s=/$1 last;

}

#添加的

}

location ~ \.php(.*)$ {

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;

}

}

```


本文来自互联网用户投稿,文章观点仅代表作者本人,不代表本站立场,不承担相关法律责任。如若转载,请注明出处。 如若内容造成侵权/违法违规/事实不符,请点击【内容举报】进行投诉反馈!

相关文章

立即
投稿

微信公众账号

微信扫一扫加关注

返回
顶部