Environment configuration (window + Apache + Php) if you forget the configuration, do you keep up with the red letter guide ~ If you hate environment configuration, search & quot; XAMPP & quot ~ Everything in the installation package! OK. if you want to know about it and know why, continue. I. download Apache (msi) a. network domain,... Sy
Environment configuration (window + Apache + Php)
If you forget the configuration, follow the red-letter Guide ~
If you hate environment configuration, search for "XAMPP ~ Everything in the installation package!
OK. if you want to know it, and know why, continue.
I. download Apache (msi)
A. set the network domain, server, and administrator. if you are not sure about the settings, do whatever you want ~ Remember (this information can be modified in httpd. conf)
B. install it. open the conf file in the apache Directory, find httpd. cong, and add support for the PHP module.
Add code under # LocalMoudle vhost_alias_moudle moudle/mod_vhost_alias.so
LoadMoudle php5_moudle X:/php/php5apache2_2.dll
Effect: load the PHP processing module.
Add code to AddType application/x-gzip. gz. tgz
AddType application/x-httpd-php. php
AddType application/x-httpd-source.php
Effect: add the MIME type that can recognize PHP
Add the following code at the end of the file
LoadFile X: \ php \ libmcrypt. dll
LoadFile X: \ php \ libmysql. dll
Effect: libmcrypt and libmtsql are supported.
Add the following code at the end of the file
PHPIniDir "X:/php"
Effect: set the Directory of the php. ini file.
Note: Only differentiate the file directories "\" and ~
The quotation mark is/
The quotation mark is \
Some other instructions will be introduced later
II. Download PHP
Change php. ini-xxxxxxxxx in the. php directory to php. ini (some settings will be detailed later)
B. set the extended file directory
I. find extension_dir = "./" --- change extension_dir = "X:/php/ext"
C. start some common extensions
Extension = php_gd2.dll
Effect: GD plotting functions are supported.
Extension = php_mbstring.dll
Extension = php_mcrypt.dll
Extension = php_mysql.dll
Effect: MySQL databases are supported.
Extension = php_mysqli.dll
D. add environment variables
Add "X: \ php" in Path"
III. run PHP:
A. Start the Apache server ~
B. create the phpinfo. php file in the htdocs folder of apache.
C. write the following code:
IV. notes:
A. The Apache configuration file is called only at startup, so you must restart it after modification.
B. Apache cannot be started. it is generally because of configuration file problems. it is common that there are invalid characters.
C. When the httpd.conf file does not indicate that .html can be supported, do not embed php code in html.
D. experience it yourself !! Port 8080 must not be occupied by other services; otherwise, the server cannot be generated by default.
Some configuration supplements for Apache
• Important parameters
A. ServerRoot "X:/apache" // software installation location
B. PidFile logs/httpd. pid // The location of the parent process ID File
C. Listen: 8080 // port number
D. ServerName // master site name
E. ServerAdmin // administrator email address
F. DocumentRoot "/... /Web/"// The webpage storage location of the main site
G. DirectoryIndex index.html index. php index.htm // Set the homepage file
• Several commands
A. X: \ Apache2.2 \ bin> httpd-k install-n ApacheName
Create an ApacheName service
B. X: \ Apache2.2 \ bin> httpd-k uninstall-n ApacheName
Delete the ApacheName service
C. X: \ Apache2.2 \ bin> httpd-n ApacheName-t
Check configuration file correctness
D. X: \ Apache2.2 \ bin> httpd-k start/stop/shutdown/restart
Basic operations
PHP configuration instructions
1. Php. ini is the global configuration file of php.
Controlled behavior
Security mode syntax highlighted for language options
Miscellaneous resource restriction error handling and logs
Data processing path and directory file Upload
Fopen package dynamic expansion module settings
Port count
1. a problem occurred during startup! Service State is empty!
2. this indicates that there is no apache service in the service.
3. it is said that emial is not admin, so there will be no service-I don't know if it is false, and there will be problems if the port is occupied anyway.
4. obtain the highest permission first ~ (Control panel-user account and home security-system and security-Operations Center-Change User Account Control settings-change to "never notice ")
5. restart
6. input cd/d X: \ Apache2.2 \ bin in cmd to the specified directory.
7. run the following command in cmd: httpd.exe-k install-n apache2.
8. OK
From matter605924657