from (http://www.cnblogs.com/yuan-yifan/archive/2012/05/06/2486556.html)Environment Configuration (window+apache+php)
If the configuration has forgotten, then follow the red Word Guide Oh ~
If you hate to configure the environment this kind of work friends, hehe, search "XAMPP" Bar ~ installation package everything!
Ok, want to know it, and know why, continue .
I. download Apache(msi version)
A. network domain, server, administrator settings, not sure to feel free ~ Remember Oh (this information can be modified in the httpd.conf)
B. Install, open the Conf file in the Apache directory, find the Httpd.cong, 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: Loads the module that handles PHP.
Ø Add code at AddType application/x-gzip. GZ tgz
AddType application/x-httpd-php. php
AddType application/x-httpd-source.php
Effect: Add a 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: Supports Libmcrypt and Libmtsql
Ø Add the following code at the end of the file
Phpinidir "x:/php"
Effect: Set the php.ini file directory
Ø Note: Only for the file directory "\" and "/" of the distinction ~
General quotes Inside is/
Outside the quotation marks are \
Ø There are a few other instructions in the following
II. download PHP
A. The php.ini-xxxxxxxxx in the PHP directory is changed to PHP.ini (some settings are described in detail later)
B. Setting up an extension file directory
I. Find extension_dir= "./"---change to extension_dir= "X:/php/ext"
C. Open some of the common extensions
Extension=php_gd2.dll
Effect: Support GD drawing function
Extension=php_mbstring.dll
Extension=php_mcrypt.dll
Extension=php_mysql.dll
Effect: Support MySQL Database
Extension=php_mysqli.dll
D. Adding environment variables
Add "X:\php" in Path
III. Running PHP:
A. Start the Apache server ~
B. Build the phpinfo.php file under Apache's Htdocs folder
C. Write the following code: <?php phpinfo ();?>
Iv. Precautions :
A. The Apache configuration file is only invoked at startup, so it must be restarted after the modification.
B. Apache does not start normally because of a problem with the configuration file, it is common to have illegal characters
C. httpd.conf file does not indicate that you can support. html, do not embed PHP code in HTML
D. Experience yourself!! The 8080 port is not occupied by other services, otherwise the server will not be generated by default.
Some configuration additions to Apache
• Important Parameters
A. ServerRoot "X:/apache"//Software Installation location
B. Pidfile logs/httpd.pid//The process number file location of the parent process
C. listen:8080//Port number
D. ServerName//Main station name
E. ServerAdmin//Admin Email address
F. DocumentRoot "/.../web/"//primary site where the page is stored
G. DirectoryIndex index.html index.php index.htm//home file Settings
• Several instructions
A. x:\apache2.2\bin> httpd-k install-n Apachename
Create a Apachename service named
B. x:\apache2.2\bin> httpd-k uninstall-n Apachename
Remove the Apachename service named
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
About PHP Configuration directives
1. PHP.ini is a Php global configuration file
The act of controlling
Language Options Safe Mode syntax highlighting
Miscellaneous resources limit error handling and logging
Data processing path and catalog file upload
fopen wrapper Dynamic Expansion module setup
For Port-occupied conditions
1. The problem comes when it starts! The Service state is empty!
2. This indicates that there is no Apache service inside the service.
3. It is said that Emial is not admin, there will be no service---do not know the real fake, anyway the port is occupied there is a problem
4. Get the highest privileges first ~ (Control Panel-user account and Family Safety-system and security-Action Center-change user Account Control settings-changed to "Never Notify")
5. Restart
6. CMD input: cd/d X:\Apache2.2\bin go to the specified directory
7. Cmd execution: httpd.exe-k install-n apache2
8. Ok
Environment configuration (window+apache+php)