Plesk

New composer.json location is not listed in PHP Composer in Plesk: Could not load packages

Symptoms

Cause

Inconsistency in PHP Composer.

Resolution

Register the new composer.json location

  1. Connect to the server via SSH

  2. Register the new location of the composer.json file:

    # plesk ext composer --application -register -domain example.com -path httpdocs/newpath

    Where:

    • example.com is the affected domain

    • httpdocs/newpath is the new location of the composer.json file (don't specify the file itself)

Remove the broken instances in PHP Composer SQLite

  1. Connect to the server via SSH

  2. Back up the PHP Composer SQLite database:

    # cp -a /usr/local/psa/var/modules/composer/composer.sqlite3{,.backup}

  3. List all Composer instances to get the ID of the one marked as Broken with:

    # sqlite3 /usr/local/psa/var/modules/composer/composer.sqlite3 'select * from Application'

  4. Remove the records from the PHP Composer SQLite database making reference to the broken instance with the ID found in the previous step:

    # sqlite3 /usr/local/psa/var/modules/composer/composer.sqlite3 'delete from Application where id = 1'
    # sqlite3 /usr/local/psa/var/modules/composer/composer.sqlite3 'delete from Package where applicationID = 1'
    # sqlite3 /usr/local/psa/var/modules/composer/composer.sqlite3 'delete from Setting where applicationID = 1'

Exit mobile version