The following warnings occurred:
Warning [2] Undefined variable $unreadreports - Line: 26 - File: global.php(961) : eval()'d code PHP 8.1.2-1ubuntu2.14 (Linux)
File Line Function
/global.php(961) : eval()'d code 26 errorHandler->error
/global.php 961 eval
/showthread.php 28 require_once





× This forum is read only. As of July 23, 2019, the UserSpice forums have been closed. To receive support, please join our Discord by clicking here. Thank you!

  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
install userspice in a sub-folder without errors
#1
Thumbs Up 
It's a contribution to others that struggle with using US when it is installed not in the root of your website.

Something goes wrong (error messages in init.php and loading helper.php) and my below solution, that works:

i downloaded the last version of US and place this in a sub-folder: /applic/ 
then starting the install instructions and after that cleanup the install directory.

When using US you got error messages with the helper and init files.

The easiest way to solve this was defining my subfolder hardcoded in the init.php file like below:

$us_url_root="/applic/";
require_once $abs_us_root.$us_url_root.'users/helpers/helpers.php';

then you can remove the lines above because it doesn't work very well and give waist compute time.
what i discover was that the variable $us_url_root first was /applic/ and later was gone and still / 

so my init.php file looks like below:

<?php

require_once 'classes/class.autoloader.php';
session_start();

$abs_us_root=$_SERVER['DOCUMENT_ROOT'];

/*
$self_path=explode("/", $_SERVER['PHP_SELF']);
$self_path_length=count($self_path);
$file_found=FALSE;

for($i = 1; $i < $self_path_length; $i++){
array_splice($self_path, $self_path_length-$i, $i);
$us_url_root=implode("/",$self_path)."/";

if (file_exists($abs_us_root.$us_url_root.'z_us_root.php')){
$file_found=TRUE;
break;
}else{
$file_found=FALSE;
}
}
*/
$us_url_root="/applic/";
require_once $abs_us_root.$us_url_root.'users/helpers/helpers.php';
  Reply


Messages In This Thread
install userspice in a sub-folder without errors - by Ruud - 11-10-2018, 10:59 AM

Forum Jump:


Users browsing this thread: 1 Guest(s)