Need help setting up localhost on Windows 7 machine

Posted on 2015-02-07
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 109

Accepted Solution

Ray Paseur earned 500 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 77

Expert Comment

ID: 40595873
What you are looking at is setting up windows Apache php mysql. (WAMP)
Download mysql server from 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.
PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

LVL 43

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: --> \My Documents\Project 1\public_html --> \My Documents\Project 2\public_html \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 43

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

Ransomware-A Revenue Bonanza for Service Providers

Ransomware – malware that gets on your customers’ computers, encrypts their data, and extorts a hefty ransom for the decryption keys – is a surging new threat.  The purpose of this eBook is to educate the reader about ransomware attacks.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
SubQuery link 4 36
Dynamic Dropdowns 15 32
PHP alternative to file_get_contents('php://input') 4 66
$_SERVER Variable question 31 29
In Solr 4.0 it is possible to atomically (or partially) update individual fields in a document. This article will show the operations possible for atomic updating as well as setting up your Solr instance to be able to perform the actions. One major …
Since pre-biblical times, humans have sought ways to keep secrets, and share the secrets selectively.  This article explores the ways PHP can be used to hide and encrypt information.
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…

838 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