1
olmiller
Script error for Homepage on Xoops 2.0.16
  • 2010/2/19 15:27

  • olmiller

  • Just popping in

  • Posts: 5

  • Since: 2008/3/18


I have searched the forums for this but have come up empty. I cannot imagine this has not happened before, so if it is a dupe, please point me in the correct direction!

I have had a very small XOOPS 2.0.16 (hosted) web site up for just under two years. I recently went to the site to upgrade it and then to make some content changes. When I went to the homepage, I got the following failure message and not the homepage:

XOOPS path check: Script is not inside XOOPS_ROOT_PATH and cannot run.

Xoops: 2.0.16
PHP: 5.2.11
MySQL: 5.1.43

Any thoughts, suggestions, additional ways to debug? TIA.

2
ghia
Re: Script error for Homepage on Xoops 2.0.16
  • 2010/2/19 15:40

  • ghia

  • Community Support Member

  • Posts: 4953

  • Since: 2008/7/3 1


Verify the definitions for the paths in mainfile.php
Maybe your hoster moved the server and they don't correspond anymore.

3
olmiller
Re: Script error for Homepage on Xoops 2.0.16
  • 2010/2/20 12:23

  • olmiller

  • Just popping in

  • Posts: 5

  • Since: 2008/3/18


I checked the paths in mainfile.php and they look OK! I walked the paths as defined in mainfile.php and the contents 'seem' reasonable based on my recollection of the contents two years ago.

Is there any way to 'print' the name of the offending script in the error message or is there a log or debug that I could examine to see what script is failing? I am familiar with [ba|c|]sh scripting but not PHP, however, I am sure I can crack this nut!

4
Peekay
Re: Script error for Homepage on Xoops 2.0.16
  • 2010/2/20 13:05

  • Peekay

  • XOOPS is my life!

  • Posts: 2335

  • Since: 2004/11/20


This is useful if you ever need to double-check your server path:

$serverpath = !isset($_SERVER["DOCUMENT_ROOT"])? 'No path found' $_SERVER["DOCUMENT_ROOT"];
print 
$serverpath ;
?>


Quote:
I recently went to the site to upgrade it...


Do you mean upgrade Xoops, or just add some new content?.

5
ghia
Re: Script error for Homepage on Xoops 2.0.16
  • 2010/2/20 13:46

  • ghia

  • Community Support Member

  • Posts: 4953

  • Since: 2008/7/3 1


You can also use these scripts in the root that mimic mainfile behaviour.
tstpath.php
    define'XOOPS_ROOT_PATH''/definition/comme/en/mainfile' );
    include 
'tst_path.php';
?>

et tst_path.php
if (function_exists("debug_backtrace")) {
    
$xoopsScriptPath debug_backtrace();
    if (!
count($xoopsScriptPath)) {
         die(
"XOOPS path check: this file cannot be requested directly");
    }
    
$xoopsScriptPath $xoopsScriptPath[0]["file"];
    echo 
"debug_backtrace path: ".$xoopsScriptPath.'';
} else {
            
$xoopsScriptPath = isset($_SERVER["PATH_TRANSLATED"]) ? $_SERVER["PATH_TRANSLATED"] :  $_SERVER["SCRIPT_FILENAME"];
    if (isset(
$_server["path_translated"])) 
    {
        echo 
"path_translated path: ".$xoopsScriptPath.'';
    }
    else
    {
        echo 
"script_filename path: ".$xoopsScriptPath.'';
    }
}
if ( 
DIRECTORY_SEPARATOR != "/" ) {
    
$xoopsScriptPath str_replacestrpos$xoopsScriptPath"") ? "" DIRECTORY_SEPARATOR"/"$xoopsScriptPath);
    echo 
"iis path: ".$xoopsScriptPath.'';    
}
    if ( 
strcasecmpsubstr($xoopsScriptPath0strlen(XOOPS_ROOT_PATH)), str_replaceDIRECTORY_SEPARATOR"/"XOOPS_ROOT_PATH)) ) {
    echo 
"xoops_root_path path: ".str_replace(DIRECTORY_SEPARATOR"/"XOOPS_ROOT_PATH).'';
    exit(
"XOOPS path check: Script is not inside XOOPS_ROOT_PATH and cannot run.");
}
?>

Execute tstpath.php to see the result.

6
olmiller
Re: Script error for Homepage on Xoops 2.0.16
  • 2010/3/2 15:26

  • olmiller

  • Just popping in

  • Posts: 5

  • Since: 2008/3/18


Sorry for the long delay, I got the crud from some kids and it wiped me out! Thank you for all the scripts... yes my hosting company moved my home directory (only one character different than the old one) and I did not catch it until the scripts printed it out for me. Thanks again!

Login

Who's Online

294 user(s) are online (194 user(s) are browsing Support Forums)


Members: 0


Guests: 294


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: Nov 30
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits