Solved

Need help setting up localhost on Windows 7 machine

Posted on 2015-02-07
7
138 Views
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.
0
Comment
Question by:Mike Caldwell
7 Comments
 
LVL 108

Accepted Solution

by:
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."
http://php.net/thanks.php
0
 
LVL 1

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.
0
 
LVL 77

Expert Comment

by:arnold
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.
0
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:

   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.
0
 
LVL 1

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!
0
 
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.
0
 
LVL 1

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.
0

Featured Post

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.

Question has a verified solution.

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

This article discusses four methods for overlaying images in a container on a web page
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.
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.
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 …

863 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

Need Help in Real-Time?

Connect with top rated Experts

26 Experts available now in Live!

Get 1:1 Help Now