Applicable to:
- Plesk for Linux
Symptoms
-
The following error notification is shown in Plesk > Domains > example.com > PHP Composer >:
PLESK_ERROR: Could not load packages: the /httpdocs/composer.json file of the example.com domain is invalid. To fix the issue, click "Edit composer.json" and correct the composer.json syntax.
-
The location of the
composer.json
file used by PHP Composer has been changed recently, the file was moved to a different location -
Going to Domains > example.com > PHP Composer > Click on [change] > The folder where the new
composer.json
file is located is not listed -
The composer application's status from the affected domain is shown as broken:
# plesk ext composer --application -list 2>&1
ID Name Domain Path Status
1 drupal/legacy-project example.com httpdocs/composer.json Broken
Cause
Inconsistency in PHP Composer.
Resolution
Click on a section to expand
-
Connect to the server via SSH
-
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 thecomposer.json
file (don't specify the file itself)
-
-
Connect to the server via SSH
-
Back up the PHP Composer SQLite database:
# cp -a /usr/local/psa/var/modules/composer/composer.sqlite3{,.backup}
-
Get the ID of the broken Composer instance:
# plesk ext composer --application -list
ID Name Domain Path Status
1 drupal/legacy-project example.com httpdocs/composer.json Broken -
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'
Comments
4 comments
Going to Domains > example.com > PHP Composer > Click on [change] > The folder where the new
composer.json
file is located is not listedI don't have SSH access to my servers.
I really need a possibility to fix this problem in the Plesk-GUI.
Hi Peter Schuetz
SSH access is essential to be able to apply this solution. If you still have this issue, please contact your hosting provider.
Yes, I still have the problem that some directories with a contained file composer.json are not found and therefore I cannot use the git functions for these repositories.
I would like to see a "Search again" function here:
Domains > example.com > PHP Composer > Click on [change].
Hello Peter Schuetz,
The idea looks interesting so I would suggest you create a request on the UserVoice portal. Indeed, it will be really helpful when access via SSH is not possible.
The top-ranked suggestions are likely to be included in the next versions of Plesk.
Please sign in to leave a comment.