Home Backend Development PHP7 Building PHP7 operating environment under Windows 7

Building PHP7 operating environment under Windows 7

Feb 07, 2021 am 09:27 AM
php7 windows7

Building PHP7 operating environment under Windows 7

Recommended (free): PHP7

php7 is known as HHVM can catch up with Facebook. In order to experience the legendary high performance, I deliberately tried to install php7 on my local computer. I have to admit that the operating environment of php7 is still a bit harsh compared to the previous php5. Let’s start with the topic.

1. Environment preparation

1. windows7 version requirements

If you are using win7 system, you must make sure The SP1 update package is installed on your system. This is absolutely necessary, as shown in the figure:

#2. Download php7

##You need to download the thread-safe version of php7, otherwise, we will not be able to load the php7apache2_4.dll extension. Download address:

#http://php .net/downloads.php

#3. Download Apache2.4

##For compatibility reasons, we chose Apache version under VC9 compilation environment, download address:

##http://httpd.apache.org/download.cgi

The download process is as follows:


Note: Apache2.2 does not support php7, so, We have to download Apache2.4

#4. Download Visual C 2015

Since php7 uses the VC14 compilation environment, we also need to download Visual C 2015, download address:

https://www.microsoft.com/en-US/download/details.aspx?id=48145

##2. Start the installation

1. Double-click to install vc_redist.x64.exe

##2. Unzip php-7.0.10-Win32-VC14-x64.zip, the directory structure is as follows:

#3. Unzip httpd-2.4.23-x64.zip, the directory structure is as follows:

#4 . Create Apache service

##Enter the cmd command line and enter:

"D:\program\myplatform\Apache2.4\bin\httpd.exe" -k install -n Apache2.4, as shown in the figure:

##The above picture represents permissions If it is not enough, we execute it again with administrator rights, as shown in the figure:


#The above picture indicates that the Apache2.4 system service has been successfully created.

##3. Configure Apache

File to be modified: D:/program/myplatform/Apache2.4/conf/httpd.conf

1. Set the installation directory of apache

##Change

Define SRVROOT "/Apache24" is changed to ##Define SRVROOT "D:/program/myplatform/Apache2.4"

2. Configure the workspace

Change the following two lines

##DocumentRoot "${SRVROOT}/htdocs"

##changed to

DocumentRoot "D:/javapro"

#3. Load php module

##At the end of the tag, add the following three lines:

PHPIniDir "../PHP/php-7.0.10"

LoadModule php7_module "../PHP/php-7.0.10/php7apache2_4.dll"

AddType application/x-httpd-php .php

##Note: relative paths are used here , the root directory of the relative path is the value of the ServerRoot parameter, which is the value defined previously by SRVROOT, not the directory where the httpd.conf configuration file is located.

##4. Access to the website directory is prohibited

For security reasons, we'd better configure this option to prohibit access to the website's directory list. As follows:

##In the tag, replace

Options Indexes FollowSymLinks

##Changed to

Options None

##5. Configure the default home page

##Inside the tag, replace

DirectoryIndex index.html

## is modified to

DirectoryIndex index.html index.php

##four . Configure php

## Files that need to be modified: D:/ program/myplatform/php-7.0.10/php.ini

##1. Modify php .ini-development

# willD:/program/myplatform/## The php.ini-development file name in the #php-7.0.10 directory is changed to php.ini

2. Modify the extension directory

extension_dir = "D:/program/myplatform/PHP/php-7.0.10/ext"

This must be an absolute path

3. Open related extensions

Enable relevant extensions as needed. I only have the following extensions enabled here :

##extension=php_gd2.dll

extension=php_curl.dll

# #extension=php_mbstring.dll

##extension=php_openssl.dll

##extension=php_mysqli.dll

extension=php_pdo_mysql.dll

Note: php_mysql is no longer supported in php7 .dll is extended.

4. Set time zone

date.timezone ="Asia/Shanghai"

##5. Set error reporting level

##error_reporting = E_ALL ^ ​​E_NOTICE

##5. Check Apache configuration

Switch to the bin directory of the apache installation directory and enter: httpd.exe -t , as shown in the picture:

##If Syntax OK is returned, it means that the configuration of apache and the required operating environment are OK. If not, you need to troubleshoot the error according to the error message. .

6. Test whether Apache and php are working properly

In the root directory of the workspace, create a new index.php with the following content:

phpinfo();
Copy after login

##Then, start the Apache service, as shown in the figure:

##Open browse Server, enter: http://localhost:8081. If you see the following interface, it means that the running environment configuration is successful!

##

The above is the detailed content of Building PHP7 operating environment under Windows 7. 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 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

AI Hentai Generator

AI Hentai Generator

Generate AI Hentai for free.

Hot Article

