Home>Article>Backend Development> Detailed explanation of the installation and configuration of PHP7 under win7
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.
# Recommended: "
PHP Video Tutorial》
1, PHP installation 1), environment installation directory:C:/wamp/ |——php |——php7.2 |——Apache24 |——mysql |——www
Special for windows: http://windows.php.net/download/
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.2 Find 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.dllThe diagram is as follows:PHPIniDir "C:\wamp\php7.2\" AddType application/x-httpd-php .php AddType application/x-httpd-php-source .phps
Modify thewww directory (this directory That is, the directory where the project is located, which can be accessed by the browser):
DocumentRoot "D:/wamp/www"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
The picture is as follows:DocumentRoot "D:\www" Options +Indexes +FollowSymLinks +ExecCGI AllowOverride All Require all granted
e. Configure the domain name
The diagram is as follows:DocumentRoot "D:\www\tp5_test\public" ServerName www.tp5.com ServerAlias Options FollowSymLinks ExecCGI AllowOverride All Require all granted
##4), httpd-vhosts syntax error
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.
注释掉3)a、加载PHP7.2模块
中开启的配置,如下所示:
然后,开启LoadModule fcgid_module modules/mod_fcgid.so
,如下:
接下来,添加配置信息:
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
汇总如下:
最后,写PHP脚本,代码为
如果出现以下内容代表配置成功:
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!