2

This is a licence based script and it has a valid licence using SourceGuardian. The script was working fine on client's old server and he hired me to migrate it to the new server.

After migrating, everything was working fine but not the login area, when trying to login it gives the follow error

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

Registration works fine and can see the filled data in database. Tried to take it to the script developer, but there's no response since 3months.

Not sure, what causing this error to happen. Pasting the part of code of the shown file names.

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);
   ?>

and

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()
?>

As it says on line 3, I find nothing to edit. Please help what I can do to fix this.

Thanks

10
  • check your include directory file are there? Commented May 13, 2015 at 5:14
  • EliteScript.php file directory path? Commented May 13, 2015 at 5:17
  • public_html/includes/EliteScript.php Commented May 13, 2015 at 5:21
  • If you moved the files and folders as they were and it's a new server, consider to check your require_path in your php.ini file. Commented May 13, 2015 at 5:23
  • Ok bro, let me check. Commented May 13, 2015 at 5:24

3 Answers 3

3

Change this and check it is working or not

require_once("includes/EliteScript.php");

to

require_once("../includes/EliteScript.php");

Explanation current code calling current directory/includes/EliteScript.php but your file in previous directory so you have to add ../ it will include file from previous directory.

Sign up to request clarification or add additional context in comments.

1 Comment

An explanation would be helpful. What was the problem and how did you solve it?
2

The problem you encounter has to do with relative and absolute paths in the include and require functions of php. Your index file is requiring the EliteScript.php with a relative path.

Articles about the difference between relative and absolute:

In your comments you mention the files are encrypted, so the best way to handle this is to keep the directory structure in exact the same way as the files are given to you.

The specifically point out (as I've done in the comments) where the problem lies:

public_html/interface/index.php loads the relative path includes/EliteScript.php which therefor will require the path public_html/interface/includes/EliteScript.php however your EliteScript.php is located in public_html/includes/EliteScript.php.

3 Comments

I have tried to copy the files to where it is actually expecting, but it's asking for more files and tried to all I can. there are alot of files and it was hard to change anymore locations when it end up at /home/sitetalk/public_html/interface/includes/../config.inc.php How to make it to follow relative path then? I can get 1 file decoded, which one should I? The server it was migrated to now is from the same ISP, I havn't changed any file's location, I have migrated it as it is.
You don't change the code otherwise you break stuff. Try to get back to the directory structure it was meant to be and if it needs more files then you probably f**ked up :P Sorry to say. Try uploading from scratch and don't change directory structure (again).
No, I havn't changed the directory structure in any form bro. I have just compressed the files and folders on old server and extracted in new one. It always works fine until it's changed to new server, and developer needs to fix it, but he's not active since last 3 months. That is why I'm here. :(
0

The other answers maybe true, but they didn't fix my problem.

I did exactly as it was showing in this article

I edited the include_path in php.ini and it's working like charm.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.