build a Web server environment ( Configure PHP 's working environment);
to Configure PHP first, configure the httpd.conf in the Apache configuration folder .
1 Configuring php as a function module for Apache
LoadModule php5_module "F:\class22\amp\php\php5apache2_2.dll"
2. php suffix file assigned to PHP function Module processing
AddType apalication/x-httpd-php. php
3, determine the path of PHP configuration file php.ini
Phpinidir "F:\class22\amp\php"
4. Confirm Time Zone
in the DATE.TIMEZONE=PRC in php.ini in PHP configuration folder
then configure the php mysql database extension ( that is, to configure PHP as a mysql client)
1, Find the extension=php_mysql.dllin php.ini, remove the previous comment
2.then specify the extension directory, extension_dir = "F:\class22\amp\php\ext"
Note:1,php is both A functional module of Apache is also A client of MySQL
2, the operation of Apache under CMD has the following command line
A.httdp-k start opens Apache
B.httpd-k stop off Apache
C.httpd-t The Apache configuration file for syntax checking
D.httpd-m See what feature modules are loaded by Apache
3, MySQL is a c/S structure, any operation of MySQL software is to play the role of the client;
4. Four steps to operate a database:
A. establishing connections and certifications
B. Send operation Instructions
C. returning processing results
D. disconnecting
Configuring a virtual host ( principle: access to different sites through different domain names )
the information for configuring a virtual host is: domain + virtual directory (site)+ Port + permissions ( Configure index page, presentation list )
1. Loadthe Virtual Host configuration file in the master configuration folder of Apache
Include conf/extra/httpd-vhosts.conf
2. Create a virtual host in the configuration file of the virtual host;<virtualhost *:80> </VirtualHost> to represent a single virtual host
<virtualhost *:80>
ServerName www.wwr.com
DocumentRoot "F:\class22\zuoye"
<directory "F:\class22\zuoye" >
Allow from all
DirectoryIndex index.html// Set default index page
Options Indexes// set up a display list
AllowOverride All// set up distributed files in this directory
</Directory>
</VirtualHost>
Set up a distributed profile (why do you want to set it?) For example: we sometimes have some development site files do not want to give users access to! )
1. Use the allowoverride all instruction in the master profile to specify which directory can use the distributed configuration file:
is to set the virtual host's <directory>allowoverride all</directory>
2. then add a . htaccess file to the folder you want to set up, and write the relevant code in it, such as: Set the Forbidden access permission,Deny from all;
features: No need to restart Apache, the distributed configuration system is valid for the current directory and subdirectories under the current directory
Building a Web server environment