Php5.4.15(目前最新:注意下载VC9 x86 Thread Safe,上面是非    线程安全的,下面是我们想要的, 解压安装到E:\php-5.4.15)
http://windows.php.net/download/

Apache2.2(安装默认目录C:\Program Files\Apache Software Foundation\Apache2.2)
http://httpd.apache.org/download.cgi

MySql下载
http://www.mysql.com/downloads/


#####开始配置了
1:将%PHP_HOME%\php.ini-development更名为php.ini(Php5.4.15有这个文件,其它版本不一定有)
2:php.ini中修改如下
extension_dir= "E:/php-5.4.15/ext";(必须的)
extension=php_mysql.dll
extension=php_mysqli.dll这两句注释去掉(支持mysql的)
3:%APATHE_HOME%\conf\httpd.conf中修改,把下面三句话加上,前面的一堆#LoadModule,就加在它们后面吧
LoadModule php5_module "E:/php-5.4.15/php5apache2_2.dll" (php和apache整合,这个文件php5.4.15有,其它版本不一定有)
PHPIniDir "E:/php-5.4.15"
AddType application/x-httpd-php .php .html .htm

DocumentRoot根目录(当然可以改,我就不改了)

4: 在%APATHE_HOME%\htdocs(apache的根目录)下写个HelloWorld吧
  新建一个HelloWorld.php
<html>
<head>
<title>Test PHP5</title>
</head>
<body>
<center>
<h1>This is test information</h1>
</center>
<hr>
<?php
 echo "hello world \n";

 echo "this is my first php demo!";
?>
</body>
</html>
 不用重启Apache访问http://localhost/index.php
可以写一个phpinfo.php内容如下
<html>
<head>
<title>Test PHP5</title>
</head>
<body>
<center>
<h1>This is test information</h1>
</center>
<hr>
<?php
  phpinfo();
?>
</body>
</html>
不用重启Apache访问http://localhost/phpinfo.php
访问会看到一个php信息页面
Php连接mysql代码,新建一个mysql.php内容如下,假设mysql已经安装

<html>
<head>
<title>Test PHP5</title>
</head>
<body>
<center>
<h1>This is test information</h1>
</center>
<hr>

<?php
$mysql_server_name='localhost';
$mysql_username='root';
$mysql_password='root';
$mysql_database='mysql';
$db_connect=mysql_connect($mysql_server_name,$mysql_username,$mysql_password) or die("Unable to connect to the MySQL!");
mysql_select_db($mysql_database,$db_connect);
$sql='select * from user';
$result=mysql_query($sql);
while($ob=MySQL_fetch_object($result))  
{
echo "user name is : ".$ob->User."<br/>";
}
mysql_close($db_connect);
echo "Hello!数据库mycounter已经成功建立!";
?>
</table>
</body>
</html>
不用重启Apache访问http://localhost/mysql.php