php与apache的集成、配置虚拟目录、配置虚拟主机

WBOY
Freigeben: 2016-08-08 09:25:50
Original
1360 Leute haben es durchsucht
php与apache的集成:

1、在apache的conf目录下的httpd.conf加入

LoadModule php5_module "D:/appserv/php/php5apache2_2.dll"

PHPIniDir "D:/appserv/php"

AddType application/x-httpd-php .php .phtml

2、把php.in-development文件改成php.ini

3、在php.ini中可以指定对应的功能模块

在这里我们指定php的扩展库路径

extension_dir = ".../php-5.3.5/ext"


配置虚拟目录:


    #direcotory相当于是欢迎页面
    DirectoryIndex index.html index.htm index.php
    #你的站点别名
    Alias /myblog "D:/myblog"
   
   #这是访问权限设置
   Order allow,deny
   Allow from all
   


注销documentroot路径 #DocumentRoot


配置虚拟主机的步骤如下:

1、启用 httpd-vhosts.conf 

在 httpd.conf 文件中 

# Virtual hosts  虚拟主机

Include conf/extra/httpd-vhosts.conf

2、在httpd-vhosts.conf文件中做配置


#配置我们自己的虚拟主机

    DocumentRoot "d:/myblog"
    #这里配置欢迎首页面 
    DirectoryIndex index.html index.htm index.php
   
    Options FollowSymLinks
    #不许可别人修改我们的页面
    AllowOverride None
    #设置访问权限
    Order allow,deny
    Allow from all
   

php.ini中的相关配置:

开启支持Mysql

extension="php_mysql.dll"

extension="php_mysqli.dll"

开启支持会图库

extension=php_gd2.dll 

设置默认时区

date.timezone = Asia/Shanghai

使用socket

extension=php_sockets.dll

使用php扩展功能

extension=php_exif.dll

使用 ?>标记

short_open_tag = Off/On

不提示Notic信息

error_reporting = E_ALL & ~E_NOTICE

以上就介绍了php与apache的集成、配置虚拟目录、配置虚拟主机,包括了方面的内容,希望对PHP教程有兴趣的朋友有所帮助。

Verwandte Etiketten:
Quelle:php.cn
Erklärung dieser Website
Der Inhalt dieses Artikels wird freiwillig von Internetnutzern beigesteuert und das Urheberrecht liegt beim ursprünglichen Autor. Diese Website übernimmt keine entsprechende rechtliche Verantwortung. Wenn Sie Inhalte finden, bei denen der Verdacht eines Plagiats oder einer Rechtsverletzung besteht, wenden Sie sich bitte an admin@php.cn
Beliebte Tutorials
Mehr>
Neueste Downloads
Mehr>
Web-Effekte
Quellcode der Website
Website-Materialien
Frontend-Vorlage
Über uns Haftungsausschluss Sitemap
Chinesische PHP-Website:Online-PHP-Schulung für das Gemeinwohl,Helfen Sie PHP-Lernenden, sich schnell weiterzuentwickeln!