Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Xampp and Ampps don't reload files when changed

Tags:

html

apache

xampp

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.

like image 697
Connorelsea Avatar asked Oct 10 '14 22:10

Connorelsea


People also ask

Where are xampp save files?

In the xampp PHP server, files are served by default from c:/xampp/htdocs directory.

Why localhost is not working in xampp?

Resolve Apache port conflicts by changing your listening port to 8080. Include the listening port in the address when accessing localhost. Change your MySQL port to 3307 if another application is blocking the default port 3306.


2 Answers

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.

like image 194
rightstuff Avatar answered Sep 21 '22 07:09

rightstuff


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.

like image 22
busytraining Avatar answered Sep 23 '22 07:09

busytraining