PHP mobile Internet Development Notes (1) Environment setup and Configuration

Source: Internet
Author: User
Note: I remember the first time I heard about PHP when I was a sophomore. I only knew that it was a language for a development website and did not study it in depth, after learning Java Web development and Android development, I have a personal understanding of the development direction of the Internet. Now we cannot separate the Internet from mobile development, these two things have been integrated into one, mobile

Note: I remember the first time I heard about PHP when I was a sophomore. I only knew that it was a language for a development website and did not study it in depth, after learning Java Web development and Android development, I have a personal understanding of the development direction of the Internet. Now we cannot separate the Internet from mobile development, these two things have been integrated into one, mobile

Note: I remember the first time I heard about PHP when I was a sophomore. I only knew that it was a language for a development website and did not study it in depth, after learning Java Web development and Android development, I have a personal understanding of the development direction of the Internet. Now we cannot separate the Internet from mobile development, these two things have been integrated into one, and the mobile B/s architecture has become the current trend. Therefore, we need to use a lightweight website development tool, after php5.x came out, I had a great deal of support for this part. I personally think mobile development is at least inseparable from php now, if you are interested or want to learn php, we can study php together.

I. Basic Process of PHP5.4 environment Configuration

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

ServerRoot "D:/Apache Software Foundation"

Listening port

#Listen 12.34.56.78:80
Listen 80

Load PHP Components

LoadModule php5_module "D:/php54/php5apache2_2.dll"
Server Name
#ServerName www.meritit.com:80
File root directory
DocumentRoot "D:/Apache Software Foundation/htdocs"
Permission folder
  

Index (home page accessed by default)
  
       DirectoryIndex index.html
  
Error Log
ErrorLog "logs/error.log"

Access log
CustomLog "logs/access.log" common

Configuration parsing php
    AddType application/x-compress .Z    AddType application/x-gzip .gz .tgz    AddType application/x-httpd-php .php

Error Type
#ErrorDocument 500 "The server made a boo boo."#ErrorDocument 404 /missing.html#ErrorDocument 404 "/cgi-bin/missing_handler.pl"#ErrorDocument 402 http://www.meritit.com/subscription_

Iv. test whether the building is successful

Create a. php

  

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

PHPIniDir "D:/php54"


5. Configure multi-site access

# Virtual hostsInclude 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

  
       DocumentRoot "D:/Apache Software Foundation/a_com"    ServerName 127.0.0.2    ServerAlias www.dummy-host.meritit.com    ErrorLog "logs/dummy-host.meritit.com-error.log"    CustomLog "logs/dummy-host.meritit.com-access.log" common
  
  
       DocumentRoot "D:/Apache Software Foundation/b_com"    ServerName 127.0.0.3    ErrorLog "logs/dummy-host2.meritit.com-error.log"    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

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

Note: You must modify the permission folder directory.

Access results:


Note: I will not introduce mysql installation here.



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.