Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/233.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
当使用PHP内置服务器和Symfony 2请求任何路径时,$#u SERVER[';SCRIPT#u NAME';]为/index.html_Php_Symfony_Php Builtin Server - Fatal编程技术网

当使用PHP内置服务器和Symfony 2请求任何路径时,$#u SERVER[';SCRIPT#u NAME';]为/index.html

当使用PHP内置服务器和Symfony 2请求任何路径时,$#u SERVER[';SCRIPT#u NAME';]为/index.html,php,symfony,php-builtin-server,Php,Symfony,Php Builtin Server,我有一种奇怪的行为,如果路径不包含句点(/无论什么东西/a-page),则$\u服务器变量SCRIPT\u NAME将替换为index.html或index.php(如果它们存在于根文件夹中)SCRIPT\u NAME是正确的值:/whatever.something/a-page 我检查Symfony提供的router_dev.php中的SCRIPT_NAME值 我这样运行服务器:app/console服务器:run 例1-良好 Directory structure: web/index.h

我有一种奇怪的行为,如果路径不包含句点(/无论什么东西/a-page),则
$\u服务器
变量
SCRIPT\u NAME
将替换为index.html或index.php(如果它们存在于根文件夹中)<当根文件夹中没有index.html或index.php时,code>SCRIPT\u NAME是正确的值:/whatever.something/a-page

我检查Symfony提供的router_dev.php中的SCRIPT_NAME值

我这样运行服务器:
app/console服务器:run

例1-良好

Directory structure:
web/index.html

Path:
/whatever.something/a-page

SCRIPT_NAME value:
/whatever.something/a-page
例2-良好

Directory structure (empty):
web/

Path:
/whatever-something/a-page

SCRIPT_NAME value:
/whatever-something/a-page
例子3-奇怪

Directory structure:
web/index.html

Path:
/whatever-something/a-page

SCRIPT_NAME value:
/index.html
这使得我的应用程序基本上为每个不包含句点的请求提供index.html


有人能告诉我到底发生了什么事吗?

@sєєm sєm我不喜欢你的标题编辑,这不是更好,实际上是错误的。请回复。如您所愿,抱歉。谢谢。没问题。