The following warnings occurred:
Warning [2] Undefined variable $unreadreports - Line: 26 - File: global.php(961) : eval()'d code PHP 8.2.25 (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 issues - Install Path vs. Web root directory vs. Server-Document Root
#1
Hello,

My development environment:

Windows 7
web server via WAMP install:
Apache 2.4.23
Php 5.6.25
MySql 5.7.14

Yesterday I installed UserSpice on my dev environment. Below are the steps I followed:

1. I added a new folder to serve as my root directory for the new web. Added folder 'Reservations' to my c:/webs/ directory.
2. Using Apache, created a new alias to go to this new web via the url: http://localhost/reservations/
3. Created a new MySQL Db with name Reservations.

This makes my file directory 'c:/webs/Reservations' and my root web directory 'localhost/reservations/'. So if I open a browser and type 'localhost/reservations/' in the address bar, I will be served the web content in 'c:/webs/Reservations'.

4. I extracted the UserSpice 4.2 into the 'c:/webs/Reservations' folder.
5. I opened a browser and typed 'localhost/reservations/'.
  • The InstallSpice 0.1a page appears.
  • The System Requirement Checks are all Green
  • The Additional Recommended Settings are all Green


6. I click the 'Continue >>' button.
The Path Settings page appears. It indicates that the system detects that i have installed this software in... C\webs\Reservations\, which is true.
It also indicates that if the system acts weird after install I may need to edit the users/init.php file. Which is also true, stay tuned.

7. I click the red 'Save Settings' button and I'm taken to the Database setup page.
8. Next I enter my db host, user, pass and name. No problem here.
9. I click the green 'Test Setting' button.
The system churns for a bit while it is creating the tables in the db then notifies me the db connection was successful and the tables were imported? successfully.

10. I click the red 'Save Settings >>' button and am taken to the Step 4/ Timezone/ReCaptcha settings page.
11. I add my timezone, add the demo keys and copyright message and click the green 'Test Settings' button.
The system shows the ReCaptcha, I test it, it works.
12. I click the red 'Save Settings' button and am taken to step 5, Cleanup.
13. I get the congratulations, I click the red 'Cleanup Install Files' button.
  • It shows the files deleted and gives a message about errors.
  • It also refers to editing the '/core/init.ini' file... which there is no core folder and no init.ini file. Maybe this message is leftover from previous versions and should be updated to users/init.php??

  • It then mentions errors in deleting and references this '/core' folder again but this time refers to 'init.php'.
  • Finally at the bottom we get a link to the index of the web. In my case it is 'localhost/Reservations/index.php'.


14. I click the link.
  Reply
#2
It's funny. I've installed userspice a hundred times and I never noticed that message about core/init. It's left over from 4.0. I definitely have it on my list to change it.

So is everything working well for you?
  Reply
#3
Sorry.. had to get some lunch.

Next I am presented the path error.

Warning: require_once(C:/wamp64/www/users/helpers/helpers.php): failed to open stream: No such file or directory in C:\webs\Reservations\users\init.php on line 22
Call Stack
# Time Memory Function Location
1 0.0360 247304 {main}( ) ...\index.php:0
2 0.0370 273544 require_once( 'C:\webs\Reservations\users\init.php' ) ...\index.php:9

So, as I mentioned above, my file path is 'c:/webs/Reservations' and this error is referring to the file path of the WAMP installation.

On checking the error in init.php identified I found that the issue is with the variable created on line 4.

Code:
$abs_us_root=$_SERVER['DOCUMENT_ROOT'];

The server document root variable refers to the default web root as designated in the Apache configuration:

# DocumentRoot: The directory out of which you will serve your
# documents. By default, all requests are taken from this directory, but
# symbolic links and aliases may be used to point to other locations.
#
DocumentRoot "${INSTALL_DIR}/www"

And, INSTALL_DIR is identified earlier in the configuration. For my Apache config:

Define INSTALL_DIR c:/wamp64

So, I definitely have to change that variable to point to my aliased file directory.
I change it to :

Code:
$abs_us_root='c:/webs/Reservations';

Upon refreshing the page, it did make a difference, but now I have a new error.

