1
vina
XoopsPreload
  • 2018/3/16 15:02

  • vina

  • Just popping in

  • Posts: 5

  • Since: 2018/3/16


I transferred my web site tshsp.com to another server
site do not open in new server and give me this error message:
Fatal error: Class 'XoopsPreload' not found in /home2/tshsp/public_html/index.php on line 31

Version XOOPS: 2.5.6
PHP: 5.2

when I changed version php to upper of 5.2 , site do not open and give me error message for "can not to connection database"

2
goffy
Re: XoopsPreload
  • 2018/3/16 16:13

  • goffy

  • Just can't stay away

  • Posts: 535

  • Since: 2010/12/27


Hi
did you also transfer database?
if yes, does the database and the user have the same name, is the password the same?
if names or password changed you have to adopt xoops_data/data/secure.php

3
vina
Re: XoopsPreload
  • 2018/3/16 17:40

  • vina

  • Just popping in

  • Posts: 5

  • Since: 2018/3/16


Database is transferred to new server also
username and password user of database is same and checked file xoops_data/data/secure.php
but this error message show me in home and other page of web site tshsp.com
Fatal error: Class 'XoopsPreload' not found in /home2/tshsp/public_html/index.php on line 31

4
geekwright
Re: XoopsPreload

Are you sure the PATH settings in mainfile.php are correct? This could be a symptom of the XOOPS_ROOT_PATH being invalid.

5
vina
Re: XoopsPreload
  • 2018/3/16 19:48

  • vina

  • Just popping in

  • Posts: 5

  • Since: 2018/3/16


the PATH settings in mainfile.php is correct
I think this problem is relate to setting of file php.ini
do it have relate XoopsPreload to php.ini?
Fatal error: Class 'XoopsPreload' not found in /home2/tshsp/public_html/index.php on line 31

6
Mamba
Re: XoopsPreload
  • 2018/3/16 20:20

  • Mamba

  • Moderator

  • Posts: 11366

  • Since: 2004/4/23


Normally it shouldn't be a problem, unless you server is looking at:
/home/

while your XOOPS is trying to get to :

/home2/

but doesn't have access.
Support XOOPS => DONATE
Use 2.5.10 | Docs | Modules | Bugs

7
vina
Re: XoopsPreload
  • 2018/3/16 20:38

  • vina

  • Just popping in

  • Posts: 5

  • Since: 2018/3/16


site was in old server in /home/
but site is in new server on /home2/
then I edited mainfile.php to thic change:

<?php
/**
 * XOOPS main configuration file
 *
 * You may not change or alter any portion of this comment or credits
 * of supporting developers from this source code or any supporting source code
 * which is considered copyrighted (c) material of the original comment or credit authors.
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 *
 * @copyright   The XOOPS Project http://sourceforge.net/projects/xoops/
 * @license     GNU GPL 2 (http://www.gnu.org/licenses/old-licenses/gpl-2.0.html)
 * @version     $Id: mainfile.dist.php 5192 2010-09-06 09:00:36Z forxoops $
 */

if (!defined("XOOPS_MAINFILE_INCLUDED")) {
    
define("XOOPS_MAINFILE_INCLUDED"1);

    
// XOOPS Physical Paths

    // Physical path to the XOOPS documents (served) directory WITHOUT trailing slash
    
define('XOOPS_ROOT_PATH''/home2/tshsp/public_html');

    
// For forward compatibility
    // Physical path to the XOOPS library directory WITHOUT trailing slash
    
define('XOOPS_PATH''/home2/tshsp/mylib');
    
// Physical path to the XOOPS datafiles (writable) directory WITHOUT trailing slash
    
define('XOOPS_VAR_PATH''/home2/tshsp/mydata');
    
// Alias of XOOPS_PATH, for compatibility, temporary solution
    
define("XOOPS_TRUST_PATH"XOOPS_PATH);

    
// URL Association for SSL and Protocol Compatibility
    
$http 'http://';
    if (!empty(
$_SERVER['HTTPS'])) {
        
$http = ($_SERVER['HTTPS']=='on') ? 'https://' 'http://';
    }
    
define('XOOPS_PROT'$http);

    
// XOOPS Virtual Path (URL)
    // Virtual path to your main XOOPS directory WITHOUT trailing slash
    // Example: define('XOOPS_URL', 'http://www.tshsp.com');
    
define('XOOPS_URL''http://www.tshsp.com');

    
// Shall be handled later, don't forget!
    
define("XOOPS_CHECK_PATH"0);
    
// Protect against external scripts execution if safe mode is not enabled
    
if (XOOPS_CHECK_PATH && !@ini_get("safe_mode")) {
        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"];
        } else {
            
$xoopsScriptPath = isset($_SERVER["PATH_TRANSLATED"]) ? $_SERVER["PATH_TRANSLATED"] :  $_SERVER["SCRIPT_FILENAME"];
        }
        if (
DIRECTORY_SEPARATOR != "/") {
            
// IIS6 may double the  chars
            
$xoopsScriptPath str_replace(strpos($xoopsScriptPath"\\"2) ? "\\" DIRECTORY_SEPARATOR"/"$xoopsScriptPath);
        }
        if (
strcasecmp(substr($xoopsScriptPath0strlen(XOOPS_ROOT_PATH)), str_replace(DIRECTORY_SEPARATOR"/"XOOPS_ROOT_PATH))) {
             exit(
"XOOPS path check: Script is not inside XOOPS_ROOT_PATH and cannot run.");
        }
    }

    
