search
HomeBackend DevelopmentPHP TutorialPHP basics Installing Apache Mysql PHP in windows environment (picture)

PHPRunning environment: Three installation methods under

Linux: source code package installation, rpm package installation, integrated environment installation (lnmp)

Two ways to install windows: single download installation, integrated environment installation (AppServ, phpstudy, wamp)

Install PHP development environment on Windows system:

The required software is installed independently:

Preparation before installation

Install Apache

Installation MySQL

Install PHP

Install phpMyA


##Double-click httpd-2.2.21-win32-x86-no_ssl.msi to start the installation. The installation welcome screen appears.

Click "Next" directly to continue, and the authorization agreement will appear.

Select "I accept the terms in the license agreement" to agree to the license agreement, then click "Next" to continue, and the installation instructions will appear.

Click "Next" directly and the information filling interface will appear.

"Network Domain" fill in your network domain name, such as admin10000.com. If there is no network domain name, you can fill it in casually.

"Server Name" fill in your server name, such as www.admin10000.com, which is the host name. If not, feel free to fill it in.

"Administrator's Email Address" fill in the system administrator's contact email address, such as webmaster@admin10000.com. A contact email address will be provided to visitors in the event of a system outage.

Tip: Because we install apache mainly for development on this machine, just fill in localhost in the first two items. The above three items of information can be filled in arbitrarily, and these information can be modified in the httpd.conf file later.

There are two options below. The first is to install for all users of the system, using the default port 80, and automatically starting as a system service; the other is to install only for the current user, using port 8080, and manually start up. We choose the first one “for All Users, on Port 80, as a Service – Recommended”. Then click "Next" to continue.

The installation type selection interface appears. Typical is a typical installation, and Custom is a user-customized installation. We select Typical here and press "Next" to continue.

Click "Change..." to manually specify the installation directory. Here we installed Apache to "D:\Apache\", you decide where to install it. It is recommended not to install it on the disk where the operating system is located (usually the C drive), in case the operating system is damaged and the Apache configuration file will be cleared during the restore operation. After specifying the installation directory, click "Next" to continue.

Confirm that the installation options are correct and click "Install" to start the installation. If you think you want to check it again, you can click "Back" to return to the check step by step.

The installation progress will appear, wait for a while, and then the following interface will appear.

After clicking "Finish", an icon with a green logo will appear in the status bar in the lower right corner.

indicates that Apache has started normally.

At this time, enter http://localhost/ or http://127.0.0.1/ in the browser to see the following interface.

MYSQL installation:

Open the downloaded mysql installation file mysql-5.0.27-win32.zip, double-click to decompress it, Run "setup.exe", and the following interface will appear

Click "Next" to continue, and the authorization agreement will appear.

Select "I accept the terms in the license agreement" to agree to the license agreement, and then click "Next" to continue. In the window for selecting the installation type, there are "typical (default)", "Complete (complete)", " Custom (user-defined)" three options, we choose "Custom", because customization can make us more familiar with its installation process, which is very helpful for learning MySQL database. Click "next" to continue the installation, such as As shown in the picture:

Select the installation path of the mysql database in the custom installation interface. Here I set "d:\Program File\MySQL", click "Next" to continue the installation, as shown in the picture:

Next enter the interface to prepare for installation. First confirm the previous settings. If there is an error, press "back" Return, there is no error, click the "Install" button to continue the installation, as shown in the figure:

After clicking the "Install" button, the following installation interface appears. After a long time In a short time, the MySQL database installation is completed, and the interface to complete the MySQL installation appears, as shown in the figure:

Just click "next" on this interface.

Be sure to select the "Launch the MySQL Instance Configuration Wizard" option above. This is the configuration to start MySQL and is also the most critical. (can also be set later), click the "Finish" button to enter the configuration interface.

The installation of MySQL database is very simple. The key is the configuration after the installation is completed. After clicking Finish, the following configuration interface wizard will appear. Click "next" to configure, as shown in the figure:

#Select the configuration method in the opened configuration type window, "Detailed Configuration (manual precise configuration)", "Standard Configuration (standard configuration)", in order to familiarize yourself with the process, we select "Detailed Configuration (Manual precise configuration)", click "next" to continue, as shown in the figure:

In the window that appears, select the type of server, "Developer Machine Test Class)", "Server Machine (Server Type)", "Dedicated MySQL Server Machine (Specialized Database Server)", we are only used for learning and testing, the default is fine, click "next" to continue, as shown in the figure :