R.E.P.O. Energy Crystals Explained and What They Do (Yellow Crystal)
3 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. Best Graphic Settings
3 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. How to Fix Audio if You Can't Hear Anyone
3 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
WWE 2K25: How To Unlock Everything In MyRise
3 weeks ago By 尊渡假赌尊渡假赌尊渡假赌

Hot Tools

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)

The copy of windows7 build 7601 is not genuine. The simplest solution is that the copy of build 7601 is not genuine. The copy of windows7 build 7601 is not genuine. The simplest solution is that the copy of build 7601 is not genuine. Mar 15, 2024 pm 09:49 PM

Recently, some friends reported that their computer prompts "The copy of Windows 7 internal version 7601 is not genuine." They all want to know if the copy of Windows 7 is not genuine 7601 and affects the use of it. The main reason for this is that the user's system has not been activated. Today I will give it to you. Let’s talk about the simplest solution to the problem that the copy of internal version 7601 is not genuine. Friends in need can come and take a look. The copy of windows7 internal version 7601 is not genuine. Method 1: 1. Press "win r" on the keyboard at the same time, then enter "CMD", and then press "Enter" to confirm. 2. Enter "SLMGR-REARM" in the pop-up window. Please note that there is a space in the middle. Don't miss it. 3. Then press Enter to confirm. A dialog box will pop up and click "Confirm".

What should I do if the plug-in is installed in php7.0 but it still shows that it is not installed? What should I do if the plug-in is installed in php7.0 but it still shows that it is not installed? Apr 02, 2024 pm 07:39 PM

To resolve the plugin not showing installed issue in PHP 7.0: Check the plugin configuration and enable the plugin. Restart PHP to apply configuration changes. Check the plugin file permissions to make sure they are correct. Install missing dependencies to ensure the plugin functions properly. If all other steps fail, rebuild PHP. Other possible causes include incompatible plugin versions, loading the wrong version, or PHP configuration issues.

How to solve the problem when php7 detects that the tcp port is not working How to solve the problem when php7 detects that the tcp port is not working Mar 22, 2023 am 09:30 AM

In php5, we can use the fsockopen() function to detect the TCP port. This function can be used to open a network connection and perform some network communication. But in php7, the fsockopen() function may encounter some problems, such as being unable to open the port, unable to connect to the server, etc. In order to solve this problem, we can use the socket_create() function and socket_connect() function to detect the TCP port.

How to install mongo extension in php7.0 How to install mongo extension in php7.0 Nov 21, 2022 am 10:25 AM

How to install the mongo extension in php7.0: 1. Create the mongodb user group and user; 2. Download the mongodb source code package and place the source code package in the "/usr/local/src/" directory; 3. Enter "src/" directory; 4. Unzip the source code package; 5. Create the mongodb file directory; 6. Copy the files to the "mongodb/" directory; 7. Create the mongodb configuration file and modify the configuration.

How to open the Explorer window in Win7 system? How to open Explorer in Windows 7 How to open the Explorer window in Win7 system? How to open Explorer in Windows 7 Feb 13, 2024 pm 08:50 PM

Some Win7 system users don’t know how to open the computer’s resource manager window. In fact, the operation is not difficult. You need to open the computer’s start menu first, or directly search in the search box and open the resource manager window. In this regard, this article This article has compiled several methods and shared them with everyone. Interested users can continue reading. How to open Explorer in Windows 7: Tutorial 1 1. Click the [Start] icon in the lower left corner and enter [Windows File Explorer] in the search box. 2. In the search results, click the [Windows Explorer] option as shown in the figure below, and click Open. Tutorial 2 1. Find and double-click the [Computer] icon, and click the [▶] icon at the top. 2. In the pop-up menu bar, root

How to install and deploy php7.0 How to install and deploy php7.0 Nov 30, 2022 am 09:56 AM

How to install and deploy php7.0: 1. Go to the PHP official website to download the installation version corresponding to the local system; 2. Extract the downloaded zip file to the specified directory; 3. Open the command line window and go to the "E:\php7" directory Just run the "php -v" command.

PHP Server Environment FAQ Guide: Quickly Solve Common Problems PHP Server Environment FAQ Guide: Quickly Solve Common Problems Apr 09, 2024 pm 01:33 PM

Common solutions for PHP server environments include ensuring that the correct PHP version is installed and that relevant files have been copied to the module directory. Disable SELinux temporarily or permanently. Check and configure PHP.ini to ensure that necessary extensions have been added and set up correctly. Start or restart the PHP-FPM service. Check the DNS settings for resolution issues.

How to automatically set permissions of unixsocket after system restart? How to automatically set permissions of unixsocket after system restart? Mar 31, 2025 pm 11:54 PM

How to automatically set the permissions of unixsocket after the system restarts. Every time the system restarts, we need to execute the following command to modify the permissions of unixsocket: sudo...

See all articles