使用 Nginx 在 CentOS 6.4 x64 上运行 PHP 5.5.5 FPM/FastCGI。
require_once(dirname(__FILE__) . '/adminsetting.php') or die();
返回以下错误:
PHP Fatal error: require_once(): Failed opening required '1'
(include_path='.:/usr/share/pear:/usr/share/php') in
/home/vincek/public_html/plg/index.php on line 4
该文件adminsetting.php
位于相同的目录中index.php
并且存在。
我已经仔细检查了我能想到的一切,php 正在当前用户下运行,所有所有权和权限都是正确的。
我不知道为什么找不到这个文件。
我需要在我的 vhost.conf 中为这个目录设置一个单独的位置块吗?
--EDIT-- 要求附加代码:
来自 index.php:
session_start();
$base_path=substr($_SERVER['SCRIPT_FILENAME'] , 0 , -strlen($_SERVER['PHP_SELF'])+0).dirname($_SERVER['PHP_SELF']);
require_once(dirname(__FILE__) . '/adminsetting.php');
setcookie("usercheck", " ", time()-60*5);
include($require_path."/functions.php");
if($datastoreselected=="2")include_once($mysql_path."/connection.php");
include("header.php");
include("side.php");
... etc ...
从 adminsetting.php:
$root_path="/home/vincek/public_html/plg";
$base_path="/home/vincek/public_html/plg";
$adminurl="http://vincek.co";
$admininstalldirectory="/plg";
$base_url="http://vincek.co/plg/";
$site_title="Power Link Generator v4.8";
$require_path="/home/vincek/public_html/plg/include";
$template_path="/home/vincek/public_html/plg/templates";
$mysql_path="/home/vincek/public_html/plg/mysql";
$image_path="http://vincek.co/plg/images";
$adminbase="/home/vincek/public_html/";
... etc ...
如果adminsetting
文件被包含...为什么找不到被调用的变量?