


Explain the establishment of PHP7 operating environment under Windows 7
php7 claims to be able to catch up with Facebook's HHVM. In order to experience the legendary high performance, I specially tried it on my local computer. After installing php7, I have to admit that the running 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 that the SP1 update package is installed on your system. This is definitely the Necessary conditions, as shown in the figure:
##2. To 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 the Apache version under the 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 must 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.exe2. 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:
superior The picture indicates that the permissions are not enough. We execute it again with administrator rights, as shown in the picture:
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: The relative path is used here, and the root directory of the relative path is the value of the ServerRoot parameter, also It 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 thetag, 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. Turn on related extensions
Enable relevant extensions as needed. I only enabled the following extensions 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: In php7, the php_mysql.dll extension is no longer supported.
4. Set time zone
date.timezone ="Asia/Shanghai"
##5. Set error reporting level
##error_reporting = E_ALL ^ E_NOTICE
##5. Check the 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 Apache,php is working normally
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!
#More free recommendations:
The above is the detailed content of Explain the establishment of PHP7 operating environment under Windows 7. 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

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

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



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".

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.

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.

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.

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 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.

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 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...