Catchable fatal error: Object of class __PHP_Incomplete_Class could not be converted to string in C:\webs\Reservations\users\classes\DB.php on line 51
Call Stack
# Time Memory Function Location
1 0.0156 248360 {main}( ) ...\index.php:0
2 0.0156 274464 require_once( 'C:\webs\Reservations\users\init.php' ) ...\index.php:9
3 0.0624 1066840 User->__construct( ) ...\init.php:92
4 0.0780 1075488 User->find( ) ...\User.php:33
5 0.0780 1076208 DB->get( ) ...\User.php:65
6 0.0780 1076352 DB->action( ) ...\DB.php:97
7 0.0780 1078144 DB->query( ) ...\DB.php:90
8 0.0780 1079224 bindValue ( ) ...\DB.php:51

Ok, back to some debugging.

As I'm following the code in init.php I notice on line 44:
Code:
$timezone_string = 'Africa/Abidjan';

I definetely set that to 'Chicago' so maybe someone needs to look in to why that is not changed.

Continuing through the init.php code:
-- ok alot of stuff going on, but we get down to line 92 to create the user:
Code:
$user = new User();

Following the User class now:

well... I followed along but the code jumps around too much to a whole day into it...

Anyone seen this error on DB.php line 51?

thanks,
chris
  Reply
#4
Ok, this is sort of scary. I added a var_dum($param) at DB.php line 51 to see what exactly the incomplete class looked like. I would show you here but it actually had a user class with a bunch of data from another website I was on in a separate firefox tab.

How userspice is accessing data in a separate session is beyond me. I could be an issue with firefox i suppose. Either way, if I can reproduce the issue it definitely is a cause for alarm.

  Reply
#5
Ok, I shut down my browsers, reopened, cleared my cache, cookies, etc..

Navigated to the localhost/Reservations/ and am now getting the home page. The body content is tucked up under the navbar at the top. CSS issue?

I click on any link and the page is not found.

Here is the url in the Admin link:
http://localhost/users/account.php

You can see the this should be: http://localhost/Reservations/users/account.php

the 'Reservations' is missing in all the links.

Help.



  Reply
#6
To be honest, it sounds like a bad Wamp64 install. UserSpice was developed on Wamp, but over time it just got really really weird.

Are you open to trying Xampp instead or is there a particular reason you're sticking with WAMP?
  Reply
#7
"To be honest, it sounds like a bad Wamp64 install."

That would mean we have 4 machines with bad installs. Not very likely.

If you have been successful at modifying the init.php file to allow for aliased domains I would love to see the modifications.

  Reply
#8
To rule out the wamp installs, I installed userspice on our test server and db.
Everything went well until the cleanup step. I'm not surprised by the cleanup not being able to delete file but it raises another question about the instruction given by the install process:

----------------------------------------------------------------------------------------------------------

Error deleting index.php
Error deleting recovery.php
Error deleting step2.php
Error deleting step3.php
Error deleting step4.php
Error deleting step5.php

If you had errors at the top of this page, you MUST go into the /core folder and delete everything except init.php.
Leaving these files present is a security vulnerability.

----------------------------------------------------------------------------------------------------------

Ok, so we have established that there is no 'core' folder in this version of userspice (4.2).
I went to the install folder and can see the files that were given in the notice above. Also, there are 2 additional files: cleanup.php and license.php and a folder named install.

If this what is referenced as the 'core' folder, there is no init.php file. The init.php file is in the users folder.

So should I delete all the files in the install folder? Or, just the ones listed above that the system was unable to delete? Or, something different?

Since this is a test server, not public facing, I'm going to just let them hang out until I get some direction.

thanks.
  Reply
#9
You can definitely delete all the files in the install folder. It normally leaves two behind by default. For some reason the "user" that you are using on your server doesn't have permission to delete files. That's rare, but not unheard of.

I'm going to clean up those instructions on the next major release. Like I said, that one slipped through the cracks.
  Reply
#10
Hi,

I am having the same problem as above. The cleanup results permission in errors. Its still refers to the /core folder which doesn't exist so as per your comment I deleted everything in the /install folder. Now i get the following error when i try to access the site: Parse error: parse error in /users/init.php on line 100

Thanks

EDIT: I have deleted the entire folder /install and it works.
  Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)