1、配置httpd.conf(加载php模块)
LoadModule php5_module "php安装路径/php5apache2_2.dll"
PHPIniDir "php安装路径"
AddType application/x-httpd-php .php .html
2、配置php.ini
extension_dir = "php安装路径/ext"
extension=php_mysql.dll //启用mysql
extension=php_mysqli.dll
搞定!
apache虚拟路径的建立方法
1、httpd.conf中找到<IfModule dir_module>修改为如下
#Create Virtual Directory
<IfModule dir_module>
DirectoryIndex index.html
Alias /myblog "F:/myblog"
<Directory F:/myblog>
order allow,deny
Allow from all
</Directory>
</IfModule>
apache虚拟主机的建立方法:
1、httpd.conf 中启用httpd-vhost.conf
2、准备virtual sites
3、设置httpd-vhost.conf
<VirtualHost 127.0.0.1>
DocumentRoot "Dir of virtual sites"
DirectoryIndex index.php
<Directory Dir of virtual sites>
Options FollowSymLinks
AllowOverRide None
order allow,deny
Allow from all
</Directory>
</VirtualHost>
4、host文件中添加映射关系