


Detailed explanation of the installation and configuration of PHP7 under win7
Aug 24, 2020 am 10:20 AMHow 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
Copy after login
2), downloadLinux only: http ://www.php.net/downloads.phpC:/wamp/ |——php |——php7.2 |——Apache24 |——mysql |——www
Special 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 PHPUsually 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=15336VC11 x86 or x64: http://www.microsoft.com/ en-us/download/details.aspx?id=30679VC14 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"
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=xsl
date.timezone=PRC
Add custom extensions
;[memcache] extension=php_memcache.dll
;[redis] extension=php_redis.dll
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>
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 "D:/wamp/www">
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>
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>
##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!

Hot Article

Hot tools Tags

Hot Article

Hot Article Tags

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

How to optimize PHP7 code to improve performance

Which versions of PHP7 have introduced new operators

How to Use Sessions Effectively in PHP 7?

What are the impacts of different versions of PHP7 on memory consumption

How to Upgrade from PHP 5.6 to PHP 7?

How to Monitor PHP 7 Performance with Tools like New Relic?

What bugs have been fixed in the PHP7 version update

What impact does the PHP7 version update have on session processing?
