


How to install and configure PHP7: first download "php-7.2.21-Win32-VC15-x64.zip"; then extract it to the "D:\wamp\php7.2" directory; then modify "php. ini" file; finally enable the curl extension and configure apache.
PHP Video Tutorial》
1, PHP installation1), environment installation directory:C:/wamp/
|——php
|——php7.2
|——Apache24
|——mysql
|——www
2), downloadLinux only: http ://www.php.net/downloads.phpSpecial for windows: http://windows.php.net/download/
- If PHP runs in FAST-CGI or PHP-FPM mode, select the Non-Thread Safe (NTS) version
- Usually for Apache PHP under Windows, select TS, IIS (fast-cgi) Choose NTS for PHP, choose NTS for Nginx PHP
- Usually choose TS for Apache PHP under Linux, choose NTS for Nginx PHP
- VC9 x86: http://www.microsoft.com/en-us/download/details.aspx?id=5582
- VC9 x64: http://www.microsoft.com/en-us/download/details.aspx?id=15336
- VC11 x86 or x64: http://www.microsoft.com/ en-us/download/details.aspx?id=30679
- VC14 x86 or x64: http://www.microsoft.com/en-us/download/details.aspx?id=48145
- 3), Installation and configuration
Take phpphp-7.2.21-Win32-VC15-x64.zip as an example.
After downloading, extract it to the D:\wamp\php7.2 directory.
Find
;extension_dir = "ext", change to
extension_dir = "C:\wamp\php7.2\ext"Tips: When used with apache, the absolute position needs to be written. Otherwise the extension cannot be loaded. Enable curl extension
Then find:
;extension=curl, remove the semicolon:
extension=curl.
extension=bz2 extension=curl extension=fileinfo extension=gd2 extension=gettext extension=mbstring extension=mysqli extension=openssl extension=pdo_mysql extension=soap extension=sockets extension=sqlite3 extension=tidy extension=xmlrpc extension=xslSet the default time zone
date.timezone=PRC
Add custom extensions
;[memcache] extension=php_memcache.dll
;[redis] extension=php_redis.dll3), configure apache support php7.2Find the apache configuration file, such as
C:\amp\Apache24\conf\httpd.conf, open
a with an editor, and load the PHP7.2 module (
Add content, pay attention to the absolute path)
LoadModule php7_module C:\wamp\php7.2\php7apache2_4.dll <IfModule php7_module> PHPIniDir "C:\wamp\php7.2\" AddType application/x-httpd-php .php AddType application/x-httpd-php-source .phps </IfModule>The diagram is as follows:
Modify the www directory (this directory That is, the directory where the project is located, which can be accessed by the browser):
DocumentRoot "D:/wamp/www" <directory></directory>The diagram is as follows:
c. Open the virtual host:
Remove the comment symbol#d. Configure virtual host default information
Open
C:\Apache24\conf\extra\httpd-vhosts.conf file
<VirtualHost _default_:80>DocumentRoot "D:\www" <Directory "D:\www"> Options +Indexes +FollowSymLinks +ExecCGI AllowOverride All Require all granted </Directory></VirtualHost>The picture is as follows:
e. Configure the domain name
<VirtualHost *:80> DocumentRoot "D:\www\tp5_test\public" ServerName www.tp5.com ServerAlias <Directory "D:\www\tp5_test\public"> Options FollowSymLinks ExecCGI AllowOverride All Require all granted </Directory></VirtualHost>The diagram is as follows:
##4), httpd-vhosts syntax error
After configuring the virtual host, syntax problems sometimes occur. How to accurately locate them? Enter the
httpd -t command in the dos command line, and the syntax check will be performed. If there is no problem, syntx success will be reported: If there is a problem, there will be Tips, just troubleshoot according to the tips.
5)、apache以CGI/FastCGI启动php7.2
注释掉3)a、加载PHP7.2模块
中开启的配置,如下所示:
然后,开启LoadModule fcgid_module modules/mod_fcgid.so
,如下:
接下来,添加配置信息:
<IfModule fcgid_module> FcgidIOTimeout 60 FcgidConnectTimeout 30 FcgidMaxProcesses 8 FcgidOutputBufferSize 64 ProcessLifeTime 240 FcgidMaxRequestsPerProcess 500 FcgidMinProcessesPerClass 0 Options ExecCGI AddHandler fcgid-script .php #你项目php安装目录 FcgidWrapper "C:/wamp/php7.2/php-cgi.exe" .php</IfModule>
汇总如下:
最后,写PHP脚本,代码为
<?php echo phpinfo();?>
如果出现以下内容代表配置成功:
The above is the detailed content of Detailed explanation of the installation and configuration of PHP7 under win7. For more information, please follow other related articles on the PHP Chinese website!

This article details PHP 7's new operators: the null coalescing (??), spaceship (<=>), and null coalescing assignment (??=) operators. These enhance code readability and performance by simplifying null checks and comparisons, indirectl

PHP 7's minor version differences yield subtle memory consumption variations. While newer versions generally improve performance and memory efficiency via Zend Engine and garbage collection optimizations, the impact is application-dependent. Signif

This article examines optimizing PHP7 code for performance. It addresses common bottlenecks like inefficient database queries, I/O operations, and memory leaks. Solutions include efficient coding practices, database & caching strategies, asynch

This article details effective PHP 7 session management, covering core functionalities like session_start(), $_SESSION, session_destroy(), and secure cookie handling. It emphasizes security best practices including HTTPS, session ID regeneration, s

PHP 7 significantly improved upon previous versions by addressing numerous bugs, enhancing performance, and bolstering security. Key improvements included a rewritten Zend Engine 3, optimized memory management, and refined error handling. While gene

This article explains how to monitor PHP 7 application performance using New Relic. It details New Relic's setup, key performance indicators (KPIs) like Apdex score and response time, bottleneck identification via transaction traces and error track

This article details upgrading PHP 5.6 to PHP 7, emphasizing crucial steps like backing up, checking server compatibility, and choosing an upgrade method (package manager, compiling, control panel, or web server configuration). It addresses potentia

This article examines session handling in PHP7, highlighting performance improvements stemming from the enhanced Zend Engine. It discusses potential compatibility issues from upgrading and details optimization strategies for security and scalability


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

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

Safe Exam Browser
Safe Exam Browser is a secure browser environment for taking online exams securely. This software turns any computer into a secure workstation. It controls access to any utility and prevents students from using unauthorized resources.

ZendStudio 13.5.1 Mac
Powerful PHP integrated development environment

SublimeText3 English version
Recommended: Win version, supports code prompts!

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools
