How to install PHP and MySQL on IIS

  • wolfmanz
  • Novice
  • Novice
  • User avatar
  • Posts: 17
  • Loc: Arizona

Post 3+ Months Ago

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
  • Posts: ?
  • Loc: Ozzuland
  • Status: Online

Post 3+ Months Ago

  • ATNO/TW
  • Super Moderator
  • Super Moderator
  • User avatar
  • Posts: 23456
  • Loc: Woodbridge VA

Post 3+ Months Ago

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.
  • wolfmanz
  • Novice
  • Novice
  • User avatar
  • Posts: 17
  • Loc: Arizona

Post 3+ Months Ago

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
  • Posts: 23456
  • Loc: Woodbridge VA

Post 3+ Months Ago

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.
  • wolfmanz
  • Novice
  • Novice
  • User avatar
  • Posts: 17
  • Loc: Arizona

Post 3+ Months Ago

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
  • northstjarna
  • Posts: 58
  • Loc: Chertsey, UK

Post 3+ Months Ago

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
  • Posts: 17
  • Loc: Arizona

Post 3+ Months Ago

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
  • Posts: 121

Post 3+ Months Ago

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
  • unlimited
  • Posts: 2

Post 3+ Months Ago

i guess IIS CGI
this is the only way as par i am condered
thanks
  • wolfmanz
  • Novice
  • Novice
  • User avatar
  • Posts: 17
  • Loc: Arizona

Post 3+ Months Ago

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
  • Posts: 3
  • Loc: Israel

Post 3+ Months Ago

: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
  • Posts: 3
  • Loc: Israel

Post 3+ Months Ago

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
  • George L.
  • Posts: 2209
  • Loc: Malaysia

Post 3+ Months Ago

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
  • Posts: 3
  • Loc: Israel

Post 3+ Months Ago

What is the different then?
  • wolfmanz
  • Novice
  • Novice
  • User avatar
  • Posts: 17
  • Loc: Arizona

Post 3+ Months Ago

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

Post Information

  • Total Posts in this topic: 15 posts
  • Users browsing this forum: No registered users and 64 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
 
 

© 1998-2014. Ozzu® is a registered trademark of Unmelted, LLC.