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
Failure re-declaring config.php
#1
I'm testing out the latest UserSpice on an XAMPP install (v5.6.3) and get the following when I attempt to access a page having successfully logged on:

Code:
Fatal error: Cannot redeclare class Config in C:\xampp\php\pear\Config.php on line 44

This appears to be because UserSpice and XAMPP both use the Config.php function and despite the evidence from the videos (!) my install of XAMPP doesn't seem to want to play nicely... What's really confusing is that the UserSpice admin pages are fine and work normally.

I copied and pasted the lines suggested in the UserSpice index page into my own php file to place the page under user control. These lines are:
<pre>
Code:
require_once 'users/init.php';
require_once $abs_us_root.$us_url_root.'users/includes/header.php';
require_once $abs_us_root.$us_url_root.'users/includes/navigation.php';
if (!securePage($_SERVER['PHP_SELF'])){die();}
</pre>


Any ideas?
  Reply
#2
<Later> Apologies about replying to my own post but I have been doing some more digging. There is indeed an alternative class in the Xampp pear library called Config that offers a number of functions such as isConfigTypeRegistered and registerConfigType.

I notice that the videos use WAMP and not XAMPP so I'll try an install of that.
  Reply
#3
<Even Later> Yep - problem seems to be a clash in Xampp. All works fine with WAMP64. Maybe worth noting that there is a class naming conflict though to help avoid others make this mistake...

Anyway, all sorted for me now. Hope my experience helps other noobs.
  Reply
#4
I think it's something different. The bulk of development of 4.1 was done on XAMPP. That's pretty much all I've been using for the past few months.

What happens if you rename the class config2 and then change the init file to link to config2?

I will try installing a newer xampp and see what happens on my end.
  Reply
#5
I'm running on version 5.6.15 without issue. I wonder if you should download a newer version of xampp.
  Reply
#6
If you're on linux...
http://stackoverflow.com/questions/25145...config-php

This is straight from the makers of xampp. I'm guessing an update (if you're able) will solve your problem.
https://community.bitnami.com/t/error-af...ig/25114/4
  Reply
#7
Yep, having something approaching "modern" would be good Smile

I hadn't realise just how woefully out-of-date I'd become! As it happens I switched to WAMP64 which seems to be working fine.

Thanks for the links though.
  Reply
#8
I absolutely love WAMP...the only thing I would say is that the database is a LOT slower. I have a db table with 3800 rows in it and a query on WAMP can take 5 seconds where XAMPP is a fraction of a second.
  Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)