How to install PHP and MySQL on IIS

  • wolfmanz
  • Novice
  • Novice
  • User avatar
  • Joined: Mar 21, 2009
  • Posts: 17
  • Loc: Arizona
  • Status: Offline

Post March 22nd, 2009, 11:07 am

When using the PHP Win32 INstaller, which IIS should I select?
IIS ISAPI Module,
IIS FastCGI or
IIS CGI.

Thanks,
Wayne
  • Anonymous
  • Bot
  • No Avatar
  • Joined: 25 Feb 2008
  • Posts: ?
  • Loc: Ozzuland
  • Status: Online

Post March 22nd, 2009, 11:07 am

  • ATNO/TW
  • Super Moderator
  • Super Moderator
  • User avatar
  • Joined: May 28, 2003
  • Posts: 23404
  • Loc: Woodbridge VA
  • Status: Offline

Post March 23rd, 2009, 7:10 am

I'm pretty sure I used IIS CGI. It's been a long time since I installed it, but pretty certain that's what I selected.
"There's no place like 127.0.0.1 except for ::1."
Alexandria Networks. Leader in IT consulting for associations/non-profits, and small to medium sized businesses around the northern Virginia and Washington D.C. metro area.
  • wolfmanz
  • Novice
  • Novice
  • User avatar
  • Joined: Mar 21, 2009
  • Posts: 17
  • Loc: Arizona
  • Status: Offline

Post March 23rd, 2009, 4:32 pm

I am going crazy trying to get this (php on IIS) to work, would you mind if I recap my "over a year journey" with you and see if you can help. Or, at least maybe you could suggest a good forum where I might get this to work?

Thanks,
Wayne
  • ATNO/TW
  • Super Moderator
  • Super Moderator
  • User avatar
  • Joined: May 28, 2003
  • Posts: 23404
  • Loc: Woodbridge VA
  • Status: Offline

Post March 23rd, 2009, 6:28 pm

I seriously need to rewrite my tutorial on this with updated versions. (I need to do a current versions install myself just for the experience)

Perhaps you could "recap" briefly what you have done and then list what errors you are getting.
"There's no place like 127.0.0.1 except for ::1."
Alexandria Networks. Leader in IT consulting for associations/non-profits, and small to medium sized businesses around the northern Virginia and Washington D.C. metro area.
  • wolfmanz
  • Novice
  • Novice
  • User avatar
  • Joined: Mar 21, 2009
  • Posts: 17
  • Loc: Arizona
  • Status: Offline

Post March 24th, 2009, 4:27 pm

First of all, I should mention that I have tried un-installing and re-installing both php and IIS several times.

Here is what I have:

After installing IIS 5.1 and php 5.2.9-1 (my computer is a w/xp pro sp3), I try to configure IIS mappings. When I go to the "Home Directory" tab and click the "Configuration" button nothing happens. I have tried to do this manually with a script by "David Wang" called "chglist.vbs". It tells me that it completed successfully, yet I cannot go back to the "Home Directory" tab and click the "Configuration" button and get it to work.

At one point, when I thought I had things setup and configured correctly, I would run the info.php script and get one of two results:

1. I would get a download request window, or
2. I would get the "info.php" script line as text in the browser window.

I have tried this in IE-7 and Mozilla Firefox 3.0.7 (the latest version), basically the same results both places.

Thanks,
Wayne
  • northstjarna
  • Beginner
  • Beginner
  • No Avatar
  • Joined: Nov 14, 2006
  • Posts: 58
  • Loc: Chertsey, UK
  • Status: Offline

Post March 26th, 2009, 3:18 pm

Hi there,

You need to change some lines in your php.ini file in c:/php

In the PHP installation folder (likely C:\Program Files\PHP), locate the file called php.ini and open it in Notepad.

Find the following line in the php.ini file:
;extension=php_mysql.dll

The semicolon (;) at the start of the line tells PHP to ignore the line.

Delete the semicolon at the start of the line to enable the extension.

extension=php_mysql.dll

This file is required so that IIS can work with PHP 5 and MySQL.
Restart IIS.

Save and close the php.ini file

In the PHP installation folder, locate the file called libmysql.dll and copy it to the C:\Windows\system32 folder.

When done test on your localhost by putting this in text file called test.php and saving to c:\inetpub\wwwroot\

Code: [ Select ]
<p>This page was created at <b>
<?php echo date("h:i:s a", time()); ?>
</b> on the computer running PHP.</p>
  1. <p>This page was created at <b>
  2. <?php echo date("h:i:s a", time()); ?>
  3. </b> on the computer running PHP.</p>


Then test it by going to http://localhost/test.php

Thanks

Andi
  • wolfmanz
  • Novice
  • Novice
  • User avatar
  • Joined: Mar 21, 2009
  • Posts: 17
  • Loc: Arizona
  • Status: Offline

Post March 28th, 2009, 2:03 pm

Andi;

Thanks for your input, however, MySQL is the least of my worries since I can't even get PHP to work properly yet.

Thanks,
Wayne
  • Ortin
  • Graduate
  • Graduate
  • User avatar
  • Joined: Jun 21, 2005
  • Posts: 121
  • Status: Offline

Post March 31st, 2009, 6:05 am

For simple server setup on windows try using wampserver - comes with apache, mysql and php, all in one tidy package.

