Page MenuHomeDevCentral

A PHP application source code has been updated, but all behaves like before.
Closed, ResolvedPublic

Asked by dereckson on Jan 24 2016, 07:45.

Details

Symptoms

Tests fail on the CI server Jenkins, but works locally.

Configuration change doesn't seem to be taken in consideration.

It seems the old code is still executed.

I've switched to another Git branch, but I've the feeling the code executed is from the old branch.

Answer Summary

Cache must be invalidated, generally opcache, sometimes application one.

Answers

dereckson
Updated 1,700 Days Ago

You need to discard cached element.

Generally, OPCode and APCu are the usual suspects.

Sometimes, you need to look to memcached or redis, but they rarely contain the PHP code compile results.

Phabricator

Phabricator uses Opcache and APCu.

Solutions:

MediaWiki

Generally, restart the web server (e.g. nginx) gives good results.

Laravel

Laravel uses different caching strategies.

The bootstrap/ folder, and in a lesser extend, the storage/cache folder, could contains compiled code.

So, files to delete could be:

  • storage/framework/cache/*
  • bootstrap/cache/config.php if you edited the config (e.g. at D260, tests fail after D253 and D255 merge)
  • bootstrap/cache/services.php if you edited the service container

Don't forget any modification to composer.json is useless if composer update is not called.

New Answer

Answer

This question has been marked as closed, but you can still leave a new answer.