• Our team is looking to connect with folks who use email services provided by Plesk, or a premium service. If you'd like to be part of the discovery process and share your experiences, we invite you to complete this short screening survey. If your responses match the persona we are looking for, you'll receive a link to schedule a call at your convenience. We look forward to hearing from you!
  • We are looking for U.S.-based freelancer or agency working with SEO or WordPress for a quick 30-min interviews to gather feedback on XOVI, a successful German SEO tool we’re looking to launch in the U.S.
    If you qualify and participate, you’ll receive a $30 Amazon gift card as a thank-you. Please apply here. Thanks for helping shape a better SEO product for agencies!
  • The BIND DNS server has already been deprecated and removed from Plesk for Windows.
    If a Plesk for Windows server is still using BIND, the upgrade to Plesk Obsidian 18.0.70 will be unavailable until the administrator switches the DNS server to Microsoft DNS. We strongly recommend transitioning to Microsoft DNS within the next 6 weeks, before the Plesk 18.0.70 release.
  • The Horde component is removed from Plesk Installer. We recommend switching to another webmail software supported in Plesk.

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