Config PHP and MySQL on Windows XP platform

本文详细介绍如何安装MySQL数据库系统并设置PHP环境。包括下载PHP RAR文件包、配置PHP以连接MySQL、在IIS或Apache上配置PHP,以及创建测试文件验证PHP和MySQL是否正确安装。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

1. Instal MySQL database system.
2. Download PHP RAR file package(Note, no install version, :-) ), then decompressing files. Rename php.ini.recommended(or php.ini-dist) to php.ini, copy this file to Windows
directory. Copy php5ts.dll,libmysql.dll to c:/windows/system32. Copy php_gd2.dll,php_mysql.dll,php_mbstring.dll(etc., this files on php5/ext directory) to c:/windows/system32.
3. Config PHP in MySQL.
Edit c:/windows/php.ini, change some lines code:

extension_dir = "C:/php5/ext" // example path

;extension=php_mbstring.dll // delete character ;
;extension=php_gd2.dll // delete character ;
;extension=php_mysql.dl // delete character ;

session.save_path = "N;/path" // add this line in tail : session.save_path = "C:/WINDOWS/Temp"

short_open_tag = On // value set on

display_errors = On // value set on

register_globals=Off // value set on

date.timezone = PRC // People's Republic of China, time zone.

4. Config PHP on IIS or Apache.

5 Test PHP and MySQL
Create two files like the following code.
<?php
// Test PHP
phpinfo();
?>

<?php
// Test access MySQL Database
$host = "localhost";
$user = "root";
$password = "12345";// NOte, You may be change the password !
$link=mysql_connect($host,$user,$password); 
if(!$link) echo "<h1>Error!</h1>";
else echo "<h1>OK!</h1>";
mysql_close();
?>

 

 

 

 

 

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值