> For the complete documentation index, see [llms.txt](https://lekir.mfbktech.academy/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://lekir.mfbktech.academy/setup/github.md).

# Github

Download source code from github and set it yourself

### Repository

{% embed url="<https://github.com/firdauskhairuddin/lekir>" %}
Download this repo containing lekir source code
{% endembed %}

### Prerequisite

Before proceeding with the installation and setup of Lekir, ensure you have the following prerequisites installed on your system:

* **Git**: Version control system for managing the Lekir source code.
* **Apache**: Web server software to host the Lekir web application.
* **MySQL**: Relational database management system (RDBMS) for storing Lekir's data.
* **Development Environment** (Choose one):
  * **XAMPP, LAMP, or Laragon** (for Windows, Mac): Bundled software packages that include Apache, MySQL, PHP, and other tools necessary for web development.
* **Text Editor** (Choose one):
  * Nano
  * Vi or Vim
  * Notepad or Notepad++
  * Sublime Text
  * Visual Studio Code (VSCode)

These prerequisites are essential for setting up and running the Lekir web application on your system.

## Windows

Open Command Prompt (cmd) and run the following command. Make sure you have Git installed:

```
git clone https://github.com/firdauskhairuddin/lekir.git
```

Once the download is complete, move the "lekir" folder to your default server root directory, typically named "htdocs" or "www".

**Note:** Be cautious not to move the ".git" folder into the server root directory, as it may disclose the source code. [Read more](https://commonvuln.mfbktech.academy/git-of-terror)

Next, locate and edit the configuration file at:

```
/core/configuration.php
```

```
<?php

$DB_HOST = "127.0.0.1";
$DB_NAME = "lekir";
$DB_USER = ""; <- change this
$DB_PASS = ""; <- change this
```

To import the "lekir.sql" file into your MySQL database, you can follow these steps:

***

#### **Using Command Prompt (cmd):**

**Open Command Prompt**: Launch Command Prompt (cmd) on your Windows system.

**Navigate to MySQL Bin Directory (Optional)**: If MySQL's bin directory is not in your system's PATH, navigate to it using the `cd` command. For example:

```
cd C:\Program Files\MySQL\MySQL Server\{version}\bin
```

**Creating database**: Once in the MySQL bin directory, execute the following command to create "lekir" database.

```
mysql -u <user> -p
```

Enter your password when prompted and execute the following MySQL commands:

```
create database lekir;
exit
```

**Import SQL File**: After creating the database, import the "lekir.sql" file into your database with the following command:

```
mysql -u <user> -p lekir < lekir.sql
```

You'll be prompted to enter your password again for exporting the .sql file

By following these steps, you've successfully created the "lekir" database and imported the necessary SQL file. This ensures that the database structure and data required for the Lekir web application are set up correctly.<br>

***

#### Using phpmyadmin

**Access phpMyAdmin**: Open your web browser and navigate to `http://localhost/phpmyadmin`.

**Login to phpMyAdmin**: Enter your username and password to log in to phpMyAdmin.

on the to right conner click on New button

<figure><img src="https://2630356582-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FXTLReKV544nhsoOPuZAB%2Fuploads%2FeUxV4nucpBsv6GhUmMZr%2FScreenshot%202024-03-24%20at%2011.58.59%20PM.png?alt=media&amp;token=b6999d19-44b2-41f7-b7d1-032d1b81c354" alt=""><figcaption></figcaption></figure>

**Create New Database**:

* Click on the "New" button located in the top-right corner of the phpMyAdmin interface.
* In the dialog box that appears, enter `lekir` as the database name and click on the "Create" button to create the new database.

<figure><img src="https://2630356582-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FXTLReKV544nhsoOPuZAB%2Fuploads%2F4YPPtpsQY9evGPs2loTX%2FScreenshot%202024-03-25%20at%2012.00.57%20AM.png?alt=media&amp;token=d1d77e05-ff75-436f-9ac9-22213c5a7f4d" alt=""><figcaption></figcaption></figure>

**Import SQL File**:

* After creating the `lekir` database, ensure you're still on the `lekir` database tab.
* Navigate to the "Import" tab located in the top menu.
* Click on the "Choose File" button and select the `lekir.sql` file from your local system.
* Once the file is selected, click on the "Import" button to initiate the import process.

<figure><img src="https://2630356582-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FXTLReKV544nhsoOPuZAB%2Fuploads%2FiGPmYAd8V7is9h7HSZrv%2FScreenshot%202024-03-25%20at%2012.05.10%20AM.png?alt=media&amp;token=4c43c6e5-eaad-45e7-ba34-7b525c4bedfa" alt=""><figcaption></figcaption></figure>

**Accessing Lekir Framework**:

* After the import process is complete, you should have access to the Lekir framework. You can verify this by navigating to the appropriate URL where the Lekir web application is hosted.

By following these steps, you can resolve collation problems that may occur during the import process in phpMyAdmin and successfully access the Lekir framework.<br>

**Note**: If you encounter collation problems during import, follow these steps to resolve them:

* After selecting the `lekir.sql` file, scroll down to the "Options" section.
* In the "Format" dropdown menu, select "SQL".
* In the "Collation of the file" dropdown menu, choose the appropriate collation for your database (e.g., utf8\_general\_ci).
* Click "Go" to proceed with the import.

<br>

***

## Linux

```
cd /opt
git clone https://github.com/firdauskhairuddin/lekir.git
cd lekir
cp -r * /var/www/html
chown -r www-data:www-data /var/www/html
systemctl restart apache2
systemctl status apache2
```

clone lekir repo into opt folder and move it into server root directory - /var/www/html, then change permission and restart apache services

```
mysql -u <user> -p
enter your mysql password

create database lekir;
exit

mysql -u <user> -p lekir < /path_to_sql_dump/lekir.sql
```

login into mysql. create lekir database, exit and importing lekir.sql into the newly created database.

After successful, you can visit the page using url

\[<http://localhost/lekir>]

<figure><img src="https://2630356582-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FXTLReKV544nhsoOPuZAB%2Fuploads%2FUsH36oeRy6CQNoInkyh0%2FScreenshot%202024-03-25%20at%2012.15.12%20AM.png?alt=media&amp;token=ae04a27e-1c6c-44d5-b963-177fbd8eca82" alt=""><figcaption><p>access using url - http://localhost/lekir</p></figcaption></figure>

***

### Disable function

after login, you might notice that some function are disable by default. Usually it

* Function display\_errors: Disable
* Function allow\_url\_fopen: Disable

to fix this, find you php.ini

linux

```
sudo nano /etc/php/php8/php.ini
```

Find display\_errors

by default it will be display\_errors=Off , just change it to display\_errors=On

Find allow\_url\_fopen

by default it will be allow\_url\_fopen=Off , just change it to allow\_url\_fopen=On

```
systemctl restart apache2
```

Windows

find php.ini and edit this file

Find display\_errors

by default it will be display\_errors=Off , just change it to display\_errors=On

Find allow\_url\_fopen

by default it will be allow\_url\_fopen=Off , just change it to allow\_url\_fopen=On

restart your web service, xampp, lamp, laragon, etc
