How to install php environment under windows
Installation method: 1. Install and configure Apache; 2. Download and unzip the php installation package to the specified path; 3. Copy a copy of "php.ini-development" and rename it to "php.ini" for installation. path, configure the file; 4. Load PHP in Apache and define the file for executing the PHP module.
The operating environment of this tutorial: windows7 system, PHP7.1 version, DELL G3 computer
Install PHP under Windows Development environment
1. Apache
Because the Apache official website only provides source code, you must compile it yourself if you want to use it , here I choose the third-party installation package Apache Lounge.
Enter Apachelounge official download address: http://www.apachelounge.com/download/
First download and install vc redist, this It is a component necessary for Apache to run.
Download the decompressed version of Apache and place the decompressed folder in the path you want to install.
Modify the configuration file:
Apache’s default path is: c:\Apache24 (the version number may be different) . If it is different from your installation path, you need to open the Apach\conf\httpd.conf configuration file and change all c:\Apache24 and c:\Apache24 that are not commented with "#" in front of it. \htdocs and c:\Apache24\cgi-bin\ are changed to the corresponding paths.
Specify IP and port: Find ServerName www.example.com:80 in httpd.conf, remove the previous comment, and replace "www.example.com "changed to "localhost". If you want to modify the port, modify the "80" here together with the 80 in the previous "Listen: 80".
(Optional) Add system variables: Add "Apache installation path\bin" to Path.
Verify that the installation is successful: run Apache startup httpd.exe. Enter localhost:80 on the browser. If it is not inaccessible, then the Apache configuration is complete.
Tips: Register Apache as a Windows service
-
Install: apache’s bin directory Execute with administrator privileges
httpd.exe -k install
Copy after login -
##Uninstall: Execute with administrator privileges under the bin directory of apache
httpd.exe -k uninstall
Copy after login
2. PHP
- Install and configure PHP
Note: The downloaded PHP VC version cannot be higher than the vc redist version installed previously.
Enter the PHP installation directory, copy a copy ofphp.ini-development and rename it php.ini Place it in the installation path, open it and find ;extension_dir= ext, remove the comments and change the value to PHP installation path\ext.
extension_dir = "D:/Program Files/php-7.2.10/ext"
- Load PHP in Apache & define the file that executes the PHP module
LoadModule php7_module "PHP installation path\php7apache2_4.dll" # Load PHP as a module in Apache, the "7" in "php7_module" must be Corresponds to the PHP version; in addition, different PHP versions "php7apache2_4.dll" may be different.
PHPIniDir "PHP installation path" #Tell Apache the installation path of PHP
# 在Apache中以module的方式加载PHP,“php7_module”中的“7”要和PHP的版本对应;此外,不同的PHP版本“php7apache2_4.dll”可能不同。 #php 7.2.10 LoadModule php7_module 'D:/Program Files/php-7.2.10/php7apache2_4.dll' <IfModule php7_module> #告诉Apache PHP的安装路径 PHPIniDir 'D:/Program Files/php-7.2.10/php.ini' # define php module file .php和.html的文件能执行PHP程序 AddType application/x-httpd-php .php .html #AddType application/x-httpd-php-source .phps </IfModule>
- Test: Create a new file under Apache installation path\htdocs: test.php , edit inside:, start Apache, enter in the browser: localhost:80/test.php.
PHP Video Tutorial"
The above is the detailed content of How to install php environment under windows. For more information, please follow other related articles on the PHP Chinese website!

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics

PHP 8.4 brings several new features, security improvements, and performance improvements with healthy amounts of feature deprecations and removals. This guide explains how to install PHP 8.4 or upgrade to PHP 8.4 on Ubuntu, Debian, or their derivati

The way to update ByBit exchanges varies by platform and device: Mobile: Check for updates and install in the app store. Desktop Client: Check for updates in the Help menu and install automatically. Web page: You need to manually access the official website for updates. Failure to update the exchange can lead to security vulnerabilities, functional limitations, compatibility issues and reduced transaction execution efficiency.

DeepSeek is a powerful intelligent search and analysis tool that provides two access methods: web version and official website. The web version is convenient and efficient, and can be used without installation; the official website provides comprehensive product information, download resources and support services. Whether individuals or corporate users, they can easily obtain and analyze massive data through DeepSeek to improve work efficiency, assist decision-making and promote innovation.

Detailed explanation and installation guide for PiNetwork nodes This article will introduce the PiNetwork ecosystem in detail - Pi nodes, a key role in the PiNetwork ecosystem, and provide complete steps for installation and configuration. After the launch of the PiNetwork blockchain test network, Pi nodes have become an important part of many pioneers actively participating in the testing, preparing for the upcoming main network release. If you don’t know PiNetwork yet, please refer to what is Picoin? What is the price for listing? Pi usage, mining and security analysis. What is PiNetwork? The PiNetwork project started in 2019 and owns its exclusive cryptocurrency Pi Coin. The project aims to create a one that everyone can participate

There are many ways to install DeepSeek, including: compile from source (for experienced developers) using precompiled packages (for Windows users) using Docker containers (for most convenient, no need to worry about compatibility) No matter which method you choose, Please read the official documents carefully and prepare them fully to avoid unnecessary trouble.

Visual Studio Code, also known as VS Code, is a free source code editor — or integrated development environment (IDE) — available for all major operating systems. With a large collection of extensions for many programming languages, VS Code can be c

This tutorial demonstrates how to efficiently process XML documents using PHP. XML (eXtensible Markup Language) is a versatile text-based markup language designed for both human readability and machine parsing. It's commonly used for data storage an

The official website entrance of the Coinsuper Exchange: https://www.coinsuper.com. The client download channels are: Windows client, macOS client, and mobile (iOS/Android). Registration requires an email, mobile phone number and password, and you need to complete real-name authentication before you can trade. The platform provides a variety of digital asset transactions, including Bitcoin, Ethereum, etc., with the transaction fee rate of 0.1% for both orders and acceptors. Security safeguards include cold wallet storage, dual-factor verification, anti-money laundering and anti-terrorism financing measures, and with security public
