任何人都知道为什么会这样吗?
在我的代码中,我有以下行,我认为这会导致问题:
header('Location: /var/www/index.php');
Run Code Online (Sandbox Code Playgroud)
但它一直给我以下错误:
[Thu Jul 28 22:15:18 2011] [error] [client 127.0.0.1] script '/var/www/account/index.php' not found or unable to stat, referer: http://localhost
Run Code Online (Sandbox Code Playgroud)
可能的问题在于:
header('Location: /var/www/index.php');
Run Code Online (Sandbox Code Playgroud)
位于以下位置的文件中:
/var/www/account/oauth/openid/check.php
Run Code Online (Sandbox Code Playgroud)
您正在将浏览器指向绝对路径.这是错误的,您需要使用相对于文档根目录的路径.浏览器无法查看文档根目录之外的任何内容.
在你的情况下
header('Location: /var/www/index.php');
Run Code Online (Sandbox Code Playgroud)
应该是:
header('Location: /index.php');
Run Code Online (Sandbox Code Playgroud)
既然/var/www/是您的文档根目录.