tp5 nginx部署index.php入口
未知
2023-05-31 17:46:05
0

phpstudy:

 


server {
        listen        80;
        server_name  www.xianzi321123.net;
        root   "D:/phpstudy_pro/WWW/www.ian.net/public";
        location / {
            index index.php index.html error/index.html;
            error_page 400 /error/400.html;
            error_page 506 /error/506.html;
            error_page 507 /error/507.html;
            error_page 509 /error/509.html;
            error_page 510 /error/510.html;
            include D:/phpstudy_pro/WWW/www.itulan.net/public/nginx.htaccess;
            autoindex  off;
            if ( !-e $request_filename) {
                rewrite ^/(.*)$ /index.php/$1 last;
                break;
            }



        }
        location ~ \.php(.*)$ {
            fastcgi_pass   127.0.0.1:9000;
            fastcgi_index  index.php;
    
        }

        error_log D:/phpstudy_pro/Extensions/Nginx1.16.1/logs/www.xi23.net_error.log crit;
}
重启nignx。刷新页面即可

宝塔:

1,vhosts文件添加如下代码。
include enable-php-73.conf;
           location / {
           
            if ( !-e $request_filename) {
                rewrite ^/(.*)$ /index.php/$1 last;
                break;
            }


        }
        location ~ \.php(.*)$ {
            fastcgi_pass   127.0.0.1:9000;
            fastcgi_index  index.php;
    
        }



2,添加伪静态
location / {
    if (!-e $request_filename){
        rewrite  ^(.*)$  /index.php?s=$1  last;   break;
    }
}




如果还出现404页面,看看备案没,看看解析成功否,看看php版本

相关内容

比亚迪第二代秦PLUS智驾...
比亚迪第二代秦PLUS智驾版明晚上市,以卓越的智能驾驶技术和外观设...
2025-02-10 04:46:50
如何识别和应对网络攻击中的...
摘要:Webshell威胁是网络攻击的重要形式,通过观察流量、检查...
2025-02-09 21:46:37
Webshell在网络攻击...
本文介绍了Webshell的概念、危害及传播途径,提出了包括加强安...
2025-02-09 21:00:40
网络攻击中Webshell...
本文介绍了Webshell的危害与攻击方式,提出了增强系统安全配置...
2025-02-09 20:46:45
PHP upload_ma...
PHP `upload_max_filesize` 详细介绍与最佳...
2025-02-09 17:00:39
upload_max_fi...
`upload_max_filesize` 是 PHP 中限制文件...
2025-02-09 16:46:42

热门资讯

Laravel 5.5 .No... 创建了新的laravel项目后, 运行提示:No application encryption ke...
生成随机字符唯一标识符guid... /** * @param $length * @return string * 生成随机字符串 */...
tp5 jquery判断手机端... application--common.php中添加如下代码 //函数作用是判断用户打开的是手机端还...
php 打印date函数出现错... 问题描述: 我使用的是phpstudy,在练习时间函数的时候,打印出现在的时间,date(Y-m-d...
Laravel 查看SQL操作... 方法一:临时打印操作记录 DB::connection()-enableQueryLog(); # ...
php函数substr_rep... php函数substr_replace从某个位置替换或删除或插入字符串
layui缩略图 div class=layui-form-item label class=layui-form-l...
object json转化为数... //调用api 程序,通知商户订单异常 20200314 public function callt...
php银行开放平台接口:pfx... 问题描述: 对接易通银行,他们的服务开放平台是java开发,而我的是php,现在需要php版本的SD...
Laravel 引入自定义类库... 强烈建议引入的类 都是含有命名空间的,这样使用起来就不会出现重名的情况。!!当然,没有命名空间也可以...