Home > Article > Backend Development > A brief introduction to building apache php mysql development environment under win7, win7apache_PHP tutorial
Environment directory: E:dev
1. Apache
Download address: http://www.apachelounge.com/download/
We download the VC11 runtime library
1. Installation instructions:
Run the apache installation program. The method is very simple. After popping up the installation interface, keep "next"
An interface will then appear, requiring you to fill in 3 fields: Network Domain, Server Name, and Administrator's Email Address. Just fill in whatever you want without affecting the content.
There are 2 options below. The default selection is port 80, and the second one is port 8080. You can choose it according to your personal needs. Generally, the default port is 80.
Let’s continue the installation, select Custom (custom installation)-“next”
There is a component with a red Installed on local hard drive". -"next"
Then select "change" in the lower right corner to change the installation path and install it into the directory just created "D:WAMPApache"-"next"
After the installation is completed, there will be an additional icon in the lower right corner of the computer. Double-click to open it, select start or restart, and it will run normally. The installation is now complete.
2. Modify configuration:
Open the installation record and download the D:WAMPApacheconfhttpd.conf file (it is not recommended to use Notepad when modifying the configuration file, as it may affect it. It is recommended to use Notepad or other editing software to open and modify)
Ctrl F after opening to find the content you want to modify
Add under #LoadModule vhost_alias_module modules/mod_vhost_alias.so:
LoadModule php5_module “D:/WAMP/PHP/php5apache2_2.dll” PHPIniDir “D:/WAMP/PHP” AddType application/x-httpd-php .php AddType application/x-httpd-php .htm AddType application/x-httpd-php .html DocumentRoot “E:/WAMP/Apache/htdocs”
Modify to (the path here is the same as the wwwroot directory in IIS, used to store web pages, customized or not modified by default): DocumentRoot "D:/WAMP/www"
Modify to (customized or default without modification):
DirectoryIndex index.html
Modify to: DirectoryIndex index.php default.php index.html index.htm default.html default.htm
2. PHP
Download address: http://windows.php.net/download
The latest version is PHP 5.6.11
1. Architecture X86 and X64
2. Safety mode Thread Safe (thread safety) Non Thread Safe (non-thread safety)
Select Thread Safe for apache and Non Thread Safe for IIS
3. Runtime library, VC11
I am Win7 64-bit, so I choose VC11 x64 Thread Safe (2015-Jul-10 06:25:47)
1. Installation instructions
Since we downloaded the ZIP package, we only need to extract the file to the "D:WAMPPHP" directory
2. Modify configuration
Modify the D:WAMPPHPphp.ini-development file to php.ini
Open php.ini
; extension_dir = “ext”
Modify to: extension_dir = “E:WAMPPHPext”
Remove the ";" in front of these files on line 947
extension=php_curl.dll
extension=php_gd2.dll
extension=php_mbstring.dll
extension=php_mysql.dll
extension=php_mysqli.dll
extension=php_pdo_mysql.dll
extension=php_xmlrpc.dll
; date.timezone =
Modify it to (many websites do not mention that it needs to be modified here, and the default is US time. If not modified, an error will be reported): date.timezone = Asia/Shanghai
3. MySQL
Installation method:
1. .msi MSI Installer http://dev.mysql.com/downloads/installer/
2. Unzip and install http://dev.mysql.com/downloads/mysql/
1. Installation instructions:
Open the installer and click "next"
Select custom, the component is the default selection, we will not make any changes - "next"
The path is set to "D:WAMPMysql"-"next"
After installation, click "finish"
A configuration wizard will appear - "next"
Select "Detailed Configuration" - "next"
There are 3 options here:
Developer Machine will use as little memory as possible;
Server Machine, will use a medium amount of memory;
Dedicated MySQL Server Machine, this server only runs the mysql database and will occupy all the memory.
You can choose according to your own needs. Here we choose the second type of "Server Machine" - "next"
Select the database purpose, there are also 3 options:
Mutltifunctional Database is multifunctional and will optimize the database into a good innodb storage type and an efficient myisam storage type;
Transactional Database Only is only used for transaction processing types, the best optimization for innodb, but also supports myisam;
Non-Transactional Databse Only non-transaction processing type, suitable for simple applications, only the myisam type that does not support transactions is supported.
Generally choose the first multi-functional one, and we do the same. -"next"
Select the data storage location of InnodDB. Generally, the default is fine. For the sake of unification, I filled in "WAMP/MySQL Datafiles"-"next"
Choose the maximum number of connections allowed by mysql. The first is a maximum of 20 concurrent connections, the second is a maximum of 500 concurrent connections, and the last is custom. You can choose according to your needs. I choose the second - "next"
The following is the port for selecting the database listening port. Generally, the default is 3306. If it is changed to another port, you must remember the modified port when connecting to the database in the future. Otherwise, you cannot connect to the mysql database, which is more troublesome. No modifications are made here. Use The default port of mysq: 3306-"next"
This step sets the default encoding of mysql. We choose the third one, and in the Character Set menu, select "gbk" encoding-"next"
(Note: If you want to use data from the original database, it is best to determine what encoding the original database uses. If the encoding set here is inconsistent with the encoding of the original database data, garbled characters may appear when using it.)
This step is whether to set mysql to windows. Generally, it is set to a service, so that the mysql database can be started and closed through the service in the future. The checkbox below is also checked, so that in cmd mode, there is no need to go to the bin directory of mysql to execute the command. That is to say, check both the upper and lower boxes, and the middle one defaults to "next"
This step is to set the super user password of mysql. This super user is very important and has all the permissions on mysql. Please set and remember the super user password. There is a checkbox below to select whether to allow the remote machine to use root. Users connect to your mysql server. If you have this requirement, please also check it. Here we use the default selection and enter the password in New root password and Confirm. “next”
Click "execute" to configure, wait for a while, and all the check marks on the dots are marked, which means the configuration is complete.
2. Modify configuration:
Open D:WAMPMySQLmy.ini
Set datadir to D:/WAMP/MySQL/data/ or the directory where you want to store the data.
4. Memcached
Download address: http://blog.couchbase.com/memcached-windows-64-bit-pre-release-available
Directory: dev/memcached
Installation: Execute from the command line E:devmemcachedmemcached.exe -d install
Start: E:devmemcachedmemcached.exe -d start
php memcache extension download: http://pecl.php.net/package/memcache
php.ini opens the extension extension=php_memcache.dll
5. Redis and PHP redis extension
redis download address: https://github.com/MSOpenTech/redis/releases
php redis extension download address: http://pecl.php.net/package/redis
Put the downloaded php_redis.dll into the php extension directory ext, and then open it in php.ini
6. Ending
Now the PHP environment under Windows 7 has been set up. Let’s use it to your heart’s content.