PHP mobile internet development (1 )?? Environment setup and configuration

Source: Internet
Author: User
PHP mobile internet development (1 )?? Environment setup and Configuration 1. basic process of PHP5.4 environment configuration

Apache: Web service provider. Official website:

PHP: official website:

Mysql: official website:

2. software download




III. environment construction

(1) install Apache

Installed successfully

(2) decompress PHP5.4

(3) configure the httpd. conf file of Apache

Apache installation directory

  1. ServerRoot "D:/Apache Software Foundation"

Listening port

  1. # Listen 80

  1. Listen 80

Load PHP components

  1. LoadModule php5_module "D:/php54/php5apache2_2.dll"

Server Name

  1. # ServerName 80

File root directory

  1. DocumentRoot "D:/Apache Software Foundation/htdocs"

Permission folder

Index (home page accessed by default)

  1. DirectoryIndex index.html

Error log

  1. ErrorLog "logs/error. log"

Access Log

  1. CustomLog "logs/access. log" common

Configuration parsing php

  1. AddType application/x-compress. Z
  2. AddType application/x-gzip. gz. tgz
  3. AddType application/x-httpd-php. php

Error Type

  1. # ErrorDocument 500 "The server made a boo ."
  2. # ErrorDocument 404/missing.html
  3. # ErrorDocument 404 "/cgi-bin/"
  4. # ErrorDocument 402 _

IV. test whether the building is successful

Create a. php

  1. Phpinfo ();
  2. ?>

The php configuration file cannot be found. in the apache configuration file, specify the php configuration file directory.

  1. PHPIniDir "D:/php54"

5. configure multi-site access

  1. # Virtual hosts
  2. Include conf/extra/httpd-vhosts.conf

Remove the comment above (open the VM configuration file)

Two sites are configured in the httpd-vhosts.conf as follows

  1. DocumentRoot "D:/Apache Software Foundation/a_com"
  2. ServerName
  3. ServerAlias
  4. ErrorLog "log/"
  5. CustomLog "logs/" common
  6. DocumentRoot "D:/Apache Software Foundation/B _com"
  7. ServerName
  8. ErrorLog "log/"
  9. CustomLog "logs/" common

Note: Once the virtual host is configured, the configured DocumentRoot is invalid.

D: \ Apache Software Foundation \ a_com \ a. php

  1. Echo "aaaaaa ";
  2. ?>

D: \ Apache Software Foundation \ B _com \ B. php

  1. Echo "bbbbbb ";
  2. ?>

Note: You must modify the permission folder directory.

Access results:

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: 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.