Skip to main content

Server configuration

This page applies only if you’re installing Mixpost manually or integrating it into an existing Laravel app. Make sure your server is ready to host it by installing the necessary software and configuring it properly for optimal performance. If you’re installing Mixpost with Docker, the image already ships with everything configured and none of the instructions below are necessary.

Requirements

Software

PHP extensions

  • php-curl
  • php-mysql
  • php-bcmath
  • php-gd
  • php-mbstring
  • php-redis
  • php-xml
  • php-zip
  • php-intl

These extensions are version-specific for PHP, so if you have PHP 8.3.x installed you would run:

sudo apt install php8.3-curl php8.3-mysql php8.3-bcmath php8.3-gd php8.3-mbstring php8.3-redis php8.3-xml php8.3-zip php8.3-intl

In Plesk, you can install or upgrade PHP via "Tools & Settings -> Plesk -> Updates".

Enabling Specific PHP Functions

In PHP, certain functions are disabled by default for security reasons. To use these functions, you need to modify the disable_functions directive in the php.ini file. This guide will walk you through enabling the pcntl_signal and pcntl_alarm functions, which are commonly disabled.

Example before editing:

disable_functions = pcntl_alarm, pcntl_signal, exec, shell_exec

Example after editing:

disable_functions = exec, shell_exec

Installing Redis

If you have already installed Redis, you can skip this.

The following example is for Ubuntu:

sudo apt update
sudo apt install redis-server

Installing Supervisor

If you have already installed Supervisor, you can skip this.

The following example is for Ubuntu:

sudo apt update
sudo apt install supervisor

Installing FFmpeg

Mixpost can generate a thumbnail image from a video while the video file is being uploaded. This would not be possible without FFmpeg installed on your server.

The following example is for Ubuntu:

sudo apt update
sudo apt install ffmpeg

HEIC/HEIF Support Installation Guide

Mixpost uses libvips to convert HEIC/HEIF photos (commonly produced by iPhones and iPads) to JPEG.

Ubuntu/Debian

sudo add-apt-repository ppa:strukturag/libheif
sudo apt update
sudo apt install libvips42t64 libheif1 libde265-0

PHP Configuration

Add the following to your php.ini to enable FFI, which is required by libvips:

[FFI]
ffi.enable = true
zend.max_allowed_stack_size = -1

After installing the dependencies and updating php.ini, restart your web server and PHP-FPM to apply the changes.

Configure Web Server Document Root

Configure the web server's document root to point directly to the public directory within your Mixpost installation folder.

Mixpost must be installed directly on a primary domain or a subdomain. Installation in a subdirectory is not supported and will result in operational issues. For clarity, here are some examples of correct and incorrect setups:

  • example.com/mixpost (Invalid)
  • localhost/mixpost (Invalid)
  • example.com (Valid)
  • mixpost.example.com (Valid)
  • mixpost.test (Valid)

Below are the configurations for Nginx and Apache web servers to set the document root correctly:

Nginx Configuration

server {
listen 80;
root /var/www/path-to-your-project/public;
index index.php index.html;
client_max_body_size 13M;

# Additional Nginx configuration goes here
}

Apache Configuration

<VirtualHost *:80>
ServerAdmin webmaster@yourdomain.com
DocumentRoot "/var/www/path-to-your-project/public"
ServerName yourdomain.com
ServerAlias www.yourdomain.com

<Directory "/var/www/path-to-your-project/public">
Options Indexes FollowSymLinks
AllowOverride All
Require all granted
</Directory>

# Additional Apache configuration goes here
</VirtualHost>

Plesk

Access your Plesk panel, navigate to Hosting settings and update the Document Root to point to the public folder.

Plesk Document root

Upload Maximum File Size Configuration

Files larger than MIXPOST_CHUNKED_UPLOAD_THRESHOLD (default 10 MB) are uploaded in chunks of MIXPOST_CHUNKED_UPLOAD_SIZE (default 10 MB, maximum 64 MB), so your server only needs to handle a single chunk, not the full file. A 200 MB video still arrives as 10 MB requests.

This means your server limits must be at least the larger of those two values, plus some headroom. The examples below cover the 10 MB defaults. If you raise either variable, raise these limits to match:

MIXPOST_CHUNKED_UPLOAD_SIZEupload_max_filesizepost_max_size, client_max_body_size, LimitRequestBody
10 MB (default)12 MB13 MB
32 MB36 MB37 MB
64 MB (maximum)70 MB71 MB

upload_max_filesize limits only the file part of the request, while the other three limit the entire request body — the chunk plus the multipart boundaries and form fields — which is why they sit one step higher.

Both variables are documented under Upload File Size Limits.

warning

Server-level limits take precedence over Mixpost's settings. If PHP or your web server rejects a request that is smaller than the chunk size, uploads fail regardless of MIXPOST_MAX_VIDEO_FILE_SIZE or MIXPOST_MAX_IMAGE_FILE_SIZE.

PHP Upload Limits

1. Edit php.ini

For Apache

/etc/php/VERSION/apache2/php.ini

For PHP-FPM

/etc/php/VERSION/fpm/php.ini

Replace VERSION with your PHP version (e.g., 8.3, 8.4). Update the following settings:

upload_max_filesize = 12M
post_max_size = 13M

upload_max_filesize must be larger than the chunk size, and post_max_size must be larger than upload_max_filesize, since the request body carries the chunk plus the multipart boundaries and form fields.

2. Restart PHP to apply changes

For PHP-FPM

sudo systemctl restart phpVERSION-fpm.service

For Apache

sudo systemctl restart apache2

Nginx Upload Limit

1. Edit nginx.conf

Add the following inside the http block:

client_max_body_size 13M;

2. Restart Nginx

sudo systemctl restart nginx

Apache Upload Limit

1. Edit the Apache configuration file

# Debian/Ubuntu
/etc/apache2/apache2.conf

# RHEL/CentOS/AlmaLinux
/etc/httpd/conf/httpd.conf

2. Add or modify the following line

LimitRequestBody 13631488

LimitRequestBody is expressed in bytes, so 13631488 equals 13 MB.

3. Restart Apache

# Debian/Ubuntu
sudo systemctl restart apache2

# RHEL/CentOS/AlmaLinux
sudo systemctl restart httpd