Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

install on win10 failing #286

Closed
daj1u06 opened this issue Dec 23, 2023 · 3 comments
Closed

install on win10 failing #286

daj1u06 opened this issue Dec 23, 2023 · 3 comments

Comments

@daj1u06
Copy link

daj1u06 commented Dec 23, 2023

• Xampp 8.2.12
• Librebooking master (not development) version as of 01/12/2023

Really hoping someone can point out my errors as have spent multiple days failing. Long story, but I have documented it all to try to offer some updated installation help instructions when I finally find out what does work.

Have been running multiple instances/databases in separate folders in iC:\xampp\htdocs\ in a win7 environment for many years so not a complete novice but certainly not a sql or php expert

Been trying to install a test system on win 10 as a prelude to migrating the multiple existing instances to a new win10 environment

Have got through the missing dependencies stage using composer install and enabling multiple php extensions that are not documented as needing enabling in the existing installation docs. Completed that without errors.

Web/install doesn't work because it looks for/needs folder tpl_c at root of the app, and this doesn't exist in current builds (it used to).

Therefore tried manual installation, Using phpMyAdmin I've create the database called test, added me as a user (in addition to root) and edited the various .sql files in database_schema folder as seemed appropriate.

I've imported database-schema.sql into database test without any errors

I then can't import sample-data-utf8.sql. I get lots of errors which seem to relate to it trying to add data to foreign keys in child tables, when the data doesn't exist in the parent tables (and I'm not sure how to add it there).
Errors like:
SQL query: Copy
insert into group_roles values (1, 1);
MySQL said:
#1452 - Cannot add or update a child row: a foreign key constraint fails (test.group_roles, CONSTRAINT group_roles_ibfk_2 FOREIGN KEY (role_id) REFERENCES roles (role_id) ON DELETE CASCADE ON UPDATE CASCADE)

I also can't open the database in the browser, I get the following:

Warning: Undefined array key "test" in C:\xampp\htdocs\testbooked\lib\Config\Configuration.php on line 128

Fatal error: Uncaught Error: Call to a member function GetSectionKey() on null in C:\xampp\htdocs\testbooked\lib\Config\Configuration.php:133 Stack trace: #0 C:\xampp\htdocs\testbooked\lib\Common\Logging\Log.php(94): Configuration->GetSectionKey('logging', 'level') #1 C:\xampp\htdocs\testbooked\lib\Common\Logging\ExceptionHandler.php(19): Log::Error('Uncaught except...', Object(ParseError)) #2 [internal function]: ExceptionHandler::Handle(Object(ParseError)) #3 {main} thrown in C:\xampp\htdocs\testbooked\lib\Config\Configuration.php on line 133

I had edited this file on line 81 to point to my database:
line 81 is now public const DEFAULT_CONFIG_ID = 'test'; (the only occurrence of test in the file - my edit to the database name - the default was librebooking. I've also tried using librebooking and testbooked, None work so I've no idea how/where to define this array key and to what value, other than what I have tried.

line 128 is "return $this->_configs[$configId];"
line 122 is "return $this->File(self::DEFAULT_CONFIG_ID)->GetSectionKey($section, $keyName, $converter);"

I've probably done something stupid somewhere but for the life of me I can't see what and would hugely appreciate any suggestions for where I've gone wrong.

Many thanks and season's greetings.

@colisee
Copy link
Contributor

colisee commented Dec 24, 2023

Hi @daj1u06 ,

My only experience of librebooking on Windows is through the librebooking docker image.

Anyway, given all the attempts you made on your win10, I would recommend the following course of actions on your host:

  1. Delete the folder(s) where you installed librebooking
  2. Drop the mysql database(s) related to librebooking
  3. Install the latest stable librebooking (2.8.6.1) in a new folder
  4. Create the tpl_c folder at the root of the new librebooking folder
  5. Follow the installation instructions. When reaching the database setup, it should be a matter of accessing http://localhost/Web/install

I hope it will work for you this time.

Merry Xmas.

@daj1u06
Copy link
Author

daj1u06 commented Dec 26, 2023

Thanks, I discovered a couple of typos in my config.php which when corrected allowed the Web\install option to launch and with some further tweaking to install without errors, although I still couldn't run the sample data import on either the sql root account or my own sql account and so had zero users and couldn't log in. I finally managed to create the users by copying individual chunks of the sample data sql file code into phpMyAdmin's SQL window so am up. and running (a nice Christmas present). I'll also checkout the docker option that I hadn't previously understood the relevance of. Thanks to everyone who contributes to this project.

@daj1u06
Copy link
Author

daj1u06 commented Dec 26, 2023

Thanks, sorted now, see above.

@daj1u06 daj1u06 closed this as completed Dec 26, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants