Variable value does not update

Asked

Viewed 95 times

0

Hello, I installed WAMP from Bitnami and am using php 7.1.7 and when I edit the value of a variable, and give F5 in the browser, the value of the variable does not change on the web page.

I tested on 3 browsers, Firefox (what I use), Chrome and Edge. I’m using echo to show the value of the variable, and the value doesn’t change at the same time I update the browser, I have to wait 2 to 3 minutes and then update the browser again and then update. This procedure is every time I change my script, I’m only using 2 lines, one for variable and one for echo and nothing else.

Does anyone know how to fix this? I’ve used . htaccess and apache conf changes and haven’t solved it.

  • Put here the code you’re having problems.

  • <?php $name = "Bruno"; echo $name; ? > Only this, anything that changes no longer updates on time, only after a few minutes in the browser.

  • An obvious question (rs), before you press F5 to see the new value of your variable, you change the value of the variable $nome, right ?

  • HAHAHA that was good, but I change the value yes, even when it goes wrong I change the value to see if it changes, and nothing.

  • yes, but already solved, take a look at the answer below.

1 answer

0


I think it may be Cache problem, I’ve heard about it in apache and php, I’m not sure if it will work, but try to configure the following:

1) Google Pagespeed Module is enabled on these lines in {$INSTAL_DIR}/bin/apache/conf/httpd.conf:

 Include conf/pagespeed.conf
 Include conf/pagespeed_libraries.conf

Comente essas linhas para desativar este módulo.

2) PHP has Op Cache enabled on lines in {$INSTALL_DIR}/bin/php/etc/php.ini:

 opcache.enable=1
 opcache.enable_cli=1

Desative mudando de 1 para 0

Otherwise I can’t imagine what it is.

  • Hi, I made the option Opcache and solved, it was enabled and disabled. Thank you

  • How nice q worked out. Hugs

Browser other questions tagged

You are not signed in. Login or sign up in order to post.