Php

Complete guide to host PHP applications on Discloud.

📁 Preparing Your Project Files

If your project uses Composer, ensure a valid composer.json is at the root of the archive you upload. Discloud will install dependencies automatically when it detects this file.

Files / Directories to Exclude

Exclude items that are not required for runtime:

- vendor/
- node_modules/
- .git/
- tests/
- .cache/

📌 Use a .discloudignore file to exclude directories you do not want packed (e.g. vendor/ if you prefer a clean install).

Include vendor/ ONLY if: you have patched libraries locally or you rely on extensions or binaries compiled during install that must match your dev environment. Otherwise excluding it keeps uploads smaller and lets Discloud perform a fresh, reproducible install.

🔗 Need to define your main file? See: Main File FAQ


📦 composer.json Essentials

Minimal example:

{
  "name": "example/app",
  "type": "project",
  "require": {
    "guzzlehttp/guzzle": "^7.9"
  },
  "autoload": {
    "psr-4": {
      "App\\": "src/"
    }
  },
  "scripts": {
    "start": "php -S 0.0.0.0:8080 -t public"
  }
}

After editing dependencies locally:

composer install
composer dump-autoload --optimize

More details: composer.json


🌐 Hosting Websites & APIs

Before deploying your website or API on Discloud, ensure that you meet the following requirements:

Run locally / simple deploy:

php -S 0.0.0.0:8080 -t public

public/index.php minimal:

<?php
declare(strict_types=1);
echo "Hello, Discloud!";

✍️ Deploying Your Application

Once your project is configured and compressed, you can choose one of the following deployment methods on Discloud:

Last updated