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

windows下的php运行环境搭建

2015-05-06 23:27 393 查看
第一步,配置php运行环境

配置httpd.conf  大约在128行

LoadModule php5_module "E:\php\php\php5apache2_2.dll"

<FilesMatch "\.php$">
setHandler application/x-httpd-php
</FilesMatch>
PHPIniDir "E:\php\php"


第二步 php.ini配置时区1008行

date.timezone = PRC


第三步 配置数据库

811行开启拓展

extension_dir = "E:\php\php\ext"
971行
extension=php_mysql.dll
extension=php_mysqli.dll

测试数据库

<?php
$link = mysql_connect("localhost","root","0631");

第四步配置虚拟主机

httpd.conf 519行

Include conf/extra/httpd-vhosts.conf


httpd.conf 200行

<Directory "E:/php/apache/htdocs">

Options Indexes FollowSymLinks

AllowOverride None
Order deny,allow

Deny from all
Allow from all

</Directory>


229

<IfModule dir_module>
DirectoryIndex index.html index.php
</IfModule>


简单配置

<VirtualHost *:80>
ServerName www.34.com
DocumentRoot "C:\Users\Administrator\Desktop\teacher"
</VirtualHost>


复杂配置

<VirtualHost *:80>
ServerName www.34.com
DocumentRoot "C:\Users\Administrator\Desktop\teacher"
</VirtualHost>
<VirtualHost *:80>
ServerName www.job.com
DocumentRoot "E:\job"
<Directory "E:\job">

Options Indexes

AllowOverride None
Order deny,allow

Deny from all
Allow from all
DirectoryIndex index.html index.php

</Directory>
</VirtualHost>


注意事项
1.每次修改php.ini和httpd.conf都要重启阿帕奇

2.第一步修改配置httpd.conf时候里面<>不能有空格
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