View Full Version : compiler?
I am using WAMP to run localhost to test my website development. While I am using Notepad++, I edit the coding, then hit the "Save All" button, the go to Chrome to run the localhost. I take it as it's my final results. Is this how to do it?
I am asking because when I change stuff (example, just a background jpg), it doesn't change to the edited image. Then when I do different things, it disappears? Then I change it back to original code (merely change the image file name), it doesn't work? I know it may be my errors. I just want to ask if I am running the localhost the right way, then I know it's something else.
Years ago, I was SQL Programmer, Database Programming and Warehousing. I use a Compiler to switch between Servers. So I am thinking if there's still some compilng to do for WAMP/Notepad++. I also used Visual Studio/SQL Server (2008 Prof. Edition, still have the installation discs), but guessing it won't work well with today's Win10?
jscheuer1
02-20-2017, 01:34 AM
Basically, yes. You may need to clear the browser cache and refresh the page to see changes. Also, make sure your browser is pointed to the local host server, and to the specific page on it that you're working with. The address in the browser should be something like:
http://localhost/pathto/whatever.htm
Not like:
file:///C:/wampfolder/wwworpublic/pathto/whatever.htm
or anything beginning with file:
Even though many pages will 'work' that way, in order to have all the benefits of the WAMP server, it must be http://localhost/, etc. And in order for it to be the specific page you're working on, it must point to it (not some other similar file) on the WAMP server.
In the browser address bar, I type just "localhost" and it runs. I edit/use files in C:\wamp\www\*.*
So, using Notepad++, I edit whatever and then click "Save All", it's done?
Good point that I should clear the browser cache. Sometimes, I "X" the browser and pop it open again, sometimes it doesn't clear stuff. While I run "localhost" over and over, does it refresh or it still have old cache? Because I see things changes when doing this (without bothering with cache), but I guess it's still Microsoft Windows.
When I had the SQL Server, I could have variables on a small window and watch the values.
I don't even click on "WAMP" icon in MS Start (and does not show in SysTray), the "localhost" still works. Was I still supposed to click on WAMP (and see it in SysTray)?
Has anyone tried installing/run MS Visual Studio 2008 and/or SQL Server 2008 in Win10? It's a large installation and rather not install and then uninstall (would then better off format/reinstall Windows).
jscheuer1
02-20-2017, 02:40 AM
In the browser address bar, I type just "localhost" and it runs. I edit/use files in C:\wamp\www\*.*
So, using Notepad++, I edit whatever and then click "Save All", it's done?
Some browsers will show "localhost" in the address bar when they are only accessing the local hard drive. If that's what's happening, you will also see the drive letter (C usually). Once you're viewing via WAMP, there will be no drive letter. And you must always launch WAMP and see it up and running (only black and white icon, if there's any color, it's still loading - might vary by OS and version) in the sys tray before trying to utilize it.
If WAMP is not loaded, and you see localhost with no drive letter, it has to be a cached version of the page.
If there're still problems, perhaps you didn't accomplish what you intended in the edit. There's no compilation step, though, as I also said, the browser cache may need to be cleared and the page refreshed to see results.
Just closing the browser and reopening will not always clear the cache. To be certain, you need to go into settings and manually clear the cache, but there are shortcuts that usually work. And, yes sometimes changes will take effect immediately, but if they don't, a page refresh and clearing of the cache may be required. In many browsers (not all, I think current Firefox is the exception, but this is also version specific with the browsers) CTRL + F5 will clear the cache and reload in one step, but only if the focus is currently on the page you're working on.
styxlawyer
02-20-2017, 11:21 AM
If you are simply developing web pages with HTML and JavaScript, you don't actually need a local web server as the pages can be run directly from the local hard drive. WAMP is the Windows version of the Apache server which includes PHP, MySQL. If you start to use server-side includes (SHTML pages) or PHP and MySQL then you will need to invoke the WAMP server before running any of your pages. You will also have to use WAMP if you want to have root-relative links in your pages as these will not work when the pages are run from the hard drive directly.
You can actually have your files anywhere on your local drive, they don't have to be in the WAMP directory. There is a very good tutorial on setting up virtual hosts on WAMP here (https://john-dugan.com/wamp-vhost-setup/).
There is a very important caveat to be aware of when running web pages on a local Windows host. Linux is case-sensitive and Windows isn't! So, "MyPicture.jpg", "mYpicturE.Jpg" and "MYPICTURE.JPG" will all point to the same file on a Windows host but three different files on a Linux host. It still catches me out occasionally!
I hope that helps.
Edited to add: I use XAMPP rather than WAMP. It supports MySQL, PHP version 7.1, MariaDB and PERL.
PHP... you will need to invoke the WAMP server before running any of your pages.
I am using PHP, so have to use WAMP then? I learn that HTML is client-side and PHP is server-side. To me, server-side is, of course, usually faster and only loads results (but will still load coding/formula if coded in that page rather another page not loaded, right?). I am still trying to learn to show only directories instead of final file names, like example:
http://www.dynamicdrive.com/forums/newreply.php?do=postreply&t=80971
but I want to show:
http://www.dynamicdrive.com/forums/ OR http://www.dynamicdrive.com/
Again, I will have to see if I can READ that somewhere.
You will also have to use WAMP if you want to have root-relative links in your pages as these will not work when the pages are run from the hard drive directly.
Not sure if I understand that, but I just woke up doing this computer already...
There is a very important caveat to be aware of when running web pages on a local Windows host. Linux is case-sensitive and Windows isn't! So, "MyPicture.jpg", "mYpicturE.Jpg" and "MYPICTURE.JPG" will all point to the same file on a Windows host but three different files on a Linux host. It still catches me out occasionally!
So, since I am using MS OS, I do my work on this system (along with NOT being case-sensitive), save it, upload to a webserver, then you use a Linus machine to view my website, will your machine saw errors?
Edited to add: I use XAMPP rather than WAMP. It supports MySQL, PHP version 7.1, MariaDB and PERL.
I am actually thinking about installing SQL Server 2008 to use instead of WAMP, but that's later. I attempted to try IIS, but it didn't work for me (of course, I probably didn't know how to do this), so that's why I download and just click WAMP, it ran without my configuration anything. I would guess I would better off using IIS since it's already with Windows (and IIS no need to licensing either), thus not need to install more stuff onto my slooow PC.
WAMP (only black and white icon, if there's any color, it's still loading - might vary by OS and version) in the sys tray
Mine remains green (in SysTray) all the time.
jscheuer1
02-20-2017, 01:55 PM
Green sounds good. Mine never has green, it starts with some red in it, that changes to yellow. When all the color is gone, it's fully loaded. So, as I say, may vary with version/os.
And again, if you want to use PHP in this situation, you must have WAMP loaded and must navigate to the page over the WAMP server, not the local file system, otherwise the engine for interpreting PHP is unavailable. The very meaning of server side is that it happens on the server.
cached
CTRL + F5
It seems to be odd problems for me... sometimes it works, sometimes it doesn't, sometimes it appears to work, etc... It is my guess that Chrome's CTRL-F5 is REFRESH instead of clear cache? Looks like I need to STOP with my web development and see what's all wrong with the browser and possibly going back to "browser wars (https://en.wikipedia.org/wiki/Browser_wars)".
Is this good or still have to do clear steps every test page?
https://chrome.google.com/webstore/detail/clickclean/ghgabhipcejejjmhhchfonmamedcbeod?hl=en-GB
I only choose Chrome because my kids uses it in school and my wife at work. Normally, I remain with free MS Explorer (now the Edge isn't that great either). Wished Netscape would won the browser wars, but they lost due it cost money to use it, duh.
jscheuer1
02-20-2017, 10:21 PM
Even if a given browser doesn't have shortcuts to clear the cache, you can just go into settings and do it that way. Most times though, simply refreshing the page will get you the updated content.
Powered by vBulletin® Version 4.2.2 Copyright © 2021 vBulletin Solutions, Inc. All rights reserved.