Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win


How do I put php and mysql on a windows 7 machine? Do I need to install apache or can I run it under IIS?

Posted on 2011-03-22
Medium Priority
Last Modified: 2013-12-13
I am trying to install php and mysql on my computer. Everything seems to be have installed correctly except for a couple of things:
1. When I run any php module on localhost the php is not interpreted.
2. When I try to run phpmyadmin, it comes up with a blank page until I remove the index.php. At that point everything seems to work OK.

Question by:sneves44
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 6
  • 5
  • 2
  • +2

Expert Comment

by:Vishal Patel
ID: 35195962
This article is for Vista but it should work for WIndows 7 too.
And if you have no any other issue, you should go for WAMP package. Very easy to administer.

Expert Comment

by:Vishal Patel
ID: 35195968
LVL 27

Expert Comment

by:Lukasz Chmielewski
ID: 35196275
... or XAMPP :)
All in one package
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

LVL 20

Expert Comment

by:Mark Brady
ID: 35196376
And to finish answering your question, PHP will run just fine under/with IIS. You don't need an apache server. Here's a tutorial on how to get it installed properly.

Good luck with it all.

Author Comment

ID: 35223433
Well I tried all of the above and got phpmyadmin to work.
However, after much searching / trying /testing I had no success getting php interpreted on localhost.
I tried installing xampp and apache server  and running it (probably a bad idea). That didn't help and probably because I really am new at php and mysql, I found more things broken than before.
So I uninstalled it and everything that went with it, reinstalled php and mysql.
Same result.

It has to be something easy. Some setting on the folder, some error in the php setup, some setting in iis 7?

I know it is not the module. I uploaded to my website and it works there.

Ideas anyone?
LVL 20

Expert Comment

by:Mark Brady
ID: 35223481
Sorry you are still having proble4ms. I know what this is like as I had all sorts of issues trying to get a web server running as localhost on my windows 7 laptop. I have a dual boot laptop with windows 7 which I hardly ever use (only for testing websites under win dows) and Ubuntu (Linux). Ubuntu is my main opperating sytem and I have lampserver installed there which is the same as wampserver only it is for linux systems. I suggest you uninstall everything (I know you have done this already) so you have none of the programs installed. Double check it is all gone then download the latest version of wampserver from here:


There are two versions, 1 for 32bit and the other for 64bit system so work out if you are running 32 or 64 bit on your computer then download and install the correct version.

Wampserver has all the programs needed to run your local server. I had tried over and over to install apache and php and mysql individually but I could get them all talking to each other and I waisted about 4 days from memory.

Wampserver will solve your problems. Follow the instructions and the setup will put everything in the right location and when ready it will ask you to navigate to your localserver directory or "www" directory and run a file which will tell you if php is working properly at this point.

Very simple to install and simple instructions you really can't go wrong. It only takes less than an hour to do all this in fact more like about 15 to 20 minutes really. Give it a shot then once it is working put all your website folders under the "www" directory on your computer and they will then be accessible by going to "localhost/your_website_folder_name" or "http://localhost/your_website_folder_name"

Give that a try and let me know how it works. If you do by chance get any errors (I doubt you will) please take a screenshot of the error and post it here including an explanation of exactly what you were doing at the time of any error. I think you will be just fine.

Author Comment

ID: 35223676
One of the things I installed was mysql workbench. I assume I should uninstall that also?

I am running a 64 bit OS, and Windows 7 Ultimate
LVL 20

Accepted Solution

Mark Brady earned 1000 total points
ID: 35223747
Ok windows 7 64 bit is fine. I think Mysql Workbench is a replacement for running MySql so I would (to be safe) uninstall that first. Make sure you reboot after the uninstalling has been done for everything to make sure there are no instances of the sever running (ie: apache server). When you have a fresh reboot and there are no apache servers running then install the 64bit version of WAMPSERVER. You really can't go wrong. Lampserver is the windows equivalent of  "LAMPSERVER" and also for mac they have a MAMP program which is almost the same but basically means that the package includes

Windows, Apache, MySQL, PHP/Perl/Python for Wamp server.

