文章详情

  • 游戏榜单
  • 软件榜单
关闭导航
热搜榜
热门下载
热门标签
php爱好者> php文档>Installing PHP 5.2.3, MySql 5.0, IIS 6.0 on Window

Installing PHP 5.2.3, MySql 5.0, IIS 6.0 on Window

时间:2008-04-12  来源:wybonline

   
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!


相关阅读 更多 +
排行榜 更多 +
粉末星战 v1.0.0 安卓版

粉末星战 v1.0.0 安卓版

休闲益智 下载
粉末星战 v1.0.0 安卓版

粉末星战 v1.0.0 安卓版

休闲益智 下载
火线反恐部队 v1.2 安卓版

火线反恐部队 v1.2 安卓版

飞行射击 下载