How to setup PHP in IIS (with mssql-Support)

09/30/2012 19:47 Failwell#1
I write this guide because i'm asked for how to do it more than once.

Whats it about?
Part I: How to install PHP in IIS - so you can setup your own website for your SRO-Server.

Part II: Install Drivers for MS-SQL in PHP.

Feel free to contact me for more stuff and help:
[Only registered and activated users can see links. Click Here To Register...]
Skype: mindfav

__________________________________________________ _

STEP BY STEP
-------------

1. Install IIS
xxxxxxxxxxxxxx
this should normally already been done. Check it under:

->((Start-Button -> Administrative-Tools -> Server Manager
–> Roles
-> (Choose) Add Roles
–> (Select) “Web Server (IIS)” //you should also install ISAPI - That makes fast implementation of PHP possible.

Normally this should be grayed and already installed.

1.b) Make Sure ISAPI and CGI is installed
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
-> Start-> Administrative Tools -> Server Manager
-> Roles
-> Web Server (IIS)
-> On the right side - scroll down to "Role Service" Section
-> Under Application Developement there should be installed ISAPI Filters and CGI
-> If not - click the "Add Role" Button on the right side
-> Install isapi Filters -> (Confirm - install...)

After installation is complete - check if installation was succesful in this list.


2. Install PHP
xxxxxxxxxxxxxx

->Go to: [Only registered and activated users can see links. Click Here To Register...] (or just php.net and than download, if the windows section doesn't exist anymore..)
->Download the Non-Thread-Safe Version

->Install it under: C:\PHP
Please don't use another Folder.
Don't ever install it under Program Files or something like that:

Can produce hard to find errors because of special Characters in File-Paths.
Can produce hard to find errors because of rights-Management of Windows! (Means - it wouldn't have all rights like creating files, deleting files, etc - when executing..)

3. Configure IIS to use PHP
xxxxxxxxxxxxxxxxxxxxxxxxxxx
-> Start->Administrative Tools->Internet Information Services (IIS) Manager
-> Select Computer (in left Selection-Box)
-> Double Click "Handler Mappings" Icon on right Side.
-> Click: "Add Module Mapping" and fill in the following:

Request path: *.php
Module: FastCgiModule
Executable: C:\php\php-cgi.exe
Name: PHP5
Save that settings.

4. Testing
xxxxxxxxxx

PHP should now be installed. You can go on and test it.

-> Create a folder htdocs (if none doesn't exist in C:)
-> Put a file phptest.php in it (make sure theres no *.txt extension - windows hides known extensions as default..)
In this file type: <?php phpinfo(); ?>

-> Save file (in htdocs)
-> Go back to iis manager
-> Create Web-Project in List
Select the folder, give it a name
-> Save: It prompts that this project will use port 80. Acceppt that - for web we wan't to use port 80 because this is default.
-> Select the server icon in the list (right click) and start web publishing
-> Make sure the Web-Projekt you just created is running now. Else - start it!

-> Go to the browser on the windows-server machine.
-> Type: localhost/phpinfo.php
-> You should see the php information site!
-> Check the same from YOUR Local machine - go to your browser and type atlantis-sro.com/phpinfo.php

If you see the same info site - everything is fine!

If you don't see it, check that your website is running in iis and that the web publishing service is startet.

Restart Web-Publishing-Service and IIS
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

If it doesn't run yet, try to reset the configuration:

1. Open command line (cmd.exe)
2. tpye: IISReset

When thats done:
3. type: net start W3SVC


-----------------------------------------
HFGL
10/01/2012 12:58 PortalDark#2
#approved
10/01/2012 19:14 Raptursh#3
Nice guide Steve ;)
10/02/2012 18:44 kahyo93#4
Make vidéo please :)
10/02/2012 19:42 GroundRave#5
Thank you very usefull !