警告:require_once(includes/EliteScript.php) [function.require-一次]:无法打开流:没有这样的文件或目录
Warning: require_once(includes/EliteScript.php) [function.require-once]: failed to open stream: No such file or directory in
这是一个基于许可证的脚本,它有使用 SourceGuardian 的有效许可证。该脚本在客户的旧服务器上运行良好,他雇用我将其迁移到新服务器。
迁移后,一切正常,但登录区域不正常,尝试登录时出现以下错误
Warning: require_once(includes/EliteScript.php) [function.require-once]: failed to open stream: No such file or directory in /home/sitetalk/public_html/interface/index.php on line 3
Fatal error: require_once() [function.require]: Failed opening required 'includes/EliteScript.php' (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/sitetalk/public_html/interface/index.php on line 3
注册正常,可以在数据库中看到填写的数据。试图将其提交给脚本开发人员,但自 3 个月以来没有任何回应。
不确定,是什么导致了这个错误的发生。粘贴显示文件名的部分代码。
EliteScript.php
<?php
global $config;
global $country_array;
error_reporting(E_ALL ^ E_NOTICE ^ E_WARNING ^ E_DEPRECATED);
define("ES_VERSION", "7.0.4");
define("ES_SERVER", "http://primary.shadowscripts.com/master/server.php");
define("ES_FLASH", "/includes/graphs/src/lang/my.inc.php");
define("ES_VERIFYDEV", "eth0");
require_once("ShadowScripts.php");
require_once("interface/template.php");
spl_autoload_register(function($class)
{
if ($class == "EliteScriptBase")
{
return 0;
}
if ($class != "FusionCharts_Gen.php")
{
$class = preg_replace("/\_/", "/", $class);
}
$class = preg_replace("/\\/", "/", $class);
?>
和
index.php
<?php
global $es;
global $ui;
global $member_id;
global $base_url;
global $member_url;
global $image_url;
global $admin_url;
require_once("includes/EliteScript.php");
$es = new EliteScript();
$ui = new UserInterface();
$es->RequireMember();
$member_id = $es->GetMemberId();
$base_url = $es->GetConfig("baseUrl");
$member_url = $es->GetConfig("memberUrl");
$image_url = $es->GetConfig("imageUrl");
$f_login_page = $es->GetLoginUIPage();
if( $f_login_page )
{
$ui->ChangePage($f_login_page);
}
$es->DisplayHeader($es->getText("home_window_title"), "member.php");
switch( $_REQUEST["do"] )
{
case "toggle_autorenew":
toggle_autorenew();
break;
default:
display_main();
}
$es->DisplayFooter();
echo "\r\n\r\n\r\n\r\n\r\n\r\n";
function toggle_autorenew()
{
global $es;
global $ui;
global $member_id;
global $base_url;
global $member_url;
global $image_url;
global $admin_url;
$way = $_REQUEST["way"];
$es->ToggleMembershipAutoRenew($member_id, $way);
$ui->SetMessage("msg", $es->getText("home_togglerenew_success"));
$ui->ChangePage($_SERVER["PHP_SELF"]);
}
function display_main()
?>
正如第 3 行所说,我找不到要编辑的内容。请帮助我解决这个问题。
谢谢
更改此设置并检查它是否正常工作
require_once("includes/EliteScript.php");
到
require_once("../includes/EliteScript.php");
说明
当前代码调用当前 directory/includes/EliteScript.php
但您的文件在上一个目录中,因此您必须添加 ../
它将包含上一个目录中的文件。
您遇到的问题与php的include
和require
函数中的相对路径和绝对路径有关。您的索引文件需要 EliteScript.php
和相对路径。
关于相对和绝对的区别的文章:
- php relative and absolute paths
- PHP: Absolute vs. relative paths
- 和一个比较table:http://www.geeksengine.com/article/absolute-relative-path.html
您在评论中提到文件已加密,因此处理此问题的最佳方法是使目录结构与提供给您的文件完全相同。
具体指出(正如我在评论中所做的)问题所在:
public_html/interface/index.php
加载相对路径 includes/EliteScript.php
因此需要路径 public_html/interface/includes/EliteScript.php
但是你的 EliteScript.php 位于 public_html/includes/EliteScript.php
.
其他答案可能是正确的,但它们没有解决我的问题。
我完全按照this article
中显示的那样做了
我在 php.ini 中编辑了 include_path,它运行得很好。
这是一个基于许可证的脚本,它有使用 SourceGuardian 的有效许可证。该脚本在客户的旧服务器上运行良好,他雇用我将其迁移到新服务器。
迁移后,一切正常,但登录区域不正常,尝试登录时出现以下错误
Warning: require_once(includes/EliteScript.php) [function.require-once]: failed to open stream: No such file or directory in /home/sitetalk/public_html/interface/index.php on line 3
Fatal error: require_once() [function.require]: Failed opening required 'includes/EliteScript.php' (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/sitetalk/public_html/interface/index.php on line 3
注册正常,可以在数据库中看到填写的数据。试图将其提交给脚本开发人员,但自 3 个月以来没有任何回应。
不确定,是什么导致了这个错误的发生。粘贴显示文件名的部分代码。
EliteScript.php
<?php
global $config;
global $country_array;
error_reporting(E_ALL ^ E_NOTICE ^ E_WARNING ^ E_DEPRECATED);
define("ES_VERSION", "7.0.4");
define("ES_SERVER", "http://primary.shadowscripts.com/master/server.php");
define("ES_FLASH", "/includes/graphs/src/lang/my.inc.php");
define("ES_VERIFYDEV", "eth0");
require_once("ShadowScripts.php");
require_once("interface/template.php");
spl_autoload_register(function($class)
{
if ($class == "EliteScriptBase")
{
return 0;
}
if ($class != "FusionCharts_Gen.php")
{
$class = preg_replace("/\_/", "/", $class);
}
$class = preg_replace("/\\/", "/", $class);
?>
和
index.php
<?php
global $es;
global $ui;
global $member_id;
global $base_url;
global $member_url;
global $image_url;
global $admin_url;
require_once("includes/EliteScript.php");
$es = new EliteScript();
$ui = new UserInterface();
$es->RequireMember();
$member_id = $es->GetMemberId();
$base_url = $es->GetConfig("baseUrl");
$member_url = $es->GetConfig("memberUrl");
$image_url = $es->GetConfig("imageUrl");
$f_login_page = $es->GetLoginUIPage();
if( $f_login_page )
{
$ui->ChangePage($f_login_page);
}
$es->DisplayHeader($es->getText("home_window_title"), "member.php");
switch( $_REQUEST["do"] )
{
case "toggle_autorenew":
toggle_autorenew();
break;
default:
display_main();
}
$es->DisplayFooter();
echo "\r\n\r\n\r\n\r\n\r\n\r\n";
function toggle_autorenew()
{
global $es;
global $ui;
global $member_id;
global $base_url;
global $member_url;
global $image_url;
global $admin_url;
$way = $_REQUEST["way"];
$es->ToggleMembershipAutoRenew($member_id, $way);
$ui->SetMessage("msg", $es->getText("home_togglerenew_success"));
$ui->ChangePage($_SERVER["PHP_SELF"]);
}
function display_main()
?>
正如第 3 行所说,我找不到要编辑的内容。请帮助我解决这个问题。
谢谢
更改此设置并检查它是否正常工作
require_once("includes/EliteScript.php");
到
require_once("../includes/EliteScript.php");
说明
当前代码调用当前 directory/includes/EliteScript.php
但您的文件在上一个目录中,因此您必须添加 ../
它将包含上一个目录中的文件。
您遇到的问题与php的include
和require
函数中的相对路径和绝对路径有关。您的索引文件需要 EliteScript.php
和相对路径。
关于相对和绝对的区别的文章:
- php relative and absolute paths
- PHP: Absolute vs. relative paths
- 和一个比较table:http://www.geeksengine.com/article/absolute-relative-path.html
您在评论中提到文件已加密,因此处理此问题的最佳方法是使目录结构与提供给您的文件完全相同。
具体指出(正如我在评论中所做的)问题所在:
public_html/interface/index.php
加载相对路径 includes/EliteScript.php
因此需要路径 public_html/interface/includes/EliteScript.php
但是你的 EliteScript.php 位于 public_html/includes/EliteScript.php
.
其他答案可能是正确的,但它们没有解决我的问题。
我完全按照this article
中显示的那样做了我在 php.ini 中编辑了 include_path,它运行得很好。