是否有任何情况下$_SERVER['REQUEST_URI']
应该打开两个不同的 PHP 文件?
我没有使用 mod_rewrite,只是使用 Apache 虚拟主机和指向我的 PHP 文件所在的目标目录的别名指针,但我看到了一些对我来说完全神秘的东西。两个相同的请求相隔 1/2 小时,并且没有对任何内容(Apache 配置、FS 等)进行任何干预,它们加载了使用相同 REQUEST_URI 的不同文件:
在 utilupdate.php 我有:
error_log("Loading ".__FILE__." <= $_SERVER['REQUEST_URI']@$_SERVER['SERVER_NAME']);
来自错误日志:
[Mon Jul 07 17:30:01.224430 2014] [:error] [pid 18928] [client 23.253.161.240:54571]
Loading /var/www/html/stage/utilupdate.php <= /dev/utilupdate.php@api.nugg.co
[Mon Jul 07 17:30:01.224510 2014] [:error] [pid 19518] [client 23.253.161.240:54572]
Loading /var/www/html/stage/utilupdate.php <= /stage/utilupdate.php@api.nugg.co
来自 access.log:
23.253.161.240 - - [07/Jul/2014:17:30:01 +0000] "GET /stage/utilupdate.php HTTP/1.1" 200 1263 /var/www/html/stage/utilupdate.php 700653
23.253.161.240 - - [07/Jul/2014:17:30:01 +0000] "GET /dev/utilupdate.php HTTP/1.1" 200 1263 /var/www/html/dev/utilupdate.php 701516
半小时前,它也是错误的,但反过来:
[Mon Jul 07 16:30:01.680617 2014] [:error] [pid 15566] [client 23.253.161.240:54257] Loading /var/www/html/dev/utilupdate.php <= /dev/utilupdate.php@api.nugg.co
[Mon Jul 07 16:30:01.686350 2014] [:error] [pid 15567] [client 23.253.161.240:54261] Loading /var/www/html/dev/utilupdate.php <= /stage/utilupdate.php@api.nugg.co
23.253.161.240 - - [07/Jul/2014:16:30:01 +0000] "GET /stage/utilupdate.php HTTP/1.1" 200 1261 /var/www/html/stage/utilupdate.php
23.253.161.240 - - [07/Jul/2014:16:30:01 +0000] "GET /dev/utilupdate.php HTTP/1.1" 200 1261 /var/www/html/dev/utilupdate.php
在我看来,某处缓存有问题,但我什至不知道从哪里开始。这可能与 xcache 或 opcache 有关吗?