This topic seems to a mystery, especially for those who ran
Content Management System’s on web server. Access to
web server requires one to connect to the internet as and
when required, and also one should have registered domain
name. Therefore, for learning purpose, web developers, normally
requires to install IIS and run the system locally, before
deploying it in the web server. But, IIS will not run, PHP
and MySQL, by default, which is required for any modern Content
Management System to run. So, here is the remedy for getting
PHP, MySQL run from the local system, through IIS 7.
Before you could try the following steps, make sure that,
you are running Windows 7 or above and IIS 7 or above, and
have installed CGI from Windows Features.
Download latest PHP interpreter from http://www.php.net/
Download MySql installer from http://www.mysql.com/
Download phpmyAdmin from http://www.phpmyadmin.net/
Installing PHP in IIS:
Extract the contents of zip file which is downloaded from
http://www.php.net/ to “c:\php\”.
Open Internet Information Services (IIS) Manager from Administrative
Tools in the Control Panel.
In IIS, Click on “Handler Mapping” and select
“Add Module Mapping” in the right most pane.
Specify the following,
Request Path as *.php,
Module as FastCgiModule,
Executable as, c:\php\php-cgi.exe,
Name as PHP – FastCGI.
Click on OK button, when you are done.
Installing MySQL:
Install MYSQL, which is a step-by-step installer. The installer
will ask you to provide admin password. Provide a password
and note it down. It is the password for root.
To connect MySQL to PHP:
Copy libmysql.dll from C:\Program Files\MySQL\MySQL Server <Version>\lib to c:\windows\system and also to c:\windows\system32.
Modify the extension of php.ini-development file in "c:\php\", to php.ini only.
Now open php.ini file in notepad editor, remove ; to un-comment and modify the lines as given below,
extension=c:\php\ext\php_mysql.dll
extension=c:\php\ext\php_mysqli.dll
NOTE: if you specify the path incorrectly, you will get an
error message as “C:\PHP\php-cgi.exe - The FastCGI process
exited unexpectedly”, while executing the php file from
the client browser.
Setting phpMyAdmin:
Create a Virtual Directory, named phpMyAdmin, which points
to unzipped contents (c:\phpMyAdmin) of downloaded file from
http://www.phpmyadmin.net/.
You can bypass the login screen, if you rename the "config.sample.inc.php"
file to "config.inc.php" of phpMyAdmin and modify
the config.inc.php to accomodate these changes.
/* Authentication type */
$cfg['Servers'][$i]['auth_type'] = 'config';
$cfg['Servers'][$i]['user'] = 'root';
$cfg['Servers'][$i]['password'] = 'root-password';
// use here your MySQL password
/* Server parameters */
$cfg['Servers'][$i]['host'] = 'localhost';
$cfg['Servers'][$i]['connect_type'] = 'tcp';
$cfg['Servers'][$i]['compress'] = false;
/* Select mysql if your server does not have mysqli */
$cfg['Servers'][$i]['extension'] = 'mysqli';
$cfg['Servers'][$i]['AllowNoPassword'] = true;
|
Finally, Apply and Test:
After you apply all above mentioned setting changes, reboot/restart
the system.
To confirm that, you are in PHP, MySQL environment, just type
localhost/phpmyadmin and login to mysql by giving id as root
and root’s password. If you are able to run and login
to the phpmyadmin, then you are done!...