Articles in this section

Unable to change PHP composer Folder location

Plesk for Linux ext: composer

Symptoms

After adding a new PHP Composer path with the following command, the old path is still selected:

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

When you select the new path in the Plesk GUI and apply the change, the selection reverts to the wrong folder after the page refreshes.

Cause

The PHP Composer extension scans JSON files only once. It is not possible to rescan or remove the path recorded during the initial scan.

Registering a new path only creates a new database entry, so the old one remains selected in the Plesk GUI. This behavior is tracked as #EXTPHPCOMP-115, which will add rescanning functionality in a future version of the extension. There is currently no ETA for this feature.

Resolution

Manually editing the Composer database is not recommended. Proceed with caution.

  1. Connect to the server via SSH.
  2. For safety, back up the Composer database:

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

  3. Find the ID of the affected domain in the psa database:

    # plesk db "select id from domains where name = 'example.com';"

  4. Open the Composer SQLite database:

    # sqlite3 /usr/local/psa/var/modules/composer/composer.sqlite3

  5. List the entries for the domain, using the ID from step 3 in place of 1:

    # SELECT * FROM Application WHERE domainId = 1;
    5|twbs/bootstrap|wrongpath/composer.json|1|1732731312
    6|yiisoft/yii2-app-advanced|/correctpath/composer.json|1|1732739017

  6. Remove the entry with the wrong path, using its id from the first column:

    # DELETE FROM Application WHERE id = 5;

  7. Exit SQLite with .quit, then go back to the domain in Plesk and confirm the change.
Was this article helpful?

Comments

0 comments

Please sign in to leave a comment.