The following warnings occurred: | ||||||||||||
Warning [2] Undefined variable $unreadreports - Line: 26 - File: global.php(961) : eval()'d code PHP 8.2.25 (Linux)
|
install userspice in a sub-folder without errors - Printable Version +- UserSpice (https://userspice.com/forums) +-- Forum: Support Center (https://userspice.com/forums/forumdisplay.php?fid=23) +--- Forum: UserSpice 4.4 (https://userspice.com/forums/forumdisplay.php?fid=27) +--- Thread: install userspice in a sub-folder without errors (/showthread.php?tid=1204) |
install userspice in a sub-folder without errors - Ruud - 11-10-2018 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'; RE: install userspice in a sub-folder without errors - mudmin - 11-10-2018 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. RE: install userspice in a sub-folder without errors - Ruud - 11-10-2018 my use of US is combining it with other content. so: 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 applic.domain.com @mudmin you do a lot of good work !!! Thanks. |