The first thing to understand is the relationship between Apache, PHP, and MySQL. On the call relationship, as shown in. Apache, as a server, calls the PHP module to process php files, while PHP processes the relevant data with MySQL by extension.
In fact, the so-called configuration environment is the Apache call php and PHP extension MySQL process.
1, Apache call PHP. (Apache is the equivalent of a boss who needs to recruit employees with various abilities to get the job done)
1), in the Apache configuration file, the PHP module (php5_module) loaded into Apache (PHP equivalent to be recruited by Apache staff)
LoadModule php5_module "D:/wamp/php/php5apache2_2.dll"
2), with the staff, of course, to assign tasks to the staff, that is, the PHP file in Apache to the PHP parsing engine processing
3), the last to load the PHP configuration file in the Apache configuration file
Add php.ini to the corresponding folder
4), modify the time zone. Due to the unstable system time, the corresponding time zone information should be modified in the Apache configuration file.
2. php extension MySQL
In fact, it is divided into two steps: A, to open the MySQL extension php function; b, tell PHP where to find the extension file
1), open the MySQL extension function of PHP
2), tell PHP in which directory you can find the extension file
3, the configuration of the virtual host
The so-called virtual host, is actually a folder on your computer with a specific domain name. There are two main parts: Domain name and folder path.
1), first load the configuration file of the virtual host in the Apache configuration file (because the configuration file of the virtual host is not loaded by default in the Apache configuration file)
2), create a virtual host in the virtual host configuration file
3), configure the local browser-side domain name resolution
4. Directory Access rights
In the Apache configuration file, all other directories are denied access by default, except for directories that have access permissions set separately. Also say, when you configure the virtual host, you must give the corresponding folder access rights. Therefore, we generally put the configuration of access to the instruction segment and the configuration of the virtual host together to facilitate management. Such as:
When you set permissions on a directory, we find that sometimes access to the directory does not have the desired result, which is related to the order in which the directories are accessed. For example, when we access a directory, we take two steps.
There are two questions about the order of access to the directory, and when is the index page displayed? When do i show the table of contents? This is related to the two configuration DirectoryIndex and Options shown in.
The DirectoryIndex configuration is related to the index page. When we set up more than one index page, we retrieve it from left to right, and once we find it, it executes immediately.
Options are related to the list of display catalogs. When we set up this configuration, when we access the directory, if there is no index page, the contents of the accessed directory will be displayed as a list.
PHP Environment Setup