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

robgoodliffe's avatar

Sending email on remote forge / envoyer

I'm having problem sending email in production. I use Envoyer and Forge and i'm getting error when sending on remote. I use amazon sqs to send email in queue. The error is

//releases/20151222153325/resources/views/emails/blank.php): - failed to open stream: No such file or directory.

The blank.php is on the server in the current release as i've ssh'd into the server to double check, but the release that the error is occurring in (20151222153325) is not the most recent release. In fact there's been several releases since the one that the app is trying to use and the release is no longer on the server.

Has anybody got any idea what is causing the app to look in an older release and what I can do to stop it.

Thanks, Rob

0 likes
6 replies
bashy's avatar

PHP caches the folder path but that may not be the problem you're having. Do you use /releases/latest/ as a symlink or is it the timestamp?

robgoodliffe's avatar

Thanks for the reply Bashy. The path is set to /current/public in Forge and then I think Enyoyer sets a symlink to map the current directory to the latest timestamped named release folder. I'm not sure exactly how it works, as I'm not really big on servers, which is why I use Forge & Envoyer. I've been using Forge and Envoyer for a while now (probably about a year) and this error has only occurred in last 3 days without me doing anything on the server apart from pushing new releases.

Any suggestions about what I can try and do to resolve this situation.

Thanks, Rob

robgoodliffe's avatar

Thanks. I'll take a look.

Just been reading the docs for queues and I've come across this:

Since daemon queue workers are long-lived processes, they will not pick up changes in your code without being restarted. So, the simplest way to deploy an application using daemon queue workers is to restart the workers during your deployment script. You may gracefully restart all of the workers by including the following command in your deployment script:

php artisan queue:restart This command will gracefully instruct all queue workers to restart after they finish processing their current job so that no existing jobs are lost.

So I'll have a fiddle now and see if I can get it to work and post back here with what works.

Thanks once again for your time, Rob

robgoodliffe's avatar

I edited the deployment hooks to restart the queues after the 'activate new release' hook using the following

cd {{release}}

php artisan queue:restart

but that didn't work.

When I went to forge and restarted the queue manually, it worked and solved the problem.

Aside from manually going in and restarting the queue in forge, does anybody know how I can stop this happening in the future ?

Thanks, Rob

Please or to participate in this conversation.