× 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
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:

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:


require_once 'classes/class.autoloader.php';


$self_path=explode("/", $_SERVER['PHP_SELF']);

for($i = 1; $i < $self_path_length; $i++){
array_splice($self_path, $self_path_length-$i, $i);

if (file_exists($abs_us_root.$us_url_root.'z_us_root.php')){
require_once $abs_us_root.$us_url_root.'users/helpers/helpers.php';
Thanks so much for sharing this.

Just to let you know, I do installs in subfolders all the time and those to URLs let me move installs from folder to folder without having to worry about what folder the install is in.

Unfortunately some servers make it relatively complicated to setup subdomains and depending on whether you use an A record or some type of "forwarding" with your domain registrar, it will have a big impact on how cleanly things work.

The "ideal" way to do this is to setup an A Record with your registrar that just says
xxx.yourdomain.com forwards to an ip.

The add the subdomain to your cpanel or whatever your hosting provider uses and tell it that xxx.yourdomain.com goes to /var/www/yoursite/public_html/whateverfolder

But that isn't always possible. Thanks so much for sharing your workaround. I'm sure it will be helpful to others.
my use of US is combining it with other content.
www.domain.com is where my I install Joomla.
www.domain.com/applic/ is where I install US

of course, another way is using:
www.domain.com and

@mudmin you do a lot of good work !!! Thanks.

Forum Jump:

Users browsing this thread: 1 Guest(s)