PHP mobile internet development (1) -- environment setup and configuration _ PHP Tutorial

Source: Internet
Author: User
PHP mobile internet development (1)-Environment setup and configuration. I. basic process of PHP5.4 environment configuration Apache: Web service provider. Official website: www. apache. orgPHP: official website: www. php. netMysql: official website: www.mysql.com 2. download Apache: 1. basic process of PHP5.4 environment matching

Apache: Web service provider. Official website: www.apache.org

PHP: official website: www.php.net

Mysql: official website: www.mysql.com

2. software download

Apache: http://download.csdn.net/detail/lxq_xsyu/7057423

PHP: http://download.csdn.net/detail/lxq_xsyu/7057401

Mysql: http://download.csdn.net/detail/lxq_xsyu/6468461

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 12.34.56.78: 80

  1. Listen 80

Load PHP components

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

  1. # ServerName www.meritit.com: 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/missing_handler.pl"
  4. # ErrorDocument 402 http://www.meritit.com/subscription _

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 127.0.0.2
  3. ServerAlias www.dummy-host.meritit.com
  4. ErrorLog "log/dummy-host.meritit.com-error.log"
  5. CustomLog "logs/dummy-host.meritit.com-access.log" common
  6. DocumentRoot "D:/Apache Software Foundation/B _com"
  7. ServerName 127.0.0.3
  8. ErrorLog "log/dummy-host2.meritit.com-error.log"
  9. CustomLog "logs/dummy-host2.meritit.com-access.log" 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:


Apache: Web service provider. Official website: www.apache.org PHP: official website: www.php.net Mysql: official website: www.mysql.com 2. download Apache :...

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.