php not showing changes to files consistently

你离开我真会死。 提交于 2019-12-08 07:37:32

问题


I am making changes to php files and they are not showing -- sometimes. Sometimes they will show immediately. Sometimes I have to wait a few minutes. I've gone through and turned off all the cache that I could think to turn off. The problem is inconsistent and tough to duplicate consistently.


回答1:


Answering my own question...

I spent quite awhile doing trials to consistently reproduce the behavior. I had to let the server sit without refresh any page for a few minutes. Then if I change the file before I refresh the page, the change show immediately and all subsequent changes show immediately. If I refresh the page first, then make a change to the file, then no subsequent changes show until I refresh 10-20 times, or so.

BTW, html files show all updates regardless, so it was a php issue.

Before finding the answer, I tried...

  • turning off nginx cache
  • setting nginx conf to sendfile off;
  • setting nginx conf to expires off;

... none of these work. I then found that it was in fact OPcache. I fixed the issue by changing the php.ini file to this (and restarting all services)

opcache.enable=0



来源:https://stackoverflow.com/questions/35617253/php-not-showing-changes-to-files-consistently

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!