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

lara90984's avatar

Forge server caching old PHP files

I'm using forge with PHP 5.6 (Legacy web app). The app is a couple of bespoke scripts and i'm receiving an error with ImagickException. I've started to debug the code, making changes to it on the server, but the servers still loading the old php file. For example, the error's thrown on line 46, i've now dropped it a line and wrapped it in a try, but the error is still on line 46 which is now blank. Further more, if I rename the file, so the original script it's loading doesn't exist, it still returning the same error about line 46.

I've restarted both nginx and php: /etc/init.d/nginx restart service php5.6-fpm reload

I've also tried clearing my cache: rm -rf /var/nginx/cache/*

All with no luck. Not sure what to try next. Any ideas?

0 likes
3 replies
aurawindsurfing's avatar
  1. You are editing the wrong file - not responsible for this error.

  2. You are in the wrong repo on your forge.

  3. I assume you have access to git of this project - create a staging site for it, deploy from scratch with error fixed. See what happens.

lara90984's avatar

It was none of these, and it's oddly working this morning, so no idea.

Cronix's avatar

@jam3sn Is it possible this code was running in a queue worker? If so, you have to restart the queue worker in between code changes. Queue workers load an entire instance of laravel in memory, so it only knows the code that existed at the time the queue worker started, as it's no longer using the "files" on the filesystem. It's using the ones it stored in memory.

Please or to participate in this conversation.