Table of Contents
Description:
1. Download php
1.1 Unzip the compressed package to a directory
1.2 Configure environment variables
1.3 Add PHP_HOME to the PATH variable
1.4 Development dos command line, enter: php -version, monitor whether the configuration is successful
2. Configure Apache
2.1 Unzip httpd-2.4.37-win32-VC15.zip
2.5 Double-click ApacheMonitor.exe, or add it to the startup directory
3. Install a mysql
4. Configure Apache and PHP
4.1 You need to configure apache’s httpd.conf file:
4.2 Continue to configure DirectoryIndex in the httpd.conf file
4.3 Navigate to the F:\ApatchInstallWorkspace\dev\servers\php directory and configure php.ini
Home Backend Development PHP Problem How to install and configure php mysql in win7

How to install and configure php mysql in win7

Aug 12, 2020 am 09:17 AM
php windows

How to install and configure php mysql in win7: first download php and extract the php compressed package to a directory; then add "PHP_HOME" to the PATH variable; then configure Apache and install mysql; finally restart httpd and Just test it.

How to install and configure php mysql in win7

Recommendation: "PHP Video Tutorial"

Description:

Author's The hardware environment is: Windows 7 64-bit

1. Download php

Select: VC15 x86 Thread Safe, the downloaded file name is: php-7.3.0-Win32-VC15 -x86.zip

1.1 Unzip the compressed package to a directory

For this installation, unzip it to: F:\ApatchInstallWorkspace\dev\servers\php Down.

1.2 Configure environment variables

1.3 Add PHP_HOME to the PATH variable

1.4 Development dos command line, enter: php -version, monitor whether the configuration is successful

2. Running PHP requires a server, here Use Apache web server

Download address: https://www.apachelounge.com/download/ and select Apache 2.3.37 win32. (Needs to correspond to the version of php)

2. Configure Apache

2.1 Unzip httpd-2.4.37-win32-VC15.zip

For this installation, extract it to the author's customized directory: F:\ApatchInstallWorkspace\dev\servers\httpd

##2.2 Configure Apache24/bin/httpd.conf File

2.3 Open the command line, cd to the Apache24\bin directory, run httpd.exe

The cursor stays at the bottom and flashes continuously

At this time, the error message "AH00558: httpd.exe..." appears because ServerName is not configured. Open Apache24/conf/httpd.conf and configure "ServerName localhost:80" as shown below:

After entering "httpd.exe" in the command line again, press Press Enter and there will be no error message. At this time, the cursor stops on the next line and flashes continuously, as shown below:

Open the browser and enter in the navigation bar: http:// localhost/ , you will see the following page (proof that Apache is already running):

Return to the command line, press ctrl c (there may be a delay) to stop apache

2.4 Let apache be installed as a service under window

As an administrator, run the command line and navigate to: Apache24\bin directory, as shown below:

Run: httpd.exe -k install

Can be started or stopped in the "Services" of Windows apache service:

Enter: service.msc in the command line, a pop-up box will appear containing:

If duplicate services are added, You can use: sc delete service name to delete, as follows:

2.5 Double-click ApacheMonitor.exe, or add it to the startup directory

Right-click the apache cursor, you will see a pop-up box, click start in the pop-up box You can start the service. Click stop to close the service.

If the service is started, enter: http://localhost/ in the navigation bar of the browser, and it will See the content below, otherwise you will not be able to access the page.

3. Install a mysql

The author has installed it before, the version is as follows:

4. Configure Apache and PHP

4.1 You need to configure apache’s httpd.conf file:

In F:\ApatchInstallWorkspace\dev\servers\httpd\Apache24\ conf directory, open the httpd.conf file, move to the end of the file (or anywhere in the file), and write the following content:

LoadModule php7_module "F:/ApatchInstallWorkspace/dev/servers/php/php7apache2_4.dll"
AddHandler application/x-httpd-php .php
PHPIniDir F:/ApatchInstallWorkspace/dev/servers/php
Copy after login

The version of the component must match the version of apache (here, the Version is 2_4)

4.2 Continue to configure DirectoryIndex in the httpd.conf file

Find DirectoryIndex in the file and configure the following content:

Copy the php.ini-development file and copy it Name it: php.ini

Find and modify the following parameters:

##4.4 In php.ini, find the 'Dynamic Extensions' section and modify the following extension (open the comment and add the correct path):

extension=F:/ApatchInstallWorkspace/dev/servers/php/ext/php_curl.dll
extension=F:/ApatchInstallWorkspace/dev/servers/php/ext/php_gd2.dll
extension=F:/ApatchInstallWorkspace/dev/servers/php/ext/php_intl.dll
extension=F:/ApatchInstallWorkspace/dev/servers/php/ext/php_mbstring.dll
extension=F:/ApatchInstallWorkspace/dev/servers/php/ext/php_mysqli.dll
extension=F:/ApatchInstallWorkspace/dev/servers/php/ext/php_openssl.dll
extension=F:/ApatchInstallWorkspace/dev/servers/php/ext/php_soap.dll
extension=F:/ApatchInstallWorkspace/dev/servers/php/ext/php_xmlrpc.dll
Copy after login

4.5 Restart httpd

An error occurred As follows:

After inquiry, it was found that it was due to the problem of downloading the wrong php package (the first download was: php-7.3.0-Win32-VC15-x64.zip) , re-download, download the php-7.3.0-Win32-VC15-x86.zip package

At this time, there will be no problem if you execute httpd -k restart

5. Test installation

Add a text file: test.php in the Apache24\htdocs directory, enter the following content in this file:

<?php phpinfo();
Copy after login

Enter: http://localhost/test.php in the navigation bar of the browser, the following page will appear:

(Note: Apache2.4 needs to be started successfully)

At this point, php is installed successfully.

The above is the detailed content of How to install and configure php mysql in win7. For more information, please follow other related articles on the PHP Chinese website!

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

Hot Article Tags

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

PHP 8.4 Installation and Upgrade guide for Ubuntu and Debian PHP 8.4 Installation and Upgrade guide for Ubuntu and Debian Dec 24, 2024 pm 04:42 PM

PHP 8.4 Installation and Upgrade guide for Ubuntu and Debian

deepseek web version entrance deepseek official website entrance deepseek web version entrance deepseek official website entrance Feb 19, 2025 pm 04:54 PM

deepseek web version entrance deepseek official website entrance

How to update the latest version of Bybit Exchange? Will there be any impact if it is not updated? How to update the latest version of Bybit Exchange? Will there be any impact if it is not updated? Feb 21, 2025 pm 10:54 PM

How to update the latest version of Bybit Exchange? Will there be any impact if it is not updated?

How to install deepseek How to install deepseek Feb 19, 2025 pm 05:48 PM

How to install deepseek

Pi Node Teaching: What is a Pi Node? How to install and set up Pi Node? Pi Node Teaching: What is a Pi Node? How to install and set up Pi Node? Mar 05, 2025 pm 05:57 PM

Pi Node Teaching: What is a Pi Node? How to install and set up Pi Node?

How To Set Up Visual Studio Code (VS Code) for PHP Development How To Set Up Visual Studio Code (VS Code) for PHP Development Dec 20, 2024 am 11:31 AM

How To Set Up Visual Studio Code (VS Code) for PHP Development

Coinsuper exchange software channel official website entrance Coinsuper exchange software channel official website entrance Feb 21, 2025 pm 10:39 PM

Coinsuper exchange software channel official website entrance

PHP Program to Count Vowels in a String PHP Program to Count Vowels in a String Feb 07, 2025 pm 12:12 PM

PHP Program to Count Vowels in a String

See all articles