Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

jkdesign1's avatar

Forge didn't install Composer or PHP?

Hi everyone,

Having a strange issue here. Created a new DO droplet last night in forge and everything seemed fine. Created the domain and I added my gitlab repo with no issue...until it tried to deploy. The deploy failed because it couldn't run composer install so I ssh'ed into the server and checked and sure enough...composer is not installed and neither is PHP. I haven't used forge in a while but I kinda remember it just installing that stuff without having to do anything. Did I miss a change? I had selected PHP7.2 when I created the droplet. Just a bad droplet provision or did I miss something?

0 likes
6 replies
bobbybouwmann's avatar
Level 88

It's probably a bad provision. You should just contact the team behind forge using the contact options. Or you can just provision a new server and see if everything is working fine there ;)

skoobi's avatar

This happened to me a little while back. Not sure why it happened but deleted the server and tried again and all was ok. But couldn’t figure out what went wrong.

willeums's avatar

Hey, jkdesign1. I just provisioned a new server using laravel forge, and was not able to replicate your issue. However, here are a few suggestions that may help:

  • I am a bit confused about the PHP usually when you select the version ranging from 5.6 t0 7.3(beta) forges takes care of the installation during provision as well as MySQL, load balancing, back-ups and recipes if required. I would try to spin up another droplet and remove the old one to see if these issues get resolved. Also check if there were service or maintenance issues in regards to the region you chose for your server.

  • When you installed the repo did you make sure that Install Composer Dependencies checkbox was checked after choosing the appropriate branch?

  • Check your deploy script it should look close to this:

    cd /home/forge/yourwebsite git pull origin master composer install --no-interaction --prefer-dist --optimize-autoloader echo "" | sudo -S service php7.2-fpm reload if [ -f artisan ] then php artisan migrate --force fi

  • Lastly, Perhaps you may need to install composer via digital ocean. Instructions are below:

Install Composer via Digital Ocean Console

Access your server with sudo permissions and update the package manager cache $sudo apt-get update

Then use the following command to install the curl, php-cli, and php-mbstring dependencies. $ sudo apt-get install curl php-cli php-mbstring git unzip

Go to your home directory $ cd ~ Retreive the installer using curl $ cd ~ curl -sS https://getcomposer.org/installer -o composer-setup.php

Get the latest composer public key Signature Composer Public Keys / Signatures copy the latest (SHA-384) signature

$ php -r "if (hash_file('SHA384', 'composer-setup.php') === ' replace me with the latest copied sha-384 signature') { echo 'Installer verified'; } else { echo 'Installer corrupt'; unlink('composer-setup.php'); } echo PHP_EOL;"

If done corrrectly you will see a Installer verified output in the console.

Lastly, install composer globally:

sudo php composer-setup.php --install-dir=/usr/local/bin --filename=composer

This will install composer composer under usr/local/bin . Then type composer to test the installation you should see the composer usages commands.

Hope this helps. Good luck.

2 likes
kbatdorf's avatar

One time I think PHP didn't install for me. I'd just build a new server and see if it resolves itself. Otherwise install it manually as mentioned elsewhere.

jkdesign1's avatar

@WILLEUMS - Hey thanks for taking the time to post all this, I really appreciate it. I ended up just nuking the server and re-provisioning which fixed it, but I'm saving this info for a rainy day because I'm sure I'll need it :)

willeums's avatar

Your welcome. I'm glad you found it useful.

Please or to participate in this conversation.