The following warnings occurred:
Warning [2] Undefined variable $unreadreports - Line: 26 - File: global.php(961) : eval()'d code PHP 8.1.2-1ubuntu2.18 (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
Undefined variable: us_url_root but path is showed correctly during installation
#1
Hi! I want to test userspice, but I'm getting the same error with this versione and even with 4.1. I install US into a subidir of my nginx root (html/enl is the subdir). During the installation process the path is correctly showed, but after installation is completed, I get the following error:
<pre>
Code:
Notice: Undefined variable: us_url_root in /home/webuser/www/hackerwolf.xyz/html/enl/users/init.php on line 22

Warning: require_once(/home/webuser/www/hackerwolf.xyz/html/enlusers/helpers/helpers.php): failed to open stream: No such file or directory in /home/webuser/www/hackerwolf.xyz/html/enl/users/init.php on line 22

Fatal error: require_once(): Failed opening required '/home/webuser/www/hackerwolf.xyz/html/enlusers/helpers/helpers.php' (include_path='.:/usr/share/php') in /home/webuser/www/hackerwolf.xyz/html/enl/users/init.php on line 22
</pre>


It's like a missing "/" somewhere not detected from the for loop in users/init.php but I can't figure out how to fix it. Any idea? Thanks in advance.

Nginx 1.11.3 w/ PHP 7.0.11
  Reply
#2
Ok. So let's walk through this.

Judging by your code, you are accessing your site by going to hackerwolf.xyz, right?

So try this. Comment out line 12 of users/init.php and put

Code:
$us_url_root='/html/enl/';

My gut says that will get you close enough to getting the pages loaded enough to know if you either have an extra slash or need one somewhere.

If that doesn't work, you can do go on any page and put
Code:
dump($abs_us_root);
Code:
dump($us_url_root);

and you can figure out what path the system thinks it is seeing.
  Reply
#3
Ok, I'm accessing trough enl.hackerwolf.xyz or hackerwolf.xyz/enl.

Tried your suggestion, it doesn't work. Not able to add dump() beacause I always get the above error.
  Reply
#4
Try doing
Code:
echo "<pre>";
Code:
var_dump($abs_us_root);
Code:
var_dump($us_url_root);
Code:
echo "</pre>";

That will accomplish the same thing as my dump function.

I would replace line 12 on init.php with
Code:
$us_url_root='/enl/';

as a starting point. Then you might need to remove a slash from either side to make it all work.

  Reply
#5

<pre>
Code:
string(41) "/home/webuser/www/hackerwolf.xyz/html/enl"

Notice:  Undefined variable: us_url_root in /home/webuser/www/hackerwolf.xyz/html/enl/users/init.php on line 25

NULL
</pre>


Tried many paths... same dump printed.
  Reply
#6
Ok. You're getting close.

I think the trick is going to be:
Line 2 of init.php

Code:
$abs_us_root='http://hackerwolf.xyz';

Line 12

Code:
$us_url_root='/enl/';
  Reply
#7
Although you might need to make line 2

Code:
$abs_us_root='http://hackerwolf.xyz/';
  Reply
#8
Nothing.

Putting $abs_us_root='/home/webuser/www/hackerwolf.xyz/html/enl/'; I get

string(42) "/home/webuser/www/hackerwolf.xyz/html/enl/"


Notice: Undefined variable: us_url_root in /home/webuser/www/hackerwolf.xyz/html/enl/users/init.php on line 26

NULL

Notice: Undefined variable: us_url_root in /home/webuser/www/hackerwolf.xyz/html/enl/users/init.php on line 29

Notice: Undefined variable: us_url_root in /home/webuser/www/hackerwolf.xyz/html/enl/users/init.php on line 63

Notice: Undefined variable: us_url_root in /home/webuser/www/hackerwolf.xyz/html/enl/users/init.php on line 64

Notice: Undefined variable: us_url_root in /home/webuser/www/hackerwolf.xyz/html/enl/users/init.php on line 65

Notice: Undefined variable: us_url_root in /home/webuser/www/hackerwolf.xyz/html/enl/users/init.php on line 66

Notice: Undefined variable: us_url_root in /home/webuser/www/hackerwolf.xyz/html/enl/users/init.php on line 67

Notice: Undefined variable: us_url_root in /home/webuser/www/hackerwolf.xyz/html/enl/users/init.php on line 68

Notice: Undefined variable: us_url_root in /home/webuser/www/hackerwolf.xyz/html/enl/users/init.php on line 69

Notice: Undefined variable: us_url_root in /home/webuser/www/hackerwolf.xyz/html/enl/users/init.php on line 70

Notice: Undefined variable: us_url_root in /home/webuser/www/hackerwolf.xyz/html/enl/users/init.php on line 71

Notice: Undefined variable: us_url_root in /home/webuser/www/hackerwolf.xyz/html/enl/users/init.php on line 72

Notice: Undefined variable: us_url_root in /home/webuser/www/hackerwolf.xyz/html/enl/users/init.php on line 73

Notice: Undefined variable: us_url_root in /home/webuser/www/hackerwolf.xyz/html/enl/index.php on line 10

Notice: Undefined variable: us_url_root in /home/webuser/www/hackerwolf.xyz/html/enl/users/includes/header.php on line 22

Notice: Undefined variable: us_url_root in /home/webuser/www/hackerwolf.xyz/html/enl/users/includes/header.php on line 23

Notice: Undefined variable: us_url_root in /home/webuser/www/hackerwolf.xyz/html/enl/users/includes/header.php on line 27

Notice: Undefined offset: -1 in /home/webuser/www/hackerwolf.xyz/html/enl/users/helpers/helpers.php on line 43

Notice: Undefined variable: us_url_root in /home/webuser/www/hackerwolf.xyz/html/enl/users/includes/header.php on line 29


But only if I hit by hackerwolf.xyz/enl. Done via enl.hackerwolf.xyz it redirects to https://enl.hackerwolf.xyz/usersc/ with a blank page, after displaying the above errors for a moment.
  Reply
#9
I'm going to send you an email from my gmail account.
  Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)