// Secure file
    
require XOOPS_VAR_PATH '/data/secure.php';

    
define('XOOPS_GROUP_ADMIN''1');
    
define('XOOPS_GROUP_USERS''2');
    
define('XOOPS_GROUP_ANONYMOUS''3');

    if (!isset(
$xoopsOption["nocommon"]) && XOOPS_ROOT_PATH != "") {
        include 
XOOPS_ROOT_PATH."/include/common.php";
    }

}


if (!isset(
$xoopsOption["nocommon"]) && XOOPS_ROOT_PATH != "") {
        include 
XOOPS_ROOT_PATH."/include/common.php";
    } else {
    global 
$xoops$xoopsPreload;
    
defined('DS') or define('DS'DIRECTORY_SEPARATOR);
        require_once 
XOOPS_ROOT_PATH DS 'class' DS 'xoopsload.php';
        
XoopsLoad::load('preload');
        
$xoopsPreload =& XoopsPreload::getInstance();
    }

?>


but site have this problem yet!!

8
Mamba
Re: XoopsPreload
  • 2018/3/16 20:52

  • Mamba

  • Moderator

  • Posts: 11366

  • Since: 2004/4/23


Did you set the folder properties correctly?

Sometimes when you copy files to a folder, the group and owner don't match, i.e. the server assigns the folder to admin as a "root", and when you login as a user, the system can't see the files.

It happened to me couple of times

Make sure that all folders (like the /class folder) have the same group and owner as all the other folders.
Support XOOPS => DONATE
Use 2.5.10 | Docs | Modules | Bugs

9
geekwright
Re: XoopsPreload

Does the file /home2/tshsp/public_html/include/common.php exist?

10
goffy
Re: XoopsPreload
  • 2018/3/17 7:07

  • goffy

  • Just can't stay away

  • Posts: 535

  • Since: 2010/12/27


Hi

I tried to reproduce the error:
if XOOPS_ROOT_PATH is wrong I get:
Quote:
Warning: include(C:/Homepages/wamp/www/naturfreunde/htdocs-wrongpath/include/common.php): failed to open stream: No such file or directory in C:\Homepages\wamp\www\naturfreunde\htdocs\mainfile.php on line 104

Quote:
Warning: include(): Failed opening 'C:/Homepages/wamp/www/naturfreunde/htdocs-wrongpath/include/common.php' for inclusion (include_path='.;C:\php\pear') in C:\Homepages\wamp\www\naturfreunde\htdocs\mainfile.php on line 104

Quote:
Fatal error: Class 'XoopsPreload' not found in C:\Homepages\wamp\www\naturfreunde\htdocs\index.php on line 31

if warning are turned off in php.ini you get only the fatal error.

If I am not sure whether the path is really ok I do following:
- create a folder on root (e.g. test)
- then uploading a new xoops
- installing
- checking mainfile.php, because then you see the path needed

Login

Who's Online

233 user(s) are online (131 user(s) are browsing Support Forums)


Members: 0


Guests: 233


more...

Donat-O-Meter

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

Latest GitHub Commits