# Installation

Installing XT Massive Image Optimizer (opens new window) is no different than running a PHP script from the terminal.

The command xt-mio can be run directly on the server (Option 1) or executed in the context of a Docker container (Option 2). If you choose to run it directly on the server, you can execute it from the project source (Option 1.a) or from the packed phar command-line (Option 1.b)

Before executing the command-line, confirm that the server meets the server requirements (opens new window).

# Option 1 - Installation on the server

# Option 1.a - Execute from the project source

Run the following command from the project folder:

# Option 1.b - Execute from the packed command-line

The command is also built as a phar file (PHP executable).

Run the following command from the project folder:

The command phar file ./builds/xt-mio can be copied to any location on your server.

# Option 2 - Execution in a container

The xt-mio command can be executed in the context of a Docker image to avoid installing the tools on the server itself, check the included Dockerfile to build the image. The build script build/docker-build-image.sh is provided for this task.

The first step, build the Docker image from the provided Dockerfile:

Then, execute the following script:

The previous script is a shorthand to the following command:

# Executing the command for a site

The previous command can be extended to process the site images:

# Executing the command for several sites

The previous command can be further extended to process the images of several sites on the same server, this is a handy script to accomplish the task:

Last Updated: 4/16/2024, 4:44:17 PM