Xampp and Ampps don't reload files when change

2020-06-17 04:01发布

When I change a file in the directory, the change is not reflected on the web page shown when I access it through localhost, but it is shown when I access it directly by the file path on my system. Why?

I am on a Windows machine. My files are stored at C:\Program Files (x86)\Ampps\www\connor.dev . When I directly reference a file, by going to a link like this in the browser, file:///C:/Program%20Files%20(x86)/Ampps/www/connor.dev/index.php, the changes I made and saved in Sublime Text are shown. When I access it by going to localhost/connor.dev/, the changes are not shown. Even if I delete the file completely, it is still shown in localhost. This started happening recently on xampp, so I uninstalled it and used Ampps, and now the same thing is happening. If you need more info please ask.

4条回答
▲ chillily
2楼-- · 2020-06-17 04:27

It comes out to be an issue with the cache thing, so in simple words all you have to do is to remove the cached data of the specific webpage.

查看更多
贪生不怕死
3楼-- · 2020-06-17 04:28

Press Ctrl-F5 to hard refresh the page (to not use Browser's cache).

If you still see the previous pages or changes, then Apache has mod_cache caching them, or PHP has its opcode cache settings set to not refresh changes for X amount of time.

查看更多
beautiful°
4楼-- · 2020-06-17 04:29

I'm using Bitnami and the way I fixed it was to go inside C:\Bitnami\wappstack-version-number\php\php.ini, you can make the following changes and then reset your server:

opcache.enable=0
opcache.revalidate_freq=0

My php was updating every 60 seconds before, so I decided to turn that to 0 and just disable caching.

查看更多
叼着烟拽天下
5楼-- · 2020-06-17 04:44

Its happening because of apache mod_cache caching the resources.

For quick fix. Just restart the Apache server.

In ubuntu i use this below command in terminal to restart the Apache server

systemctl restart apache2

Now refresh the browser, then you will get the updated one.

查看更多
登录 后发表回答