Select the purpose of the mysql database in the configuration interface that appears, "Multifunctional Database (universal multi-functional)", "Transactional Database Only (server type)", " Non-Transactional Database Only (non-transaction processing type)", here I choose the first item, universal installation, click "next" to continue the configuration, as shown in the figure:

In the interface that appears, configure the InnoDB Tablespace, which is to select a storage space for the InnoDB database file. If it is modified, remember the location. Select the same place when reinstalling, otherwise the database may be damaged. Damage, of course, it will be no problem to make a backup of the database, as shown in the figure:

In the page that opens, select the number of mysql visits and the number of simultaneous connections , "Decision Support (DSS)/OLAP (about 20)", "Online Transaction Processing (OLTP) (about 500)", "Manual Setting (manual setting, set to 15)" Select manual setting here, click " next" to continue, as shown in the figure:

Mysql starts the TCP/IP network by default, and the port number is 3306. If you do not want to use this port number, you can also change it through the drop-down list box, but you must ensure that the port number is not occupied. The Add filewall exception for this Port checkbox is used to register this port number on the firewall. Select this option here. The Enable Strict Mode checkbox is used to enable MYSQL standard mode, so that MYSQL will strictly check the input data. , minor grammatical errors are not allowed. It is not recommended for beginners to select this item to avoid trouble. I have checked it here. You can not select this option and click "next" to continue, as shown in the picture. Display:

In the character encoding page that opens, set the character encoding to be used by mysql. The first one is Western encoding, and the second one is multi-byte. Universal utf8 encoding, the third one is manual, we choose utf-8. If the encoding of UTF-8 is not selected here, garbled characters will appear when using JDBC to connect to the database. At that time, you need to add the following The code "useUnicode=true&characterEncoding=UTF-8" can solve the problem of garbled characters. For future convenience, it is set to UTF-8 encoding, but there is a problem, that is, when using which console to insert Chinese characters, an error will be reported. Query Tables with Chinese characters cannot display Chinese characters. Therefore, you need to set a system parameter "set names gbk" every time you enter MySQL to solve this problem. Then click "next" to continue the configuration, as shown in the figure. :

In the page that opens, choose whether to install mysql as a windows service, you can also specify the Service Name (service identification name), and whether to add the bin directory of mysql to Windows PATH (after adding it, you can directly use the files under bin without pointing out the directory name, such as connecting, "mysql –u username –p password;"), click "next" to continue the configuration, as shown in the figure:

In the page that opens, set whether you want to modify the password of the default root user (super administrator) (the default is empty), "New root password", if you want to modify it, Just fill in the new password here and enable the root remote access function. Do not create an anonymous user. Click "next" to continue the configuration, as shown in the figure:

To All configuration operations here have been completed. Click the Execute button to execute the configuration, as shown in the figure:

After a few minutes, the following prompt interface appears, which represents the MySQL configuration It has ended, and a successful message was prompted

Start the mysql database in the service, and enter "mysql –h localhost –u root -p in the command window. ” or “mysql -h localhost -uroot -p password”, then enter the user’s password in the prompt that appears, as shown in the figure:

PHP environment installation:

A. Install Apache

B. Install PHP (just unzip the compressed package to the corresponding location)

C. PHP configuration

Rename php.ini-dist to php.ini Modify 486 and

extension_dir = "D:/php-5.2.6/ext"

D, configure the Apache configuration file httpd.conf

#Load PHP module

LoadModule php5_module "D:/php-5.2.6/php5apache2_2.dll"

#The location of the PHP configuration file

PHPIniDir "D:/php-5.2.6"

#Which types of files will be processed by the PHP engine

AddType application/x-httpd-php .php

E , Restart Apache

Modify the httpd.conf configuration file

a) Modify line 177 to reset the document root directory

DocumentRoot "D:/ftp /Public/www"

b) Modify line 244 to set the website directory and document root directory to be consistent

c) Modify line 187 to set the website root directory access permissions

allow,deny

Allow from all

##

d) Modify line 240 to set the website default document (if the set html document does not exist, it will List all files in the root directory of the website)

DirectoryIndex abc.html

e) Restart apache service

PHP configuration

LoadModule php5_module "D:\Program Files (x86)\Apache Software Foundation\php5.2.6\php5apache2_2.dll"

PHPIniDir "D:\Program Files (x86)\Apache Software Foundation\php5.2.6"

AddType application/x-httpd-php .php

This way It's installed, it's quite simple, but there are a lot of steps.

The above is the detailed content of PHP basics Installing Apache Mysql PHP in windows environment (picture). For more information, please follow other related articles on the PHP Chinese website!

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
Explain the concept of a PHP session in simple terms.Explain the concept of a PHP session in simple terms.Apr 26, 2025 am 12:09 AM

