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
- 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 ."
- # 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
-
- Phpinfo ();
- ?>
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 hosts
- 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
-
- DocumentRoot "D:/Apache Software Foundation/a_com"
- ServerName 127.0.0.2
- ServerAlias www.dummy-host.meritit.com
- ErrorLog "log/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 "log/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
-
- Echo "aaaaaa ";
- ?>
D: \ Apache Software Foundation \ B _com \ B. php
-
- Echo "bbbbbb ";
- ?>
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 :...