search
HomeBackend DevelopmentPHP TutorialA brief introduction to building apache php mysql development environment under win7, win7apache_PHP tutorial

A brief introduction to building apache php mysql development environment under win7, win7apache

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.

www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/1044257.htmlTechArticleA brief introduction to building apache php mysql development environment under win7, win7apache environment directory: E:dev 1. Apache download address: http://www.apachelounge.com/download/ We download the VC11 runtime library...
Statement
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
PHP Email: Step-by-Step Sending GuidePHP Email: Step-by-Step Sending GuideMay 09, 2025 am 12:14 AM

PHPisusedforsendingemailsduetoitsintegrationwithservermailservicesandexternalSMTPproviders,automatingnotificationsandmarketingcampaigns.1)SetupyourPHPenvironmentwithawebserverandPHP,ensuringthemailfunctionisenabled.2)UseabasicscriptwithPHP'smailfunct

How to Send Email via PHP: Examples & CodeHow to Send Email via PHP: Examples & CodeMay 09, 2025 am 12:13 AM

The best way to send emails is to use the PHPMailer library. 1) Using the mail() function is simple but unreliable, which may cause emails to enter spam or cannot be delivered. 2) PHPMailer provides better control and reliability, and supports HTML mail, attachments and SMTP authentication. 3) Make sure SMTP settings are configured correctly and encryption (such as STARTTLS or SSL/TLS) is used to enhance security. 4) For large amounts of emails, consider using a mail queue system to optimize performance.

Advanced PHP Email: Custom Headers & FeaturesAdvanced PHP Email: Custom Headers & FeaturesMay 09, 2025 am 12:13 AM

CustomheadersandadvancedfeaturesinPHPemailenhancefunctionalityandreliability.1)Customheadersaddmetadatafortrackingandcategorization.2)HTMLemailsallowformattingandinteractivity.3)AttachmentscanbesentusinglibrarieslikePHPMailer.4)SMTPauthenticationimpr

Guide to Sending Emails with PHP & SMTPGuide to Sending Emails with PHP & SMTPMay 09, 2025 am 12:06 AM

Sending mail using PHP and SMTP can be achieved through the PHPMailer library. 1) Install and configure PHPMailer, 2) Set SMTP server details, 3) Define the email content, 4) Send emails and handle errors. Use this method to ensure the reliability and security of emails.

What is the best way to send an email using PHP?What is the best way to send an email using PHP?May 08, 2025 am 12:21 AM

ThebestapproachforsendingemailsinPHPisusingthePHPMailerlibraryduetoitsreliability,featurerichness,andeaseofuse.PHPMailersupportsSMTP,providesdetailederrorhandling,allowssendingHTMLandplaintextemails,supportsattachments,andenhancessecurity.Foroptimalu

Best Practices for Dependency Injection in PHPBest Practices for Dependency Injection in PHPMay 08, 2025 am 12:21 AM

The reason for using Dependency Injection (DI) is that it promotes loose coupling, testability, and maintainability of the code. 1) Use constructor to inject dependencies, 2) Avoid using service locators, 3) Use dependency injection containers to manage dependencies, 4) Improve testability through injecting dependencies, 5) Avoid over-injection dependencies, 6) Consider the impact of DI on performance.

PHP performance tuning tips and tricksPHP performance tuning tips and tricksMay 08, 2025 am 12:20 AM

PHPperformancetuningiscrucialbecauseitenhancesspeedandefficiency,whicharevitalforwebapplications.1)CachingwithAPCureducesdatabaseloadandimprovesresponsetimes.2)Optimizingdatabasequeriesbyselectingnecessarycolumnsandusingindexingspeedsupdataretrieval.

PHP Email Security: Best Practices for Sending EmailsPHP Email Security: Best Practices for Sending EmailsMay 08, 2025 am 12:16 AM

ThebestpracticesforsendingemailssecurelyinPHPinclude:1)UsingsecureconfigurationswithSMTPandSTARTTLSencryption,2)Validatingandsanitizinginputstopreventinjectionattacks,3)EncryptingsensitivedatawithinemailsusingOpenSSL,4)Properlyhandlingemailheaderstoa

See all articles

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Tools

DVWA

DVWA

Damn Vulnerable Web App (DVWA) is a PHP/MySQL web application that is very vulnerable. Its main goals are to be an aid for security professionals to test their skills and tools in a legal environment, to help web developers better understand the process of securing web applications, and to help teachers/students teach/learn in a classroom environment Web application security. The goal of DVWA is to practice some of the most common web vulnerabilities through a simple and straightforward interface, with varying degrees of difficulty. Please note that this software

SublimeText3 English version

SublimeText3 English version

Recommended: Win version, supports code prompts!

Atom editor mac version download

Atom editor mac version download

The most popular open source editor

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

Safe Exam Browser

Safe Exam Browser

Safe Exam Browser is a secure browser environment for taking online exams securely. This software turns any computer into a secure workstation. It controls access to any utility and prevents students from using unauthorized resources.