1
jporpilla
XOOPS_ROOT_PATH and cannot run.
  • 2005/8/23 7:16

  • jporpilla

  • Just popping in

  • Posts: 48

  • Since: 2005/1/10


I'm new to XOOPS and I've been running XOOPS latest version on my localhost and it seems no problem, but when I try to upload it in a test site it shows this errors: What shall I do to fix it?

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

Here is my mainfile.php:

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

// XOOPS Physical Path
// Physical path to your main XOOPS directory WITHOUT trailing slash
// Example: define('XOOPS_ROOT_PATH', 'c:/mysql/data/villaboyz/html');
define('XOOPS_ROOT_PATH', 'localhost');

// XOOPS Virtual Path (URL)
// Virtual path to your main XOOPS directory WITHOUT trailing slash
// Example: define('XOOPS_URL', '/villaboyz');
define('XOOPS_URL', '/villaboyz');

define('XOOPS_CHECK_PATH', '1');
// 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($xoopsScriptPath, 0, strlen(XOOPS_ROOT_PATH)), str_replace( DIRECTORY_SEPARATOR, '/', XOOPS_ROOT_PATH)) ) {
exit("XOOPS path check: Script is not inside XOOPS_ROOT_PATH and cannot run.");
}
}

// Database
// Choose the database to be used
define('XOOPS_DB_TYPE', 'mysql');

// Table Prefix
// This prefix will be added to all new tables created to avoid name conflict in the database. Please change this to something different than 'xoops'.
define('XOOPS_DB_PREFIX', 'xxxxxxxx');

// Database Hostname
// Hostname of the database server. If you are unsure, 'localhost' works in most cases.
define('XOOPS_DB_HOST', 'localhost');

// Database Username
// Your database user account on the host
define('XOOPS_DB_USER', 'xxxxxxxx');

// Database Password
// Password for your database user account
define('XOOPS_DB_PASS', 'xxxxxxxx');

// Database Name
// The name of database on the host. The installer will attempt to create the database if not exist
define('XOOPS_DB_NAME', 'xxxxxxxx');

// Use persistent connection? (Yes=1 No=0)
// Default is 'No'. Choose 'No' if you are unsure.
define('XOOPS_DB_PCONNECT', '0');

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

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

2
Dave_L
Re: XOOPS_ROOT_PATH and cannot run.
  • 2005/8/23 8:54

  • Dave_L

  • XOOPS is my life!

  • Posts: 2277

  • Since: 2003/11/7


Quote:
// Example: define('XOOPS_ROOT_PATH', 'c:/mysql/data/villaboyz/html');
define('XOOPS_ROOT_PATH', 'localhost');


You need to replace 'localhost' with the correct file system path.

The first line, starting with //, is merely a comment that provides an example; changing that line has no effect.

I edited your post and replaced some of the values with 'xxxxxxxx', since that information could be useful to someone trying to hack your site.

P.S.

c:/mysql/data seems like an odd place to locate your web documents.

Login

Who's Online

231 user(s) are online (152 user(s) are browsing Support Forums)


Members: 0


Guests: 231


more...

Donat-O-Meter

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

Latest GitHub Commits