xoops forums

lmzan

Not too shy to talk
Posted on: 2013/12/16 20:41
lmzan
lmzan (Show more)
Not too shy to talk
Posts: 104
Since: 2005/6/21
#1

Site down after server change absolut path

Hello

My host server had the brilliant idea to change folders in server and now my site is down with this error message page:

Fatal error: Class 'XoopsPreload' not found in /var/www/html/**domain**.com/web/index.php on line 24


I'm running Xoops 2.4.5 in Linux Server.

My new physical path now is the root, or just /.

The mainfile.php section for the paths is:

// XOOPS Physical Paths

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

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


Even though I've changed the physical path I still can't make the site work. I did a checksum and It's fine, only some imagem files are missing but not big deal.

I've checked my database and there is no link to the old physical path.

How can I fix it, any starting point?*/

redheadedrod

Home away from home
Posted on: 2013/12/16 22:47
redheadedrod
redheadedrod (Show more)
Home away from home
Posts: 1296
Since: 2008/2/26
#2

Re: Site down after server change absolut path

Remember that in Linux or Windows if you do NOT start with a / as the front of the path name the file or path are related to the current path. To insure you have the correct path name you should NOT assume you are starting in the right path and need to enter this into your paths.

Not knowing your site setup it is likely the web user account is starting in its "home" directory so what you list is not going to work.

Assuming the WWW home directory is actually:

/home/www/

Then your actual pathnames as you have them entered would be:

define('XOOPS_ROOT_PATH''/home/www/');
    
define('XOOPS_PATH''/home/www/xoops_lib');
    
define('XOOPS_VAR_PATH''home/xoops_cache');


So this is probably not what you want.

Assuming your main directory is / you would need to put that in your configuration like this:

define('XOOPS_ROOT_PATH''/');
    
define('XOOPS_PATH''/xoops_lib');
    
define('XOOPS_VAR_PATH''/xoops_cache');


Just make sure that you use the absolute file path to your website in these lines. Which means on Linux it needs to start with / or with windows it might be something like C:\www

Beyond that you should NEVER use /root or / as a webserver accessible directory. This is extremly insecure and allows anyone accessing the site through the webserver to access any of the subdirectories if the site security is bypassed.

Your error is telling you where it is looking for your site.

Your main site should be in the directory:
/var/www/html/

So if you copy your files to that directory and then make sure you change your main file entries to match you should be set. You will need to also delete all of the files in your cache directories (Other than index.html) and you may need to delete all of the entries in the sessions table or you will have issues because the file paths have changed.

SO in other words your mainfile should have lines like this in it:

define('XOOPS_ROOT_PATH''/var/www/html/');
    
define('XOOPS_PATH''/var/www/html/xoops_lib');
    
define('XOOPS_VAR_PATH''/var/www/html/xoops_cache');


lmzan

Not too shy to talk
Posted on: 2013/12/17 14:36
lmzan
lmzan (Show more)
Not too shy to talk
Posts: 104
Since: 2005/6/21
#3

Re: Site down after server change absolut path

Hello redheadedrod

Thanks, you've just gave me the starting point to solve it. After following your tips, in a try an error basis, I've figured out the complete absolut path:

define('XOOPS_ROOT_PATH''/var/www/html/***domain.com/web');


It's working now, thanks a lot!


*/

redheadedrod

Home away from home
Posted on: 2013/12/17 19:21
redheadedrod
redheadedrod (Show more)
Home away from home
Posts: 1296
Since: 2008/2/26
#4

Re: Site down after server change absolut path

Glad I could help.. Sometimes we just need someone to turn the light on for us. ;)