note 125229 added to yaf.tutorials

From: Date: Thu, 30 Jul 2020 12:07:15 +0000
Subject: note 125229 added to yaf.tutorials
Groups: php.notes 
Request: Send a blank email to php-notes+get-214911@lists.php.net to get a copy of this message
nginx重写不知为什么死循环 rewrite ^/(.*) /index.php/$1 last; /index.php/index.php/index.php/index.php/index.php/index.php/index.php/index.php/Index 后来我改成查询字符串就解决了。 location / { index index.php index.html index.htm; if (!-e $request_filename){ rewrite ^/(.*)$ /index.php?_path_info=/$1 last; } } 在index.php中,把query string "_path_info" 放到$_SERVER变量中。 <?php ini_set("display_errors",true); error_reporting(E_ALL|E_ERROR); //print_r($_SERVER); $_SERVER['PATH_INFO']=@$_GET['_path_info']; //加这一行,yaf只认PATH_INFO define("APPLICATION_PATH",dirname(__DIR__)); $app = new Yaf\Application(APPLICATION_PATH.'/conf/application.ini'); $app->bootstrap()->run(); ?> ---- Server IP: 45.112.84.4 Probable Submitter: 103.51.166.36 (proxied: 117.136.34.98) ---- Manual Page -- http://php.net/manual/en/yaf.tutorials.php Edit -- https://master.php.net/note/edit/125229 Del: integrated -- https://master.php.net/note/delete/125229/integrated Del: useless -- https://master.php.net/note/delete/125229/useless Del: bad code -- https://master.php.net/note/delete/125229/bad+code Del: spam -- https://master.php.net/note/delete/125229/spam Del: non-english -- https://master.php.net/note/delete/125229/non-english Del: in docs -- https://master.php.net/note/delete/125229/in+docs Del: other reasons-- https://master.php.net/note/delete/125229 Reject -- https://master.php.net/note/reject/125229 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#214911) next »