Home > Backend Development > PHP Tutorial > How to build Apache PHP environment under Windows

How to build Apache PHP environment under Windows

不言
Release: 2023-03-23 12:16:01
Original
1827 people have browsed it

The content of this article is to share with you about the method of setting up the Apache PHP environment under Windows. Friends in need can refer to it

I often build a PHP environment under the Linux environment, but this is the first time under Windows. , there is no technical content, just record it, friends who need it can refer to this tutorial

I often build a php environment in the Linux environment, this is the first time under Windows, there is no technical content, I just record it, so as not to worry I'll have to search everywhere next time.

Download address

http://windows.php.net/download/#php-5.5
http://www .apachelounge.com/download/
http://www.microsoft.com/zh-CN/download/details.aspx?id=30679

V11 is a component of Microsoft, if not installed It will prompt that msvcr110.dll is missing.

After downloading, install V11 and unzip Apache and PHP to the directory you want.

Configuration

PHP configuration

PHP needs to configure environment variables. Add ;X:\php;X:\php\ext to PATH.

APACHE configuration

Modify the X:\Apache24\conf\httpd.conf file.

Need to modify:

ServerRoot "X:\Apache24"
DocumentRoot "X:/Apache24/htdocs"
<Directory "X:/Apache24/htdocs">
Listen 8080
ServerName localhost:8080
Copy after login

Need to add:

# php5 support
LoadModule php5_module X:/php/php5apache2_4.dll
AddType application/x-httpd-php .php .html .htm
# configure the path to php.ini
PHPIniDir "X:/php"
Copy after login

Configure Apache, configure environment variables, install V11, and then you may need to restart the computer.

Start Apache

X:\Apache24\bin\httpd.exe -k install/start/stop/restart
Copy after login

Verify whether the Apache server is set up successfully, in the address bar Directly enter 127.0.0.1:8080. If the web page can be opened, it means Apache is successful. Verify whether PHP is configured successfully, create a new php file such as php.php, enter

<?php phpinfo(); ?>
Copy after login

and place it in the X:\Apache24\htdocs directory, and then use the browser Open 127.0.0.1:8080/php.php.

Related recommendations:

How to build a PHP running environment under Ubuntu server_Linux

Standard version of Eclipse to build a PHP environment Step by step method

The above is the detailed content of How to build Apache PHP environment under Windows. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template