1.Appache
a.在httpd.cfg中添加以下配置
class="java" name="code">
LoadModule php5_module C:/Green/php_5_3_5_Win32_VC6_x86/php5apache2_2.dll
PHPIniDir "C:/Green/php_5_3_5_Win32_VC6_x86"
AddType application/x-httpd-php .php .phtml
Listen 8888
b.
注释掉DocumentRoot
c.可以添加一个至多个虚拟目录
<IfModule dir_module>
DirectoryIndex index.php
Alias /phpmyadmin "D:/_MyApacheVirDir/phpMyAdmin_3_3_10_all_languages"
<Directory "D:/_MyApacheVirDir/phpMyAdmin_3_3_10_all_languages">
Order allow,deny
Allow from all
</Directory>
</IfModule>
<IfModule dir_module>
DirectoryIndex index.php
Alias /discuz "D:/_MyApacheVirDir/Discuz_6.0.0_SC_UTF8"
<Directory "D:/_MyApacheVirDir/Discuz_6.0.0_SC_UTF8">
Order allow,deny
Allow from all
</Directory>
</IfModule>
<IfModule dir_module>
DirectoryIndex index.php
Alias /mytest "D:/_MyApacheVirDir/my_test"
<Directory "D:/_MyApacheVirDir/my_test">
Order allow,deny
Allow from all
</Directory>
</IfModule>
2.Php
a.rename php.ini-development to php.ini
b.在php.ini中指定扩展模块
extension_dir = "C:/Green/php_5_3_5_Win32_VC6_x86/ext"
3.测试 Apache+php
a.在my_test目录下放置testphp.php
<?php
phpinfo();
?>
b.测试
localhost/mytest/test.php
4.测试mysql
a.在php.ini中
开启支持mysql
extension=php_mysql.dll
extension=php_mysqli.dll
a.在my_test目录下放置testmysql.php
<?php
$conn=mysql_connect("localhost","root","root");
if($conn){
echo "connected";
}else{
echo "failed";
}
?>
5.安装phpadmin
a.解压到虚拟目录
b.在httpd.cfg中配置该虚拟目录
c.登录测试