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

ArneDB's avatar

Problem when deploying via Laravel Forge

When deploying via Forge I get the following error:

 [ErrorException]                                                                                                     
  file_put_contents(/home/forge/mysite.be/vendor/bin/phpunit): failed to open stream: No such file or directory

Any idea how I can solve this?

0 likes
3 replies
Dalma's avatar

Is this a new deployment or are you releasing and update to your existing site?

ArneDB's avatar

@DALMA - Hello there, I'm releasing an update to an existing site.

ArneDB's avatar
ArneDB
OP
Best Answer
Level 2

Not really sure how I fixed it, but I managed.

First I removed PHPUnit from composer.json, then I ran Composer Update -> Composer install.

After that copied over composer.json from an older commit and updated & installed that one (where everything worked).

After pushing everything via Forge to live, all went working again.

One weird thing I encoutered whilest debugging which I can't explain. When i went to look in vendor/bin/. phpunit was there, but it was colored in red. Not really sure what that meant. Maybe someone on here does?

Please or to participate in this conversation.