User

Managing PHP Dependencies with Composer

How to install, update, and manage PHP packages using the Composer panel in Opterius.

Last updated 1775606400
  • Command Output
  • Working Directory
  • Composer and Laravel
  • Next Steps
  • Composer is the standard dependency manager for PHP. The panel gives you a web interface to run common Composer commands without needing SSH access.

    Opening the Composer Panel

    Go to Software → Composer in the sidebar. If you manage multiple domains, select the one you want from the domain dropdown at the top — each domain has its own composer.json.

    Package List

    The panel reads your project's composer.json and composer.lock and displays:

    • Package name — the vendor/package identifier
    • Required — the version constraint from composer.json
    • Installed — the exact version locked in composer.lock (green if installed, amber if not yet installed)
    • Typeprod (require) or dev (require-dev)

    If no composer.json is found in your project directory, you will see a warning. Upload your project files via FTP or SSH first.

    Running Commands

    Install / Update / Dump Autoload

    Use the Run Command panel on the right to run standard Composer commands:

    Command What it does
    install Installs packages from composer.lock (or composer.json if no lock exists)
    update Updates packages to the latest allowed versions and regenerates composer.lock
    dump-autoload Regenerates the autoloader without installing packages

    Optional flags:

    Flag Effect
    --no-dev Skip require-dev packages (recommended for production)
    --optimize-autoloader Generate a classmap for faster autoloading
    --no-scripts Skip lifecycle scripts defined in composer.json

    Select a command and any flags, then click the button to run. The panel shows a live spinner while the command runs — Composer can take a few minutes for large projects.

    Requiring a New Package

    Use the Require Package form:

    1. Enter the package name, optionally with a version constraint:
      • vendor/package — latest stable version
      • vendor/package:^2.0 — version 2.x
    2. Check --dev to add to require-dev instead of require
    3. Click composer require

    Removing a Package

    Use the Remove Package form:

    1. Enter the package name (e.g. vendor/package)
    2. Click composer remove

    This updates both composer.json and composer.lock and removes the package from vendor/.

    Command Output

    After each command, the terminal output appears at the bottom of the page. If the command failed, the full Composer error is shown there — check it for missing extensions, version conflicts, or network errors.

    Working Directory

    Composer runs in the directory containing your composer.json. For most setups this is the parent of your public_html folder (e.g. /home/myuser/example.com/).

    Composer and Laravel

    If you installed Laravel via the panel's Laravel installer, composer.json is already set up. Use install --no-dev --optimize-autoloader after deploying to production.

    [!NOTE] For large dependency trees or slow servers, commands may take several minutes. The panel allows up to 10 minutes per command before timing out.

    Next Steps