Home >Backend Development >PHP Problem >How to install php running environment

How to install php running environment

藏色散人
藏色散人Original
2020-07-13 10:51:424179browse

How to install the PHP operating environment: first obtain the Apache installation package; then unzip the installation package and modify the configuration file; then obtain the PHP installation file, unzip the installation package, and put it in the same directory as Apache24; finally restart the Apache service. .

How to install php running environment

php running environment installation

PHP’s more popular living environment Apache php MySQL

一, Install the web server: apache

1. Obtain the Apache installation package

32-bit: http://www.apachelounge.com/download/VC15/binaries/httpd-2.4.29-Win32 -VC15.zip

64-bit: http://www.apachelounge.com/download/VC15/binaries/httpd-2.4.29-Win64-VC15.zip

2. Unzip and install package, modify the configuration file (if you decompress it on the c drive, you can ignore this step)

After decompression is completed, use notepad to open Apache24\conf\httpd.conf

Change ServerRoot "c:/Apache24" Change the file address in to the address where Apache is located after you decompressed it (for example, ServerRoot "d:/Apache24")

3. Run the server

First open Windows PowerShell as an administrator to open Apache bin folder of the address where it is located, and then enter

How to install php running environment

##                                                                                                                                                                                                                                                                         to be extracted. directory, otherwise the operation will fail)

Enter your local IP address in the browser address bar and press Enter. If the web page displays It works!, it proves that the operation is successful.

How to install php running environment If you want to modify the configuration of Apache later, you need to restart Apache to take effect.

2. PHP application server: Explanation and execution of the PHP program we wrote

1. Obtain the PHP installation file

https://windows.php.net/download#php-7.3

2. Unzip the installation package and put it in the same directory as Apache24

3. 1) Find the conf folder of apache, open httpd.conf to configure php, find the place of loadmodule, and copy the following configuration into the configuration file.

LoadModule php7_module D:/php7.3.2/php7apache2_4.dll

D:/php7.3.2/php7apache2_4.dll path is the path of the php7apache2_4.dll file in your own php directory.

2) Configure Apache parsing rules. When Apache parses files with the suffix '.php', it calls the php module.

Configuration method:

AddType application/x-httpd-php .php

3) Load the php configuration file into the Apache configuration file: effective together

3.1) Specify php in Apache's httpd.conf file The path where the configuration file is located

PHPIniDir “D:/php7.3.2”

3.2) The php.ini file does not exist by default. It exists in development and production formats and needs to be formatted. Find php.ini-development in the directory, copy a copy and rename it to php.ini

Description: PHP’s configuration file has been added to Apache’s configuration items, which means that modifications to php.ini require Apache to restart will take effect.

4) Open Computer Management, find apache in Services, restart the Apache service, create a new text document named hello.php in the Apache24/htdocs directory, open it for editing

<?php
phpinfo();

and restart the server. Open the browser and visit localhost/hello.php to see the php information

     

3. Database management system: Database server MySQL

    File download address: https: //dev.mysql.com/get/Downloads/MySQLInstaller/mysql-installer-community-8.0.11.0.msi, choose to use the previous password encryption method during installation, do not use the new version of encryption method.

For more related knowledge, please visit

PHP Chinese websiteHow to install php running environment!

The above is the detailed content of How to install php running environment. 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