免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 1555 | 回复: 0
打印 上一主题 下一主题

Installing PHP 5.2.3, MySql 5.0, IIS 6.0 on Window [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2008-04-12 11:39 |只看该作者 |倒序浏览
   
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:   
(Read Article Download Disclaimer First)



* Download PHP 5.2.3 ZIP File (9.47 mb):
Click Here to Download
                 

* Download MySQL 5.0 (39.7 mb):
Click Here to Download

* Download MySQL 5.0 GUI Tools (17.7 mb):
MySql 5.0 GUI Tools
(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 http://127.0.0.1 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.
*** Click Here to See Visual Illustration on this Step ***

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 "http://127.0.0.1/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: In the  [color="000080"]C:\PHP folder copy the file [color="000080"]"php.ini-recommended" to your [color="000080"]C:\WINDOWS folder.  Rename this file to [color="000080"]"php.ini"
-->
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") Unable to connect to database manager.");
       die('Could not connect: ' . mysql_error());
         exit();
} else {
  echo("Successfully Connected to MySQL Database Manager!");
}
if (! @mysql_select_db("mysql") ){
         echo( "Unable to  connect database...");
         exit();
} else {
  echo("Successfully Connected to Database 'MYSQL'!");
}
?>

Step 6: If you run this script by typing: http://127.0.0.1/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!


本文来自ChinaUnix博客,如果查看原文请点:http://blog.chinaunix.net/u/20637/showart_528065.html
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP