[racktables-users] Re: Windows issue with new install

  • From: Aaron Dummer <aaron@xxxxxxxxxxx>
  • To: racktables-users@xxxxxxxxxxxxx
  • Date: Sat, 05 Jul 2014 14:43:35 -0500

Notice: Use of undefined constant CODE_VERSION - assumed 'CODE_VERSION' in
C:\xampp\htdocs\racktables\wwwroot\inc\init.php on line 45

Notice: Use of undefined constant CODE_VERSION - assumed 'CODE_VERSION' in
C:\xampp\htdocs\racktables\wwwroot\inc\init.php on line 48

This Racktables installation seems to be just upgraded to version
CODE_VERSION, while the database version is 0.20.8.
No user will be either authenticated or shown any page until the upgrade is
finished.
Follow this link and authenticate as administrator to finish the upgrade.

I installed XAMPP and reproduced the error. The problem is that 1) Windows is case-insensitive, and 2) XAMPP includes PEAR modules whose filenames conflict with RackTables filenames.

C:\xampp\php\pear contains Config.php. RackTables' init.php file has this line:
require_once 'config.php'

Because 'Config.php' gets loaded first, 'config.php' gets skipped.

A quick fix is to edit C:\xampp\php\php.ini and comment out the "include_path=" line with a semicolon. If you don't have permission to modify that file, you could also add this as the second line of RackTables' index.php file:
set_include_path (__DIR__);

As a long-term fix, RT devs may want to change all require directives to use full paths.

require_once __DIR__ . '/config.php';
   instead of
require_once 'config.php';

--
Aaron Dummer

Other related posts: