Composer is necessary to manage Mautic's PHP dependencies.
Access your server via SSH.
Run the following commands to install Composer:
bash
php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"
php -r "if (hash_file('sha384', 'composer-setup.php') === 'YOUR_EXPECTED_HASH') { echo 'Installer verified'; } else { echo 'Installer corrupt'; unlink('composer-setup.php'); } echo PHP_EOL;"
php composer-setup.php
php -r "unlink('composer-setup.php');"
Replace YOUR_EXPECTED_HASH with the latest hash from the Composer site.
Move Composer to a global location:
bash
mv composer.phar /usr/local/bin/composer
You can download Mautic using Composer:
Navigate to your desired web directory:
bash
cd /path/to/your/web/root
Install Mautic:
bash
composer create-project mautic MAUTIC_DIR --no-interaction
Replace MAUTIC_DIR with your desired directory name.
Make sure the web server user has the right permissions:
bash
chown -R user:user /path/to/MAUTIC_DIR
chmod -R 755 /path/to/MAUTIC_DIR
Replace user:user with the appropriate user and group.
You will need to set up LiteSpeed to handle Mautic’s requests. This might involve creating an .htaccess file or altering the server configuration.
.htaccess for Mautic:apache
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?_url=$1 [QSA,L]
Place this file in the root directory of your Mautic installation.
http://your-domain.com/MAUTIC_DIR.