Support for Composer

Are there plans to build in composer? This is a pretty important feature for us since most of our themes manage packages with composer. We could use composer outside of the container but that would lead to potential version mismatches.

1 Like

Hi @greghunt . Welcome to DevKinsta! You should still be able to use Composer on your sites once a site has been created on DevKinsta. It would be installed locally rather than on the Docker container. Have you experienced any issues implementing Composer on a site?

1 Like

Hi Michael, thanks for the reply. Yes the trouble is I may have a PHP version mismatch when using composer. For example my OS currently runs php8 but my kinsta site may be running 7.4 in its container. So if I run composer locally I may get errors with confused PHP versions

Backing this request up.
We also develop lot’s of WP sites with composer, so it would be great to have that included.

1 Like

Hi @aaronmeder @greghunt . I see what you mean. You’re correct that it’d need to do used from within the container but I understand that may not be ideal. I’ll move this over to our feature request section for our devs to take a look at.

1 Like

@aaronmeder @greghunt
Until this is part of DevKinsta, there is a simple and easy way to install composer on your DevKinsta.

Cheers

2 Likes

Thank you for sharing @nemanjac !

Hi,
Is there already a update? Because this hash is not valid anymore and we can not install composer.

Hi @jasperheidebrink, this should work if you use the current installer checksum found at the top of this page: https://composer.github.io/pubkeys.html

I’ll ask our developers to look into this feature request again as well.

Hello @nemanjac thanks for your answer, do you know if there is an option to use this on MacOS system?

Hello @DavidME :wave: Welcome to DevKinsta Community!

I don’t have/use Mac here (but Linux Ubuntu), and as I could check/see, those command-lines shared by manjac (:bowing_man: Thank you Nemanja Cimbaljevic!) should be able to be run on Mac machines as well.

In order to do so, first you can run/open the Terminal program on your Mac.
Then on your Terminal program, you can type this command (that will log you in to your local devkinsta_fpm docker’s container) :

docker exec -it devkinsta_fpm bash

After that, you can follow the next steps/commands provided there - start from line #5.
Note that on line #9 , you will just need to change that line to the following:

php -r “if (hash_file(‘sha384’, ‘composer-setup.php’) === ‘55ce33d7678c5a611085589f1f3ddf8b3c52d662cd01d4ba75c0ee0459970c2200a51f492d557530c71c15d8dba01eae’) { echo ‘Installer verified’; } else { echo ‘Installer corrupt’; unlink(‘composer-setup.php’); } echo PHP_EOL;”

that random number ( 55ce33d7678c5a611085589f1f3ddf8b3c52d662cd01d4ba75c0ee0459970c2200a51f492d557530c71c15d8dba01eae ) is taken from the current “Installer Checksum (SHA-384)” section here: https://composer.github.io/pubkeys.html

Once done, you can test to call the composer in that devkinsta_fpm container with something like this ( as shown on line #20 in that github page - to check its version ) :

composer --version

You can then type: exit to quit from that devkinsta_fpm container (and may want to close your Terminal program).

I also ran the above command lines on my Linux machine and the composer seems to be running fine there .

Cheers,
Agus