http://www.wampserver.com/en/
  • unlimited
  • Born
  • Born
  • No Avatar
  • Joined: Mar 28, 2009
  • Posts: 2
  • Status: Offline

Post March 31st, 2009, 11:19 am

i guess IIS CGI
this is the only way as par i am condered
thanks
  • wolfmanz
  • Novice
  • Novice
  • User avatar
  • Joined: Mar 21, 2009
  • Posts: 17
  • Loc: Arizona
  • Status: Offline

Post April 3rd, 2009, 2:49 pm

ATNO/TW;

Got it working.

Not sure what the problem was, but re-built my system (Format HD, etc.) Now at least PHP works w/IIS.

Next step MySQL.

Thanks;
Wayne
  • godilya
  • Born
  • Born
  • User avatar
  • Joined: Apr 18, 2009
  • Posts: 3
  • Loc: Israel
  • Status: Offline

Post April 18th, 2009, 5:09 am

:cry: I got the same problem, only I can't fix it...

I have win xp pro 64. I am trying to set up my IIS server with php 5.2

and getting lots of errors...

I try to explain to you what I did:

I download the php zip package and install files, and installed it to c:/php

then I edited the php.ini file like this:

extension_dir = "c:/php/ext/"
doc_root = "C:/Inetpub/wwwroot"
extension=php_mbstring.dll ';' been removed
extension=php_mysql.dll ';' been removed

Then in My computer in the Environment Variables
in the user variables I created a PHPRC variable with a value of c:\php\
then in system variables in the path variable I added the value of ;C:\php;C:\php\ext to the end of the string

then in iis manager I went to web service extension and added new web service name "PHP ISAPI Extension" at the required files i gave it php5isapi.dll
next in the "default web site" I went to properties, home directory and in the configuration I added executable path for .php extensions.

Now when I am trying to run info.php file with the next code:
<?php phpinfo(); ?>

it says I got error:
chrome: "%1 is not a valid Win32 application"
IE 7.0: "The website cannot display the page HTTP 500" :cry:

And I already restarted my PC for like 1,000,000 time for every little thing that I changed.

Pleas try to help me I am lost... :cry:
  • godilya
  • Born
  • Born
  • User avatar
  • Joined: Apr 18, 2009
  • Posts: 3
  • Loc: Israel
  • Status: Offline

Post April 18th, 2009, 9:59 am

O.K I just been trying some thing new.

I deleted all my settings that i made, reinstalled both the server and the php, after installation complete I extracted all the files from the php package to the php directory witch I choose to install to.

the install edited by him self the "default web site configuration", adding .php extension

he also edited the php.ini file adding the extension_dir to be set for my php\ext\

and the environment variable been edited as well.


But yet I got error, now its a new one, this error is same as I am getting when trying to open a file that is not exist. :twisted: :twisted: :twisted: :twisted: :twisted: :twisted:


I hope that some1 will hear my pray and help me with it.
  • George L.
  • Bronze Member
  • Bronze Member
  • No Avatar
  • Joined: Nov 05, 2007
  • Posts: 2206
  • Loc: Malaysia
  • Status: Offline

Post April 18th, 2009, 7:26 pm

Ortin wrote:
For simple server setup on windows try using wampserver - comes with apache, mysql and php, all in one tidy package.

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

WAMP uses Apache, not IIS.
  • godilya
  • Born
  • Born
  • User avatar
  • Joined: Apr 18, 2009
  • Posts: 3
  • Loc: Israel
  • Status: Offline

Post April 18th, 2009, 9:21 pm

What is the different then?
  • wolfmanz
  • Novice
  • Novice
  • User avatar
  • Joined: Mar 21, 2009
  • Posts: 17
  • Loc: Arizona
  • Status: Offline

Post April 25th, 2009, 7:21 pm

godilya;

Wish I could be of more help to you; however, I never did figure out why my install didn't work. I eventually rebuilt my computer (it needed it anyway), reinstalled and it worked. The only other things I can think of you might try are:

1. I made the "PHPRC" a systems variable also.

2. Here is the “php.ini” setup I used:
extension_dir = "x:\PHP\ext”
session.save_path = "x:\PHP\sessions”
upload_tmp_dir = "x:\PHP\upload”
error_log = "x:\PHP\log\php.log”
extension=php_mysql.dll

3. I created the .php mapping in the “Web Sites” folder under IIS. You only need to setup the mapping at the highest level anyway.

4. Lastly, I used the “.zip” file not the “.msi”, to install the files. Make sure you get the 64 bit version.

One other thing I tried was un-installing and re-installing IIS. My system is “32 bit”, so I also deleted “C:\windows\system32\inetsrv” directory. You may have to do this in “Safe Mode”. Not sure about “64 bit” systems.

It might help if you could attach screen captures of the exact error.

Wayne
  • Anonymous
  • Bot
  • No Avatar
  • Joined: 25 Feb 2008
  • Posts: ?
  • Loc: Ozzuland
  • Status: Online

Post April 25th, 2009, 7:21 pm

Post Information

  • Total Posts in this topic: 15 posts
  • Users browsing this forum: No registered users and 218 guests
  • You cannot post new topics in this forum
  • You cannot reply to topics in this forum
  • You cannot edit your posts in this forum
  • You cannot delete your posts in this forum
  • You cannot post attachments in this forum
 
 

© 2011 Unmelted, LLC. Ozzu® is a registered trademark of Unmelted, LLC.