我们都知道的,tp5 默认在 nginx 服务器 是不能正常工作的,需要我们手动配置 nginx 服务器 以便对 tp 5 的支持!这篇文章主要介绍了在lnmp环境下thinkphp5的一些必要配置,小编觉得挺不错的,现在分享给大家,也给大家做个参考。一起跟随小编过来看看吧
打开 Nginx 站点配置文件
$ sudo vi /etc/nginx/vhost/vhost_siteA.conf
编辑站点配置文件
#自定义服务器配置开始
server {
listen 80; # 监听端口
server_name www.test.com test.com; # 站点域名
set $root /var/www/html/shengteng-group/public/; # 站点根目录
location ~ .*\.(gif|jpg|jpeg|bmp|png|ico|txt|js|css)$
{
root $root;
}
location / {
root $root;
index index.html index.php;
if ( -f $request_filename) {
break;
}
if ( !-e $request_filename) {
rewrite ^(.*)$ /index.php/$1 last;
break;
}
}
location ~ .+\.php($|/) {
fastcgi_pass unix:/run/php/php7.0-fpm.sock;
fastcgi_split_path_info ^((?U).+.php)(/?.+)$;
fastcgi_param PATH_INFO $fastcgi_path_info;
fastcgi_param PATH_TRANSLATED $document_root$fastcgi_path_info;
fastcgi_param SCRIPT_FILENAME $root$fastcgi_script_name;
include fastcgi_params;
}
}#自定义服务器配置结束重启 Nginx 服务器 即可
$ service nginx restart
相关推荐:
云枫工作室企业网站源代码(.net)Version 4.0 是云枫工作室基于.net环境独立开发的一套适用于企业使用的企业网站系统。.net+access.网站使用了模板动态生成静态页面技术,前台页面是生成纯静态的。网站包括了信息管理,产品管理,新闻管理和在线留言。可以在后台设置网站名称,标题,关键字和网站描述。配置说明:服务器空间需要支持.net2.0,还要有可写的权限(这个是必要的,因为网站前
立即学习“PHP免费学习笔记(深入)”;










