Upm not working with php

Problem description:
I obtain an error using upm on a blank new php web server project

exec: “composer”: executable file not found in $PATH

Expected behavior:

package installation

Actual behavior:

 upm info cboden/ratchet
Name: cboden/ratchet
Description: PHP WebSocket library
Version: v0.4.4
Homepage: http://socketo.me
Bug tracker: Issues · ratchetphp/Ratchet · GitHub
Author: Chris Boden, Matt Bonneau
License: MIT
 upm add cboden/ratchet
→ composer require cboden/ratchet
exec: “composer”: executable file not found in $PATH

Steps to reproduce:
 upm add cboden/ratchet

Bug appears at this link:


Welcome to the forums @PascalURSO! Can you please provide a link to your repl?

It’s a blank new php server (not any file added or modified).

Is that repl private? Returns a 404 for me.

Should be publicly accessible (I have tried access on incognito browser)

Not for me, could just be a bug though.

Strange… anyway, you could try by yourself on a new php web server project

Strange, it’s a bug, for some reason the app won’t open the repl but I can still open it in my browser on my phone…

Strange, I will put that in it’s own bug report then.

it seems they forgot about UPM when making the nix templates. Files > ⋮ > Show hidden files. Add to the .replit file:

language = "php"
packageSearch = true

Then, add pkgs.php82Packages.composer to the replit.nix file. Now you should be able to search for and install packages.