Environment configuration (window + Apache + Php)

Source: Internet
Author: User

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: <? Php phpinfo ();?>

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.