PHP script is not reacting to code changes, although opcache and jit are both disabled. What might be happening?

110 views Asked by At

I have a php script that is not reacting to code changes that I make (I inserted a deliberate syntax error which is not be being picked up).

I am running php 8.1 on apache2 (on a local copy of ubuntu 22.04). The script is part of a drupal 9.4 custom module.

Running phpinfo now shows: Opcode Caching Disabled Optimization Disabled SHM Cache Enabled File Cache Disabled JIT Disabled

Can someone shed any light on might be going on?

I have disabled opcaching and JIT (my understanding from what I read is that SHM cache is therefore irrelevant). I have checked the paths in the script and the code editor align. I have cleared drupal and browser caches (several times) and restarted php-fpm and apache2. From my research I had expected these to cure the problem.

I also rebuilt the whole thing to my retired dev server (the only difference is ubuntu 20.04) and after the first successful run of the script I observed the same behaviour when I make changes to the script.

Googling has not yielded a solution that helps me identify where the problem lies, though it points me at opcache rather than drupal.

1

There are 1 answers

0
user13167 On

Problem solved. Really basic - I should have spotted it earlier. I had a duplicate script in another directory in the website file system, which drupal was using in preference to the one it should have been using.

Apologies for wasting other people's time!