MASACP v1.0.1
MASACP Docs

Deploying a PHP Application

2 min read • Last updated: Oct 18, 2026

Deploying a PHP Application

Learn how to deploy modern PHP applications (such as Laravel, Symfony, CodeIgniter, or custom PHP scripts) on MASACP with isolated PHP-FPM pools, multi-version PHP support, automated database provisioning, and SSL encryption.


Prerequisites: DNS Setup

Ensure your domain’s DNS records are pointing to your MASACP server IP before adding the website:

  • A Record: Points @ (or your domain, e.g. example.com) to your server’s public IP address.
  • CNAME Record: Points www to your root domain (example.com).

Note: MASACP automatically configures 301 redirection between www and non-www versions of your domain by default.

Step 1: Open the Add Website Modal

  1. Log in to your MASACP Admin Console.
  2. Navigate to Websites in the left sidebar navigation.
  3. Click the Add New Website button.
  4. Select the PHP application type tab.

Step 2: Enter Domain & Set Resource Limits

  1. Domain Name: Enter your domain (e.g., example.com or app.example.com).
  2. Allocated Resource Limits (0 = Unlimited): Define hardware resource constraints enforced via Linux Cgroups v2:
    • CPU Limit %: The maximum percentage of CPU capacity this site can consume.
    • RAM Limit (MB): Dedicated memory threshold for the site’s PHP-FPM workers.
    • Disk Limit (MB): Storage space limit for the application files and uploads.
    • Max Inodes: The total number of files and directories permitted.

Step 3: Database & SSL Automation

  • Auto-Create & Link Database & User: Check this option if your PHP application requires a MySQL/MariaDB database. MASACP will create a secure, isolated database and user credentials automatically.
  • Auto-Issue Free SSL Certificate (Let’s Encrypt): Check this option to automatically obtain an SSL certificate and force secure HTTPS connections via 301 redirect.

Step 4: Select Web Server & PHP Version

  1. Web Server: Choose your web server engine (Nginx, OpenLiteSpeed, or OpenResty).
  2. PHP Version: Select your desired PHP version (e.g., PHP 8.1, PHP 8.2, or PHP 8.3). Every application runs inside an isolated PHP-FPM UNIX socket under its own system user.
  3. Click Create Website & App Now.

Step 5: Uploading Your PHP Application

After site creation is complete:

  1. Go to the File Manager or connect via SFTP / SSH.
  2. Navigate to your website root directory: /var/www/vhosts/example.com/.
  3. Upload your project files into public_html (or set your document root to public_html/public for frameworks like Laravel).
  4. If you enabled automatic database creation, retrieve your database credentials and enter them into your .env or configuration file.
Documentation Navigation