您的位置:首页 > 编程语言 > PHP开发

Config PHP and MySQL on Windows XP platform

2008-02-22 18:47 555 查看
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();
?>

 

 

 

 

 

 
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息