• If you are still using CentOS 7.9, it's time to convert to Alma 8 with the free centos2alma tool by Plesk or Plesk Migrator. Please let us know your experiences or concerns in this thread:
    CentOS2Alma discussion

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