PHPsessionstrackuserdataacrossmultiplepagerequestsusingauniqueIDstoredinacookie.Here'showtomanagethemeffectively:1)Startasessionwithsession_start()andstoredatain$_SESSION.2)RegeneratethesessionIDafterloginwithsession_regenerate_id(true)topreventsessi

How do you loop through all the values stored in a PHP session?How do you loop through all the values stored in a PHP session?Apr 26, 2025 am 12:06 AM

In PHP, iterating through session data can be achieved through the following steps: 1. Start the session using session_start(). 2. Iterate through foreach loop through all key-value pairs in the $_SESSION array. 3. When processing complex data structures, use is_array() or is_object() functions and use print_r() to output detailed information. 4. When optimizing traversal, paging can be used to avoid processing large amounts of data at one time. This will help you manage and use PHP session data more efficiently in your actual project.

Explain how to use sessions for user authentication.Explain how to use sessions for user authentication.Apr 26, 2025 am 12:04 AM

The session realizes user authentication through the server-side state management mechanism. 1) Session creation and generation of unique IDs, 2) IDs are passed through cookies, 3) Server stores and accesses session data through IDs, 4) User authentication and status management are realized, improving application security and user experience.

Give an example of how to store a user's name in a PHP session.Give an example of how to store a user's name in a PHP session.Apr 26, 2025 am 12:03 AM

Tostoreauser'snameinaPHPsession,startthesessionwithsession_start(),thenassignthenameto$_SESSION['username'].1)Usesession_start()toinitializethesession.2)Assigntheuser'snameto$_SESSION['username'].Thisallowsyoutoaccessthenameacrossmultiplepages,enhanc

What are some common problems that can cause PHP sessions to fail?What are some common problems that can cause PHP sessions to fail?Apr 25, 2025 am 12:16 AM

Reasons for PHPSession failure include configuration errors, cookie issues, and session expiration. 1. Configuration error: Check and set the correct session.save_path. 2.Cookie problem: Make sure the cookie is set correctly. 3.Session expires: Adjust session.gc_maxlifetime value to extend session time.

How do you debug session-related issues in PHP?How do you debug session-related issues in PHP?Apr 25, 2025 am 12:12 AM

Methods to debug session problems in PHP include: 1. Check whether the session is started correctly; 2. Verify the delivery of the session ID; 3. Check the storage and reading of session data; 4. Check the server configuration. By outputting session ID and data, viewing session file content, etc., you can effectively diagnose and solve session-related problems.

What happens if session_start() is called multiple times?What happens if session_start() is called multiple times?Apr 25, 2025 am 12:06 AM

Multiple calls to session_start() will result in warning messages and possible data overwrites. 1) PHP will issue a warning, prompting that the session has been started. 2) It may cause unexpected overwriting of session data. 3) Use session_status() to check the session status to avoid repeated calls.

How do you configure the session lifetime in PHP?How do you configure the session lifetime in PHP?Apr 25, 2025 am 12:05 AM

Configuring the session lifecycle in PHP can be achieved by setting session.gc_maxlifetime and session.cookie_lifetime. 1) session.gc_maxlifetime controls the survival time of server-side session data, 2) session.cookie_lifetime controls the life cycle of client cookies. When set to 0, the cookie expires when the browser is closed.

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

MinGW - Minimalist GNU for Windows

MinGW - Minimalist GNU for Windows

This project is in the process of being migrated to osdn.net/projects/mingw, you can continue to follow us there. MinGW: A native Windows port of the GNU Compiler Collection (GCC), freely distributable import libraries and header files for building native Windows applications; includes extensions to the MSVC runtime to support C99 functionality. All MinGW software can run on 64-bit Windows platforms.

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

EditPlus Chinese cracked version

EditPlus Chinese cracked version

Small size, syntax highlighting, does not support code prompt function

mPDF

mPDF

mPDF is a PHP library that can generate PDF files from UTF-8 encoded HTML. The original author, Ian Back, wrote mPDF to output PDF files "on the fly" from his website and handle different languages. It is slower than original scripts like HTML2FPDF and produces larger files when using Unicode fonts, but supports CSS styles etc. and has a lot of enhancements. Supports almost all languages, including RTL (Arabic and Hebrew) and CJK (Chinese, Japanese and Korean). Supports nested block-level elements (such as P, DIV),

WebStorm Mac version

WebStorm Mac version

Useful JavaScript development tools