Need help setting up localhost on Windows 7 machine

Posted on 2015-02-07
Medium Priority
Last Modified: 2015-02-07
Starting the PHP learning process.  I have some simple scripts that run from the command line, but I want to be able to run right from Windows, then when I have that as I want to locate it at a web server.  Mr. Google told me I needed to set up Apache server, PHP, and MYSQL.  I already have PHP (though I think I need to run PHP-Win for the next step, and not sure about how to do or if that is automatic), so installed WAMP to get Apache and MYSQL.  I got numerous errors during installation, and when done got a final error that "MSVCR110.dll" could not be found and a suggestion to re-install.  Re-installation threw dozens of errors, all stating it could not rename various files.

I found other posts that were not a one-stop installation like WAMP.  I could not tell from the documentation that it was for Windows, not Linux.

So, the need for this posting is to get localhost set up.  When I can run from localhost I'm sure I'll be back for PHP help.
Question by:Mike Caldwell
LVL 111

Accepted Solution

Ray Paseur earned 2000 total points
ID: 40595760
No points for this because it's not an answer, just a suggestion.  Drop what you're doing, get an inexpensive shared hosting account (I use ChiHost and like them, PHP also recommends the vendors listed below), and free copy of FileZilla for FTP/SFTP.  Write your scripts on your computer, then upload them to your hosting account and do your testing over the internet, working in exactly the same environment and way your clients will use your site.  It's a one-touch "build" process, and it gives you the peace of mind knowing that things are always in a stable environment.  And choose Linux hosting, not windows.  Much better debugged!  This setup will literally cost no more than pennies per day and it's a lot better than getting everything working "at home" only to have it fail "on the road."

Author Comment

by:Mike Caldwell
ID: 40595763
Actually Ray I own several hosting accounts; my son and I provide high volume data (billions of records, about fifty million documents stored at our Rackspace host), so sending to a host would be no problem.  I'm trying to do some side stuff without involving my son because he does all of our programming and I want to sort of surprise with a few simple utilities, plus I want to not be so ignorant myself.  So I thought if I ran out of Windows localhost I wouldn't have to expose what I am doing!  I'll see what else shows up, but if I just can't get there from here I'll do as you suggest and of course would be worth the points.
LVL 82

Expert Comment

ID: 40595873
What you are looking at is setting up windows Apache php mysql. (WAMP)
Download mysql server from mysql.com and install it.
Download Apache for windows and install it.
You say already have PHP.
Localhost is the reference to self on a computer.

There are several options IDE (zend, Netbeans, etc.) that you can use or do you use a notepad++ or context?

Rereading the original post, I find that I might not fully understand what you are looking to do.
Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

LVL 46

Expert Comment

by:Chris Stanyon
ID: 40595900
A one-stop WAMP installation is by far the easiest option. If installing WAMPServer gives you errors, then I would look at addressing those instead of doing the modular install. I've installed WAMP server lots of times (including on Windows 7), and it's always ran smoothly - it literally sets up the whole WAMP stack in one go. If you're getting errors, then it's likely you have other problems with your PC.

By default, the WAMPServer sets up Apache to serve your web files from 'localhost' - the root is set as C:\wamp\bin\apache\apacheX.X.X\htdocs. This is fine for doing quick web tests, but I tend to find configuring Apache with name-based virtual hosts to be more effective - it allows you to easily isolate separate projects.

Once setup, you can serve different domains, each from their own folder, for eaxmple:

   dev.project1.com --> \My Documents\Project 1\public_html
   dev.project2.com --> \My Documents\Project 2\public_html
   dev.yourdomain.co.uk \My Documents\YourDomain\public_html

You don't need to register the domains - you simply add an entry to the Windows Hosts file, and you can then closely replicate your actual online hosting package, all from your own PC.

Personally find it a lot easier to develop locally than remotely.

Author Comment

by:Mike Caldwell
ID: 40595904
Chris, the one click setup with WAMP is what was attractive.  But as I originally posted, it did not install, and the error messages simply said "Try again", which got worse.  And I did look at the individual installs, and stopped at Apache for Windows; lots of options listed, plus the stated need to compile locally or look somewhere else for a binary.  Meanwhile my son has provided me with the credentials to park at our own server, so think I'll just take Ray's advice.  I'm trying to learn PHP, not be my local IT guy!
LVL 46

Expert Comment

by:Chris Stanyon
ID: 40595913
Fair enough - my point about the errors was simply to say that it's not likely to be a problem with WampServer - it's more likely a problem with your PC - carrying on without fixing them will likely manifest problems in other ways - always a better option to fix rather than ignore :)

Good luck with your PHP - as you start getting your head around it, you'll be amazed at what you can do!

And always look at various resources for learning - there's a lot of 'junk' out there that will lead you down the garden path, and inevitably to frustration.

Author Comment

by:Mike Caldwell
ID: 40595918
Thanks Chris.  Keep watch; I will no doubt have a lot of questions re: PHP.  We have an API that clients can access with their client side program; I'm trying to not be the most ignorant man in the room!  And perhaps I can come up with some simple canned services that we can provide to those who would use our data but can't justify writing their client side of the API.

Featured Post

Get your problem seen by more experts

Be seen. Boost your question’s priority for more expert views and faster solutions

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

In this article, we’ll look at how to deploy ProxySQL.
Laravel is the most sought after web development framework. It comes with ample amount of features that make it easy for developers to work around it. Know about its features in detail.
The viewer will learn how to count occurrences of each item in an array.
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

590 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question