Subscribe

Subscribe To Mail

Powered By

I Love:
Blogger

Powered by Blogger

PHP under IIS

Installing PHP under IIS:
You need to have PHP 5.2 or some version (size: ~26MB)
Step 1:
Extract the zip or rar file of PHP and place it in C:/PHP
Note that the folder Name is PHP (in Caps)
The PHP folder should contain a set of DLL files and “.ext”, extras and “dev” directories.
Step 2:
Go to control Panel – Administrative Tools – Internet Information Service
If IIS is not installed, install it.
Click on Local Computer – web sites –Right Click on default web Page –Properties.
Under Property Tab –Home Directory –configuration –Add –Executable –browse on C:\php\php5isapi.dll (extension: .php) click Ok
Now in Home Directory type in local path C:\inetpub\wwwroot. Click Ok
Step 3:
In C:\PHP
You will see file named “php.ini-recommended”
Do following alternations by opening that file in note-pad and need to do some configuration changes for PHP to work with IIS and also for MYSQL.
So, its better you have some basic understanding of what that “php.ini-recommended” is?  
It contains “;”( semi-colon) after sentences. To make some connections with PHP you need to remove the “;”( semi-colon). Done!!!!
Let’s start. You need to find the following lines in that file and alter. Use “Ctrl+f”-Find in case of difficulty in finding the sentences
Note: First 2 steps will make PHP work with MYSQL
Find 1                                                                                                                                                  extension=php-mysql.dll; -Find this and alter. Note remove semi-colon at end                            
  so it becomes extension=php-mysql.dll
Find2                                                                                                                                           extension=php-mysqli.dll; -Find this and alter. Note remove semi-colon at end                                              
so it becomes extension=php-mysqli.dll         
                                                                                                                                                              Note: You need to locate some directory for PHP to work. Understood!!
Find3                                                                                                                                                    extension-dir=”/” -here you need to type something and also remove semi-colon.                                           So it becomes extension-dir=C:\PHP\ext.                                                                                                  
 Note: You are locating the extension directory for PHP to work. Understood!!
Find4                                                                                                                                session.save_path=”/tmp” –type following and remove semi-colon.                                                         
 So it becomes session.save_path=”C:\PHP\sessions
Find5  upload_tmp_dir=”/”   -type following and remove semi-colon.                                                                So it becomes upload_tmp_dir=”C:\PHP\upload
Please do take your own time in finding the exact tags and change it. Remember to take out the semi-colons and uncomment them.
Now, everything set!! Save this file as “php.ini”                                                                                  
Make a copy of “php.ini” in C:\Windows Folder.                                                                    
Restart your system.
Step3: Testing your PHP
Create the PHP test file by typing the following code in the Note Pad
``````````````````````````
Phpinfo();
?>
``````````````````````````````
Save as: test.php
Place this under C:\inetpub\wwwroot\test.php
Now type this in your browser
If it shows details of php, then succeeded.
Configuring MYSQL to work with PHP
To do this Go to C:\PHP and copy the libmysql.dll and paste it in C:\Windows\System32
Common Errors: Error 10061                                                                                                          
 This is a common error you get in IIS when there are some errors for  MYSQL                                     
 So trouble shoot the following steps to overcome that error. The steps are                                            
1. Check whether Task Manager – Mysql-nt is running                                                                                 2. Check whether Firewall has 3306 port checked. (If not read above to find about configuring Firewall for IIS)                                                                                                                                  
3. Now come to php.ini file      
  If you have uncommented (removed semi-colons) for any other sentences said above. It may be the reason for the error. So check and replace semi-colons for others sentences.                                                    
 4. Now checking MYSQL facts in php.ini file                                                                                                          check under [MYSQL] in phi.ini file and see that below parameters are present; If not do add those parameter; Note these parameters must be compulsory present                                                                                            mysql.allow_persistent=on                                                                                        mysql.max_persistent=-1                                                                                                     mysql.max_links=-1                                                                                                     mysql.default_port=3306                                                                                            mysql.default_socket=25                                                                                 mysql.default_host=localhost                                                                                  mysql.default_user=root                                                                                 mysql.default_password=root                                                                                        mysql.connect_timeout =60                                                                                       mysql.trace_mode=off                                                                             
Hope you would have solved the problem.
for mysql under IIS check:  mysql under IIS

No comments:

Post a Comment

..