Table of Contents
1 to build a PHP development environment
Use wampserve, the Download Select Download the latest version, the default installation
2 default configuration simple instructions
- Installation path: C: \ wamp64
- Project root directory C: \ wamp64 \ www
- Installed Components C: \ wamp64 \ bin
3 Use Web Hosting
Configure the need to restart the service (simple restart all get away)
3.1 modify the Apache configuration
Edit C: \ wamp64 \ bin \ apache \ apache2.4.41 \ conf \ extra \ httpd-vhosts.conf (like the original all commented)
# The first site is the default site <VirtualHost *: 80> # domain name ServerName localhost # file directory DocumentRoot "$ {INSTALL_DIR} / the WWW" # rights profile <Directory "$ {INSTALL_DIR} / the WWW" > # allowed to list directories Options the Indexes # cover allows the AllowOverride All # allow access to all the Require granted All </ Directory> # default file (home) the DirectoryIndex the index.php index.html </ VirtualHost> <VirtualHost *: 80> ServerName www.from the DocumentRoot "$ {INSTALL_DIR} / WWW / from " <Directory " $ {INSTALL_DIR} / WWW / from " > Options Indexes AllowOverride All Require all granted </Directory> DirectoryIndex index.html index.php </VirtualHost>
3.2 Configuring native DNS
Edit C: / Windows / System32 / drivers / etc / hosts, add the following
127.0.0.1 www.from 127.0.0.1 www.to 127.0.0.1 www.test
4 Some configuration instructions
4.1 Apache
4.1.1 Profile Path
C:\wamp64\bin\apache\apache2.4.41\conf\httpd.conf
4.1.2 installation path
C:\wamp64\bin\apache\apache2.4.41
4.1.3 Installation Services
C:\wamp64\bin\apache\apache2.4.41\bin\httpd.exe -k install
4.1.4 Uninstall Service
C:\wamp64\bin\apache\apache2.4.41\bin\httpd.exe -k uninstall
4.1.5 Test configuration syntax
C:\wamp64\bin\apache\apache2.4.41\bin\httpd.exe -t
4.1.6 Start / Stop service mode
- Control Panel: Run C: \ wamp64 \ bin \ apache \ apache2.4.41 \ bin \ ApacheMonitor.exe, the prompts panel
- Use the Windows system management services
- Command: net start | stop Apache2.4 (service name to be consistent)
4.2 PHP
4.2.1 suffix configuration file path, enabling module settings file
Modify the Apache configuration file (keyword search, the Notes will remove comments, not to add)
PHPIniDir "C:/wamp64/bin/apache/apache2.4.41/bin" LoadModule php7_module "C:/wamp64/bin/php/php7.3.12/php7apache2_4.dll" AddType application/x-httpd-php .php
4.2.2 Profile
- Development Configuration: C: \ wamp64 \ bin \ php \ php7.3.12 \ php.ini-development
- Product Configuration: C: \ wamp64 \ bin \ php \ php7.3.12 \ php.ini-production
4.2.3 correction time zone
Change setting
date.timezone ="PRC"
4.3 Database
4.3.1 setting module path, enabling module
Changing PHP configuration file (annotated removed, it is not added)
; On windows: extension_dir ="c:/wamp64/bin/php/php7.3.12/ext/" extension=mysqli extension=pdo_mysql
4.3.2 install mysql recommend (to replace the version of the word)
Installation path and database data storage path in the same path
5 Some tests
5.1 Time Correctness
echo date("Y-m-d H:i:s");
5.2 PHP environment
You can see version, directory, configuration information
phpinfo();
5.3 Database Connectivity
if (mysqli_connect('127.0.0.1', 'root', '')) { echo '<h1>ok</h1>'; } else { echo '<h1>boom</h1>'; }
Created: 2019-12-25 Wednesday 22:06