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
wwwto 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
- Log in to your MASACP Admin Console.
- Navigate to Websites in the left sidebar navigation.
- Click the Add New Website button.
- Select the PHP application type tab.
Step 2: Enter Domain & Set Resource Limits
- Domain Name: Enter your domain (e.g.,
example.comorapp.example.com). - 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
- Web Server: Choose your web server engine (
Nginx,OpenLiteSpeed, orOpenResty). - PHP Version: Select your desired PHP version (e.g.,
PHP 8.1,PHP 8.2, orPHP 8.3). Every application runs inside an isolated PHP-FPM UNIX socket under its own system user. - Click Create Website & App Now.
Step 5: Uploading Your PHP Application
After site creation is complete:
- Go to the File Manager or connect via SFTP / SSH.
- Navigate to your website root directory:
/var/www/vhosts/example.com/. - Upload your project files into
public_html(or set your document root topublic_html/publicfor frameworks like Laravel). - If you enabled automatic database creation, retrieve your database credentials and enter them into your
.envor configuration file.