# Localhost Configuration

### **Local Server Installation**

{% hint style="danger" %}
Note:

1. Establishing a local server is a mandatory prerequisite for the successful installation of Taxido. Ensure that you configure the local server before initiating the installation process.
2. If you are Installing Application on the internet server you no need to worry about server like XAMPP or MAMPP, ensure your server must support with PHP & MySQL
   {% endhint %}

To run application you need to download web server.

1. For Mac systems download MAMPP or XAMPP Server.
2. For Windows systems download MAMPP or XAMPP Server.
3. For Linux systems download LAMPP or XAMPP Server.

MAMPP Server you can download it from <https://www.mamp.info/en/mamp/> for Windows/Mac, For Mac OS installation steps are [here](https://courses.cs.washington.edu/courses/cse154/19sp/resources/assets/servers/mamptutorial_mac.html) and For Windows installation steps are [here](https://courses.cs.washington.edu/courses/cse154/19su/resources/assets/servers/mamptutorial_pc.html)

XAMPP Server you can download it from <https://www.apachefriends.org/download.html> for Windows/Linux/Mac

Note: For demonstration we are using here XAMPP Server configuration for Mac/Window and for Linux we are using here LAMP Server. In all the servers have MySQL extensions. No need to download third party MySQL.

**XAMPP Configuration In Mac OS**

**Install XAMPP**

{% hint style="warning" %}
Note: You can skip these steps if XAMPP is already installed on your
{% endhint %}

Click [here](https://dev.to/honorezemagho/xampp-installation-step-by-step-on-macos-4hi2) to Install XAMPP for Mac OS.

**After installing XAMPP, here are a few steps you might want to consider.**

1. Open the XAMPP control panel to manage localhost server.
2. Click **Open Application Folder** in the XAMPP control panel.

<figure><img src="https://74030740-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F6o4UzjBZtMQpeq4oeh8s%2Fuploads%2FZN2K6dgvZklCIMXPnEDJ%2Fxampp-mac-1.png?alt=media&#x26;token=6e0b9869-eb70-4ea5-a4c1-f7e475048481" alt=""><figcaption></figcaption></figure>

3. In the application folder, open the etc folder and find the my.cnf file where MySQL settings are stored.
4. Right-click in the **my.cnf** file to open it in a Text Editor.<br>

<figure><img src="https://74030740-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F6o4UzjBZtMQpeq4oeh8s%2Fuploads%2FYMUfqtmSbfkXZybsC3ny%2Fxampp-mac-2.png?alt=media&#x26;token=80ec5997-04f6-4ca4-a044-cc9d01edd378" alt=""><figcaption></figcaption></figure>

5. In the Text Editor, find max\_allowed\_packet and increase 100M, to allow a maximum data size 100M sent to the MySQL server.

<figure><img src="https://74030740-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F6o4UzjBZtMQpeq4oeh8s%2Fuploads%2FrfTuDWU2fvITgLb976O7%2Fxampp-mac-3.png?alt=media&#x26;token=a95f775e-5368-49ea-a7fa-2c0b2de60bde" alt=""><figcaption></figcaption></figure>

6. Similarly, find **wait\_timeout** to extend the MySQL connection idle time to 3000

<figure><img src="https://74030740-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F6o4UzjBZtMQpeq4oeh8s%2Fuploads%2FmpwbTDe4Dx0icIsiN2lb%2Fxampp-mac-4.png?alt=media&#x26;token=f915d5cf-75e0-4676-bb4c-ab9a304d8541" alt=""><figcaption></figcaption></figure>

7. Save the modified my.cnf file, then go back to the XAMPP control panel and restart the server.

**XAMPP Configuration In Windows**

**Install XAMPP**

{% hint style="warning" %}
Note: You can skip these steps if XAMPP is already installed on your system.
{% endhint %}

Click [here](https://ngonyoku.medium.com/how-to-install-xampp-a47f0787d9b6) to Install XAMPP for Windows OS.

#### **After installing XAMPP, here are a few steps you might want to consider.**

1. Open the XAMPP Control Panel.
2. Click **config** in the Apache section. This allows you to manage apache server.
3. In the Apache section, choose "Select PHP (php.ini)."
4. In the php.ini file, find **max\_execution\_time** and increase value to **max\_execution\_time=3000** for extended execution time.

<figure><img src="https://74030740-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F6o4UzjBZtMQpeq4oeh8s%2Fuploads%2F6Ytznx5dcSeFoDTabjs2%2Fxampp-windows-1.png?alt=media&#x26;token=813e8e52-2462-4039-83ee-61c9e7f88c9e" alt=""><figcaption></figcaption></figure>

5. Find the **extension=gd** in php.ini. Remove the semicolon (;) at the beginning of the line to enable the GD extension. This is necessary for image processing in PHP.

<figure><img src="https://74030740-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F6o4UzjBZtMQpeq4oeh8s%2Fuploads%2FhySrUR886dPJBaDCHaax%2Fxampp-windows-2.png?alt=media&#x26;token=513c83f3-6243-470c-a2c6-c9912eba598f" alt=""><figcaption></figcaption></figure>

6. Click **config** in the MySQL section.
7. Open the **my.ini** file. This file controls MySQL database.
8. In the my.ini file, find **max\_allowed\_packet**. Increase its value 100M to handle larger data packets. For example, set it to max\_allowed\_packet=100M for bigger data transfers

<figure><img src="https://74030740-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F6o4UzjBZtMQpeq4oeh8s%2Fuploads%2FWMx8jCMpYPPQmk28vK4O%2Fxampp-windows-3%20(1).png?alt=media&#x26;token=a94f7326-8256-45e5-8944-b910970f3d58" alt=""><figcaption></figcaption></figure>

9. Once you've made all these changes in both Apache and MySQL, you'll need to restart XAMPP to apply the changes.

**LAMP Configuration In Ubuntu**

**Install LAMP (Linux, Apache, MySQL, PHP)**

{% hint style="warning" %}
Note: You can skip these steps if LAMP is already installed on your system.
{% endhint %}

Click [here](https://www.digitalocean.com/community/tutorials/how-to-install-linux-apache-mysql-php-lamp-stack-on-ubuntu-22-04) to Install LAMP for Ubuntu OS.

#### **After installing LAMP, here are a few steps you might want to consider.**

1. Use a text editor to open the PHP configuration file. By default, you'll find it at **`/etc/php/8.2/fpm/php.ini`**.
2. Inside the **php.ini** file, find the following keys and increase their values as shown below:
   * max\_execution\_time = 30 to 3000
   * max\_input\_time = 30 to 3000
   * memory\_limit = 16M to 100M
   * post\_max\_size=2M to 100M
   * upload\_max\_filesize = 2M to 100M
3. Save the **php.ini** file after making these changes.
4. Restart the Apache server using the following command:

```html
sudo systemctl restart apache2
```

<br>