The good thing is that the installation file configures all the programs to run together and puts them all in the right locations. You will get asked during installation for your root password for phpmyadmin to access mysql databases. Be sure to set a password for this "root" account and do not forget it! Once everything is installed you will need to reboot but by starting "wampserver" after installation you can click on "start all services" and "put online". There is an option in wampserver to start wamp and all services on startup so I would check that option so you don't need to do anything to get your server going each reboot.

Just for your information, i have 2 computers

1: Windows7 dual booting with Linux Ubuntu - has Wamp on windows 7 and Lamp on Linux
2: Macbook pro with Mamp running on it.

All 3 operating systems run perfectly with their wamp/lamp/mamp installations and I have 3 web servers so it is perfect for testing my websites in different environments. One more great tools for you to get would be the latest version of IETester for windows.

This is a program that can open up an IE window in version 5.5 right through to 9 so you can open multiple versions of IE and test your programs/websites on each version before releasing and getting complaints from silly people using those older versions of IE.

Anyway that last comment was just a suggestion. Go get it installed and let me know how it goes ok.

Expert Comment

by:Erdinç Güngör Çorbacı
ID: 35229702
sneves44 if you are not experienced and just starting to learn i advise EasyWAMP which is less complicated and easy to use.

Author Comment

ID: 35231157
Thanks all for your input! I think I have it now.
Interestingly enough, I probably had it before. I discovered after much hunting around and trial and error, that if I use <?php .. ?> as my opening and closing on localhost, it works. This is not what the online class I am taking OR the book I have says to use. They both say <? .. ?>. The latter works on the (external) website. Is there something I can do to make them the same?

Also, WAMP shows it has installed version 5.1.53 of MYSQL. I had originally installed mysql-5.5.9-win64.msi. I am not familiar with the way mysql packages or names its releases (as is not at all) but it looks as though I am many releases behind what I originally installed. (?)

Author Closing Comment

ID: 35231177
However, the problem had another issue, which had nothing to do with the install.

Author Comment

ID: 35231733
Thanks to everyone who answered! I really appreciate it.
LVL 20

Expert Comment

by:Mark Brady
ID: 35235987
sneves44: Thanks for the points. <?php and ?> are the most common way of opening and closing the php engine (starting/stopping). <? was used in the older versions of php and a lot of tutorials still use them although it is not a good idea to use those opening tags anymore. Always use <?php to open any php page.

The other ones are called "short tags". If you have a lot of php script that use short tags you can do one of two things.

1: CTRL + R -> Replace ALL <? with <?php on each script. Recommended.
2: Open PHP.ini (php.ini) and seach for "short_open_tag" which is a boolean. If set to "no" you must use the full <?php tags instead of <?

Good luck

Author Comment

ID: 35236466
Ahhh! I get it. No backward compatibility on localhost.
Now of course I have yet another problem. All was working fine. I developed two databases, 1 completely, loaded and everything. The other I had one table loaded. I decided to get away from it and while I was at it, reboot.
When I started the services phpmyadmin gave me a 1045 error. On a wild guess I took out the password in the config file and it worked but neither of the databases shows.
I am reasonably sure they still exist, but my signon is somehow hosed so it doesn't show them to me.
Should I open another question?
I have no idea how to figure this out.
LVL 20

Expert Comment

by:Mark Brady
ID: 35237910
Yes open another question and try to list everything you did in the leadup to the problem. There will be a simple reason why it happened or at least it will be easy enough to fix so go ahead.

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

On some Windows 7 (SP1) computers, Windows Update becomes super slow even the computer is reasonably fast.  There's one solution that seemed to have worked well for me (after trying a few other suggested solutions).
There are times when I have encountered the need to decompress a response from a PHP request. This is how it's done, but you must have control of the request and you can set the Accept-Encoding header.
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.
If you’ve ever visited a web page and noticed a cool font that you really liked the look of, but couldn’t figure out which font it was so that you could use it for your own work, then this video is for you! In this Micro Tutorial, you'll learn yo…
Suggested Courses

636 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