• Please be aware: Kaspersky Anti-Virus has been deprecated
    With the upgrade to Plesk Obsidian 18.0.64, "Kaspersky Anti-Virus for Servers" will be automatically removed from the servers it is installed on. We recommend that you migrate to Sophos Anti-Virus for Servers.
  • The Horde webmail has been deprecated. Its complete removal is scheduled for April 2025. For details and recommended actions, see the Feature and Deprecation Plan.
  • We’re working on enhancing the Monitoring feature in Plesk, and we could really use your expertise! If you’re open to sharing your experiences with server and website monitoring or providing feedback, we’d love to have a one-hour online meeting with you.

Issue Running `composer install` via "Additional Deployment Actions"?

Bramus!

New Pleskian
Hi,

We have set up automatic deployment of a Git repo onto our server.

As it's a PHP project, I need to run `composer install` after deployment, to make sure all dependencies are installed. Doing so manually over SSH works fine, yet I want to do it automatically. In the docs I see that it's possible to run some “Additional Deployment Actions” after deployment was done.

However, I've not been able to get that to work. I've tried this set of commands:

cd /var/www/vhosts/example.com/httpdocs
composer install


(do note that executing these commands over SSH yields the expected result)

As it's not working I have two questions:

1) Is there any way to see the output of the “Additional Deployment Actions” so I can investigate this further?
2) Can anyone specify which commands will do the trick?

Kinds regards,
Bramus.
 
Hi UFHH01,

Thanks for your response. When I take a look at the proposed solution it involves installing composer itself. However, composer is already installed on the server (`which composer` yields `/usr/bin/composer`), so shouldn't this work all by itself? Or is `/usr/bin/*` not available in the context of “Additional Deployment Actions”?

Regards,
Bramus.
 
Hi Bramus!,

this depends on your restrictions at your (sub)domain, as "open_basedir" and "include_path" at your PHP - settings might limit the usage. ;)
 
Hi UFHH01,

How can `open_basedir` be a restriction for “Additional Deployment Actions”, as ADAs are run on the shell and not in a PHP context? Do note that running `composer install` over SSH works fine.

Regards,
Bramus.
 
Hey, I've managed to set up commands properly with Node.js. It goes like this:

/opt/plesk/node/12/bin/npm run build &> npm.log

So you only need to give proper path to your PHP stuff (logfile can be sometimes useful so I also create it each time)

You also need to go to Access to Web Hosting and select /bin/bash in SSH select.
 
Back
Top