Jump to content

Can't connect to localhost?


Adsy
 Share

Recommended Posts

Hi all,

Please be gentle as I'm completely new to game dev and just getting into Phaser. I followed the steps on Phaser.io and downloaded the necessary files and installed WAMP server. I located the "www directory" and added the "hellophaser" folder to test that its working but when I go to "localhost/hellophaser" in my browser, nothing loads. I can't figure out what else could possible be the problem.

 

Link to comment
Share on other sites

is there an index.html in the `hellophaser` directory?

alternatively try hitting url `localhost/hellophaser/index.html` incase wamp isn't routing naked routes to an index page.

also, check your wamp settings, there might be a steer in there in case there are any strange routing rules that means its looking elsewhere for what to serve.

also also, as you're a JS developer have a look at installing node and using a node static server, its easier than fiddling with wamp although I'm not sure if you'd need to do anything else on a windows machine to make sure it routes through to port node will serve to. There are a glut of good tutorials out there though.

Link to comment
Share on other sites

Yeah, it's in there but directly hitting "localhost/hellophaser/index.html" bring up the same results with, "This localhost page can’t be found".

Also I'm new to JS as I come from a design background and only know HTML/CSS. Is node something similar to wamp? would that be an alternative local server?

Link to comment
Share on other sites

WAMP stands for Windows Apache Mysql Php, its a full stack of tools, you actually only need (or are trying to use) the Apache bit, which is a server that is good at pushing out static assets (which is what you want). Its fine for your purpose, if a little on the overview side of things.

Node is just JS but with some apis to do stuff with the OS and it runs on your machine inside an engine (the same JS engine, mostly, that is inside Chrome). You don't actually need to do any coding, you just install it, install a module to do static serving (there are many that can be installed with just one command) and run another command to start your static server. Node is actually not good at serving static assets (by not good I mean, you wouldn't want it pushing out a load of static assets, but for your purposes it is plenty good enough) but it gives you more control over starting and stopping a server and what you're serving.

But its up to you, if you're more comfortable with a GUI then once you solve your wamp issues you might decide that is best for you.

Re your WAMP woes, when you hit that url WAMP is supposed to route through to a location on your file system to serve that file based on a set of routing rules, I dont run windows but by default it sounds like you're doing everything right, it normally looks inside a root directory (www probably) and which you can think of as 'localhost', i.e. if you put an 'index.html' in there and hit localhost/index.html you should see that file as html in your browser. Check the WAMP config again to make sure it is looking inside www i.e. where your files are, to see if that is maybe the issue. Also check the config to see if its connecting to a certain port, typing `localhost` in the url bar is the same as hitting `localhost:80`, i.e. on port 80, which is a standard public port and by default I would expect apache to try to connect to it, its possible your system is restricting this port, perhaps if you have any security software on your machine that could restrict port access, although I would expect WAMP to throw you an error if it failed to connect.

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...