How to change in the PHP Composer extension the path of the composer.json file?

Follow

Comments

16 comments

  • Avatar
    Miguel

    Hello
    Let's see how I can explain myself, I feel my English is Spanish.

    Centos 7 + Plesk Obsidian

    As you can edit the Application Folder or reset the search, since when you do the 1st search it is the one that is saved if you later change your files folder there is no way to reset. The only way is to delete the domain and recreate the domain account in plesk so part of all zero. There's no other way?

    very thanks, Incredible change from Onyx to obsidian, congratulations.

    2
    Comment actions Permalink
  • Avatar
    Alexandr Nikolaenko

    Hello,

    Thank you for the information.

    However, the feature has been implemented in PHP Composer 1.0.2 and available since 29 October 2019.

    If you notice unexpected behaviour, please submit a support request.

    0
    Comment actions Permalink
  • Avatar
    Erik-Jan Riemers

    I think what he wanted the say (which i also have) if the scan finds a composer.json in /httpdocs/whatever/folder it will scan that composer and it will show its information. If you then say "change folder" to point it to a different composer.json it will not work. Tried this several times so the function to change folder just simply not work.

    Another approach could be that when it scans, it will show a list of composers.json it found and you select it. Now it will just take the first one. A input field where i can manually type in the folder would also be good.

    Miguel another way to "reset" is to remove and reinstall the extension. But if you use it on several sites it might not be the best.

    2
    Comment actions Permalink
  • Avatar
    Taras Ermoshin (Edited )

    Hello @Erik-Jan Riemers!

    The behavior you've described is not expected and requires additional investigation. So we're able to do that, please submit a technical support request.

    0
    Comment actions Permalink
  • Avatar
    Erik-Jan Riemers

    Well i tried to do that, only to find out that my plesk license is via a partner. Then i have to go do support via that and that just totally ruins it for me. Even if it's a partner, i think i should still be able to create something. So because of that i'll not pursue this and leave it broken.

    1
    Comment actions Permalink
  • Avatar
    Miguel

    If it's exactly as Eric explains, I imagine that in the next updates they will fix it.

    Erik can you communicate with support? :) that you master the language that I jeje better although I think that in a short time they will have it solved.

    Thank you so much guys,

    0
    Comment actions Permalink
  • Avatar
    Ivan Postnikov

    Hello Erik-Jan Riemers,

    In case the license was purchased from Plesk partner, Plesk partner should provide the support. In case the investigation stucks, the partner has ability to create a ticket to us.

    However, there's an alternative way. With a license from a partner it's possible to get support subscription and create tickets directly to us: https://support.plesk.com/hc/en-us/articles/213953025-How-to-get-support-directly-from-Plesk-

    0
    Comment actions Permalink
  • Avatar
    Miguel

    It does not matter, I imagine that later they will remove some update since it is a nuisance that the composer cannot be renounced.

    We can also uninstall the composer extension and the problem is over as long as it is not fixed.

    0
    Comment actions Permalink
  • Avatar
    Daniel (Edited )

    This problem is still a thing after a half year...

    Im stuck at 2 domains cant use the extension at all, clearly you need to add a button to rescan the folders. Very simple!

    Problem description:

    At the point you first open the Composer extension page for a domain it scans all folder for composer.json file. But if you later remove that folder or create a new json at another place you never ever can update it. This happens to me more often when i update a domain/page completly.

    And for god bless if we arent able to open a ticket because of partner may you as employer can be as kind and talk to your developers.

    0
    Comment actions Permalink
  • Avatar
    Ivan Postnikov (Edited )

    Hello Daniel

    Thank you for the feedback.

    This functionality is planned to be added. However, the precise ETA is to be available later.

    As a workaround:

    Linux:

    1. Connect to the server via SSH

    2. Run command below in the CLI
      plesk ext composer --application -register -domain example.com -path httpdocs/one.example.com/

    3. Then go to example.com > PHP Composer Extension > click "find".

    Windows:

    1. Connect to the server via RDP

    2. Run command below in CLI
      plesk ext composer --application -register -domain example.com -path httpdocs\one.example.com\

    3. Then go to example.com > PHP Composer Extension > click "find".

    The compose.json file should be recognized after that.

    3
    Comment actions Permalink
  • Avatar
    Henry Greijer (Edited )

    Hi Daniel Santer.

    I'm on CentOS...

    I fixed mine by editing the Composer extension's .sqllite3 DB file.

    First I discovered that I had multiple "Applications" that were broken(?) by running this in SSH:

    plesk ext composer --application -list

    So I guessed that if I am able to remove all the applications except the ones with Status = OK, then I can start over on the other ones.

    But the "plesk ext composer" doesn't have any "unregister" switch so you'll have to download this file:

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

    Now you can edit the "Application" table with "DB Browser for SQLite" (just Google and download), I deleted the lines that I knew was broken.

    Don't forget to upload the composer.sqlite3 file again!

    Then I went to Plesk interface and the broken web site and clicked "Scan" in the "PHP Composer".

    Maybe this will work for you or some similar solution.

     

     

    1
    Comment actions Permalink
  • Avatar
    Santiago Martín Martín

    Hi,

    I have found this article and I'm afraid it's still not working....

    Any way to change composer.json path?

    0
    Comment actions Permalink
  • Avatar
    Faris Raouf

    Santiago Martín Martín Martín Martín - you can use the "plesk ext composer --application -register -domain example.com -path httpdocs/one.example.com/" command --- I've just done it myself now and it worked. Let me give you a better example though.Imagine you have a domain domain.tld and that you have a composer.json in a directory called /test1.  PHP Composer had previous scanned that, done whatever it needed to do -- but now you are stuck if you want to use composer in another directory - you cannot have a composer.json in, for example, /test2 because the interface won't let you change.

    So, the command to run (as root) would be as follows: 

    plesk ext composer --application -register -domain example.tld -path httpdocs/test2/

    Notice no / before httpdocs and that there is a / after test2.

    Anyway, if you run this command, the composer gui will now allow you to change change directories to /test2 and it will scan and find what is there and allow you to do whatever needs to be done.

    The fact that you can't do this via the GUI is mysterious. 

    0
    Comment actions Permalink
  • Avatar
    Santiago Martín Martín

    Thans Faris Raouf!

    Yes, after posting, I saw Ivan Postnikov answer and I did what you say, and then everything works fine: scanning of composer.json works again.

    I'm surprised that after so long, this function still remaining failling...

    Thanks

    0
    Comment actions Permalink
  • Avatar
    Durieu Francois

    Hey, I tried the command mentioned by Ivan Postnikovbut I'm still not having the right path selected. Also, I'm using this on a subdomain if it helps.

     

    And just as a side note, this was a problem all the way back in 2019, and it's still going ????

    0
    Comment actions Permalink
  • Avatar
    Stefan Yakubov

    Hello, @Durieu Francois

    The command in question was a w/a, meanwhile the feature is available in GUI now, which is described within the "Answer" section of this article.

    In case that's not working as expected in your case, you can file a support ticket:

    https://support.plesk.com/

    0
    Comment actions Permalink

Please sign in to leave a comment.

Have more questions? Submit a request