Home>Article>Backend Development> Integration of php and apache, configuration of virtual directories, and configuration of virtual hosts
1. Add
LoadModule php5_module "D:/appserv/php/php5apache2_2.dll"
PHPIniDir "D: /appserv/php"
AddType application/x-httpd-php .php .phtml
2. Change the php.in-development file to php.ini
3. In php.ini You can specify the corresponding function module
Here we specify the extension library path of php
extension_dir = ".../php-5.3.5/ext"
Configure the virtual directory:
#direcotory is equivalent to the welcome page
DirectoryIndex index.html index.htm index.php
#Your site alias
Alias /myblog "D:/myblog"
#This is the access permission setting
Order allow,deny
Allow from all
Log out documentroot path #DocumentRoot
The steps to configure a virtual host are as follows :
1. Enable httpd-vhosts.conf
in the httpd.conf file
# Virtual hosts Virtual hosts
Include conf/extra/httpd-vhosts.conf
2. Make configuration in the httpd-vhosts.conf file
Relevant configuration in php.ini:
Enable support for Mysql
extension="php_mysql.dll"
extension="php_mysqli.dll"
Open the support gallery
extension=php_gd2.dll
Set the default time zone
date.timezone = Asia/Shanghai
Use socket
extension=php_sockets.dll
Use php extension function
extension=php_exif.dll
Use tag
short_open_tag = Off/On
Do not prompt Notic information
error_reporting = E_ALL & ~E_NOTICE
The above has introduced the integration of PHP and Apache, configuring virtual directories, and configuring virtual hosts, including all aspects. I hope it will be helpful to friends who are interested in PHP tutorials.