Skip to content

How to install LGSL

Neon edited this page Jan 12, 2024 · 15 revisions

Guide on this page is for LGSL v6.2+

If you want to use LGSL with Composer - you should use v7+ click here.

Youtube video: How to install LGSL

Note that your hosting have to be able to send queries to gameservers!

If you want to setup on your PC

  • Download and Setup WebServer (NginX or Apache)

  • Download and Setup PHP 5.4+ (PHP)

  • Download and Setup prefered database: MySQL or MariaDB.

Create empty database (for example: lgsl)

Note: For easiest way you may use WinNMP or XAMPP or AMMPS

Installation

  1. Download stable version or latest commit. of LGSL. (*Note that commit can have any bugs)
  2. Unzip on your website. (for example to: //wwwroot/lgsl)

  1. Go to Installation page and fill inputs with your database credentials (db server ip, db username, db password, database name)

  1. Choose LGSL table name and click on "Create table".
  2. Fill remaining inputs (lgsl admin name, password), choose LGSL style, language and other options.
  3. Click on "Generate config"
  4. Copy entire text to lgsl_files/lgsl_config.php and save.
  5. !! Delete install.php

Adding servers

  1. Go to http://your.awesome.website.com/lgsl/admin.php
  2. Use your admin login and password.
  3. On the next page add IP and connection port, choose game type (protocol) and click on "Save - Clear cache"

If you need, you can create the table manually using that SQL query:

CREATE TABLE `lgsl` ( \
  `id`         INT     (11)  NOT NULL auto_increment,\
  `type`       VARCHAR (50)  NOT NULL DEFAULT '',\
  `ip`         VARCHAR (255) NOT NULL DEFAULT '',\
  `c_port`     VARCHAR (5)   NOT NULL DEFAULT '0',\
  `q_port`     VARCHAR (5)   NOT NULL DEFAULT '0',\
  `s_port`     VARCHAR (5)   NOT NULL DEFAULT '0',\
  `zone`       VARCHAR (255) NOT NULL DEFAULT '',\
  `disabled`   TINYINT (1)   NOT NULL DEFAULT '0',\
  `comment`    VARCHAR (255) NOT NULL DEFAULT '',\
  `status`     TINYINT (1)   NOT NULL DEFAULT '0',\
  `cache`      MEDIUMTEXT    NOT NULL,\
  `cache_time` TEXT          NOT NULL,\
  PRIMARY KEY (`id`)\
) ENGINE=MyISAM CHARSET=utf8 COLLATE=utf8_unicode_ci;

Troubleshooting

Fatal error: Uncaught Error: Call to undefined function mysqli_connect() in ***\html\lgsl\lgsl_files\lgsl_class.php:109

To solve that problem you need to uncomment next line into php.ini:

;extension=mysqli

turn into:

extension=mysqli

If it doesn't help you, you should find php\ext folder and set absolute path to mysqli lib like for example

extension=C:\nginx\php\ext\php_mysqli.dll

Unknown database 'lgsl'

Your LGSL is not installed. First you need to create database and after it create a lgsl table. Or you just have wrong configuration settings in config.php.