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

superfive33's avatar

Urgent help needed on Laravel Forge

Hi !

I have an app on production on a server managed by Laravel Forge. I updated from PHP 7.2 to PHP 7.3 a few days ago. Since that day, the PHP code updates I have deployed on production are not "visible" in the application (new features are not visible or executed). But, I've checked via SFTP and the code is OK in the deployed files.

I guess this is related to Opcache, but I have disabled and enabled it and the new PHP code is still not executed. And my deploy script on Forge is reloading the PHP fpm service after each deploy, as suggested by Forge.

I have also manually rebooted the server, nginx. But this is always old code that is "visible". I have manually stopped the php7.2-fpm service and reloaded the php7.3-fpm, but without success.

I don't know what to do.

Can someone help ? Thanks

0 likes
2 replies
rodrigo.pedra's avatar

Weird, Rebooting should definitely clear opcache status.

Laravel does some caching in production if you run php artisan optimize or some of the cache commands.

I don't if you tried any of these, but these are some steps you could try:

  1. Remove any .php file from the prioject's /bootstrap/cache/ folder
  2. Run php artisan optimize:clear
  3. Run php artisan config:clear
  4. Run php artisan route:clear
  5. Run php artisan view:clear
  6. Check if there are any remaining compiled view in the storage/framework/views folder (remove any .php files there)

Steps 3, 4, 5 should be run as part of step 2. I listed them individually as the optimize:clear command was introduced in a recent Laravel version and I don't know which version you are using.

Step 6 should be done automatically by step 5. Listed here so if after running step 5 there are still compiled view files in the storage/framework/views you should check if your folder permissions are configured properly. (maybe after migrating versions something happen).

Those are what I could think your Laravel app itself could be retaining as cache.

If you already tried those steps and it still didn't work there could be a nginx configuration problem (you should update your nginx conf to delegate to the new php-fpm version) but I would assume you either migrated through forge panel (which update these files automatically) or already have checked the .conf file for each site you have in your forge server.

Hope something here can help you.

superfive33's avatar

Hi @rodrigo.pedra

After some investigation, I have noticed that my nginx conf files for each site were not updated. It was still calling php7.2-fpm. This makes sense I guess. I have to manually update each site to use php7.3-fpm.

Thanks

2 likes

Please or to participate in this conversation.