I am working on a bitnami instance of Wordpress and remotely editing php code.
My problem is that the feedback loop between the changes I make to php (eg. functions.php
) and what can be seen on my browser is very long. I took out my phone stopwatch and the refreshes take place every 60s precisely. This makes me believe that this is not due to hardware and that there must be a setting somewhere in bitnami or wordpress to change the refresh rate.
Google indexing for everything Wordpress-related is pretty bad. Have you ever faced this problem before and do you know what setting would need to be changed?
There is in fact a hard-coded value to how often to refresh php code in the bitnami instance. It takes the name opcache.revalidate_freq
and can be found under /opt/bitnami/php/etc/php.ini
.
The solution is to change the default value of 60 to something more pleasant for development like 0.5. Feel free to comment any negative side-effect this could generate.
; /opt/bitnami/php/etc/php.ini
; How often (in seconds) to check file timestamps for changes to the shared
; memory storage allocation. ("1" means validate once per second, but only
; once per request. "0" means always validate)
opcache.revalidate_freq = 60 -> 1
After having changed this, you need to restart php_fpm.
sudo /opt/bitnami/ctlscript.sh restart php-fpm
https://docs.bitnami.com/aws/apps/wordpress/configuration/configure-phpfpm-options/