Link to home
Start Free TrialLog in
Avatar of sneves44
sneves44

asked on

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?

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.

Avatar of Vishal Patel
Vishal Patel
Flag of India image

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.
Avatar of Mark Brady
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.

http://www.plus2net.com/php_tutorial/php_iis_installation.php
Good luck with it all.
Avatar of sneves44
sneves44

ASKER

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?
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:

http://www.wampserver.com/en/download.php

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.
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
ASKER CERTIFIED SOLUTION
Avatar of Mark Brady
Mark Brady
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
sneves44 if you are not experienced and just starting to learn i advise EasyWAMP which is less complicated and easy to use.
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. (?)
However, the problem had another issue, which had nothing to do with the install.
Thanks to everyone who answered! I really appreciate it.
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
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.
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.