Chinaunix首页 | 论坛 | 博客
  • 博客访问: 116473
  • 博文数量: 52
  • 博客积分: 2520
  • 博客等级: 少校
  • 技术积分: 545
  • 用 户 组: 普通用户
  • 注册时间: 2006-06-13 16:58
文章分类

全部博文(52)

文章存档

2009年(1)

2008年(1)

2007年(22)

2006年(28)

我的朋友
最近访客

分类:

2008-04-12 11:39:15

  
After hours of trying and re-trying and fustration, I finally installed PHP to work with MYSQL and IIS 6.0 Manager on a Windows XP machine. These are the steps I took. Hope that they work for you...

I installed PHP and MySQL on Windows XP platform with IIS 6.0. Please note if you are running IIS 5.0 Manager that comes with the Windows CD, the first thing I did was search google for "Download Microsoft IIS 6.0 Manager" and go to Microsoft to download and Install it. Once installed IIS 5.1 and IIS 6.0 manager will coexist in "Control Panel -> Administrative Tools". (I haven't used IIS7 so I cannot comment on it yet)

Also download the following 3 items:   

* Download PHP 5.2.3 ZIP File (9.47 mb):                

* Download MySQL 5.0 (39.7 mb):

* Download MySQL 5.0 GUI Tools (17.7 mb): (Tools to help you administer database)



INSTALLING PHP
Step 1: Configure IIS 6.0 to point to a local folder where your webfiles. Don't forget to create a file called "index.htm" (or index.html) add some HTML like a picture or fancy text font. Once you configure it, you should be able to see it by typing from the URL of Internet Explorer.

Step 2: Create a folder on C: called "PHP" and unzip the files from the PHP download into that folder. You should see a a bunch of DLL's and additional sub-folders called "ext", "extras" and "dev" with files in there as well.

Step 3: Open IIS6 Manager Right Click -> Default Website -> Properties -> Select Home Directory -> Select Configuration. On Application configuration check to see if .php is in list. If not click "Add". For executable browse to "c:\php" folder and select "php5isapi.dll". Click "OK" and then "OK" again.


Step 4: Create a test file in the root of your web folder called "phptest.php" and insert the code below:


Step 5: In the "C:\PHP" folder copy the file "php.ini-recommended" to your C:\WINDOWS folder. Rename this file to "php.ini"

Step 6: Reboot the computer.

Once fully rebooted in the URL bar of IE, type "/phptest.php" and you should see it give you information about the PHP version.

If you see this then you know it worked properly and PHP is installed successfully!



INSTALLING MYSQL
Step 1: Install MySQL 5.0.

Step 2: Install MySQL 5.0 GUI Tools. These will allow you to view your databases and data structures

Step 3: Configure an Instance: The best way I configured it to work successfully was once it was installed to go into the "MySQL Server Instance Configuration Wizard" and click "Detailed Configuration", "Developer Machine", "Non-Transactional Database Only", "Decision Support (DSS)/OLAP", "Check Enable TCPIP Netwokring", Port 3306, "Standard Character Set", "Install as a Windows Service", Give it a main password that you remember like "root", Click "Execute!!".

*** Please note your username will be "root" and password will be whatever you typed (in this example "root"). After you hit "Execute", You should see 4 buttons light up with no red 'X's and you know MySql is configured correctly!

Step 4: Open the MySQL Administrator program. Set server host = localhost, username=root and password=root or whatever you set it to. Click on catalogs, if you see "mysql" then that is a main database.

This means that MySQL is installed properly!!



CONFIGURING PHP TO WORK WITH MYSQL
Step 1: In the C:\PHP folder copy the file "libmysql.dll" to your C:\WINDOWS\SYSTEM32 folder. Make sure you don't overwrite any existing file in this folder. If file exists, first rename it so you can go back.
*** Why IIS simply does not read the PHP directory? ...I do not know ***

Step 2: Edit this file "php.ini" that you copied to your C:\WINDOWS folder using a text editor like notepad. Find the line where it says "extension_dir = *something*". Uncomment this line by removing the preceding semi-colon. and set it to say: extension_dir="c:\php\ext"

Step 3: In the same file "php.ini" also un-comment out 2 other lines by removing semi-colon. Find the lines where it says: extension=php_mysql.dll and extension=php_mysqli.dll and uncomment both lines by removing the semi-colon.

Step 4: Reboot the computer

Step 5: I have provided a simple PHP script to test database connection to MYSQL. Copy and paste this into a file call it for example: "testmysql.php" and place it into the web root folder (same folder as "phptest.php")
Step 6: If you run this script by typing: /testmysql.php
and it says "Successfully Connected to MySQL Database Manager!" and "Successfully Connected to Database 'MYSQL'" then this means that MySQL is now communicating with PHP and is installed and working properly!!!
Hope it helped!
阅读(705) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~