# Recommended: "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
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"
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
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
,如下:
接下来,添加配置信息:
<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!