Xampp and Ampps don't reload files when changed - html

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.

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.

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.

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.

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.

Related

vs code live server extension not working

I'm trying to run a basic html file with live server extension, when I run it I get the Server is Started notification(as shown in the img below) but then nothing happens
even manually going to port 5500 like "http://127.0.0.1:5500/index.html" I get the following error
Cannot GET /index.html
i tried restarting vs code. uninstalling and reinstalling live server extension also tried uninstalling and reinstalling vs code. i set the default browser in the extension settings and on my computer any other ideas i can try would be appreciated
Thank you
I'm not sure why but changing file names (removed special characters) worked only if i do it manually it still doesn't load the browser automatically though..
This could be the issue I just solved.
VS code was not using the local IP as a host.
Manage > settings > search "use local" or "live server"> check "use local IP as host".
I hope that helps you or your connection needs could be unique and you might want to look at this guide. https://code.visualstudio.com/docs/setup/network

Live Server Extension gets stuck iterating through port values every time I "Open with live server" from my html file

My file name is index.html
I have tried running the command and manually entering http://127.0.0.1:5500/index.html into the browser this also does not work. I get a refused to connect message.
I have ensured I have a default browser set.
I have tried just about everything.
As soon as I select "Open with live server" VS Code starts processing the request, I navigate to settings.json where the extensions settings reside.
All I have in my settings.json is
"liveserver.settings.port": 5500
and in real time the file starts increasing the port number by 1 about every second. I have to physically close VS Code to stop it. "Stop live server" does not work.
I have tried uninstalling the extension, older versions, and even completely uninstalling VS Code.
NOTHING is working.
Please send help.
Try the steps from this question:
Live server installed but not working in VS code

XAMPP How to restart the server

I am new to web design, and I am using XAMPP for my website to test PHP and MySQL, I noticed that when I modify the index.html (HTML, CSS), I don't see the changes immediately when I open it from the browser localhost/webdesign/index.html. I often have to wait for more than 10 minutes to see the changes in localhost.
However, if I open it locally D:/xampp/htdocs/webdesign/index.html I can see the modification I made immediately.
I restarted the Apache server from the XAMPP control panel and still don't see the changes that I made. Anyone know how to fix this?
When I changes the picture files, I can see the modification I made in the source code in localhost/index.html, but the pictures are still the same, the files are not being updated.
What can I do to speed things up?

MAMP - suddenly getting 404s on my localhost

I have a very simple MAMP setup, with my index.php and related files in my htdocs folder. I was rolling along fine last night, being able to access the files by typing in things like localhost/index.php. Now, all of the sudden, I get 404s (file not found on this server) when I try to connect to any of the pages that are in my localhost folder or subdirectories of it.
What's more, when I just type in localhost, it shows me some of the directories but DOES NOT show any of my .php files, even though they show up when I perform a ls in the command line.
My MAMP app shows that I am connected to my Apache/MySQL servers. I can still access the localhost/MAMP homepage. But for some obscene reason, all of the sudden my php files are inaccessible. I have changed nothing inside of them! What's going on?
Edit: Turns out I needed to change the permissions of my php files -- they were set to read and write only for sudo and read only for everyone else. I ran chmod 777 on the applicable files and things were back to normal, but this begs several questions:
Why was it working earlier then changed without me ever modifying the file permissions?
Why should I have to make it writeable for other users to be able to access it on my local host as the admin user?
If I were to deploy this code in the wild (I know MAMP isn't used that often in the wild, but still), what would I do? Wouldn't creating these kinds of permissions result in serious security holes?
EDIT 2: Aaaaaand now it's not working again. Again, no changes made to file preferences, etc., just a few tweaks to the actual php files themselves. I don't have any sharing enabled under my sharing settings in System Preferences... this behavior is really starting to become frustrating.
Open Activity Monitor and make sure all instances of Apache and MySQL are closed. Sometimes MAMP has a tendency to not actually quit those processes and the next time you start it up they're still running and it generally messes with things (how's that for a technical explanation?).
Make sure there isn't any other process that's trying to use localhost for any reason. I came across this problem with POW installed. The POW process had stopped responding and it ended up interfering with MAMP's Apache.
Make sure that MAMP's settings haven't somehow been changes. I've seen MAMP revert custom document roots for seemingly no reason which can cause this.
I'd say even before any of this open your system preferences and make sure your Mac's own built-in Apache is off. You'll be able to see this in the Sharing section (it looks like its been moved in Mavericks however).
Make sure you're not routing traffic through a VPN or SSH using Sidestep. I had this problem after going back to an old project I built with MAMP while working from a coffee shop.

Aptana not copying files to external server

I just set up Aptana and have configured the Apache testing server in the folder C:\Apache\htdocs. When I try to test a simple HTML file I am directed to localhost/myproject/myfile.html but I get a 404 error. Upon inspecting the folder I find it empty. If I put a file in that folder the external server displays it just fine, but Aptana is not loading the files on the testing server when I attempt to run them. Any ideas? I know it's something simple, but I can't seem to figure out the problem.
Thanks,
Rob
The solution I discovered for this seems like a workaround but may be the only way to perform the task. I simply set up the localhost server just as if I was publishing the site to a remote location. Of course, the files don't update automatically when viewed like Dreamweaver does, but it works.
I discovered the best solution to this problem. I discovered I needed to install an FTP server on the local machine. I installed and configured Filezilla server and voila - problem solved. The only tip I'd add is to make sure to set the permissions properly for the folder or you'll run into errors.