Windows
下载源码
下载地址:https://www.php.net/downloads
我们下载VC15 x64 Non Thread Safe
版本的 zip
包,解压放在任意路径,推荐放在C:\Program Files
目录下。配置环境变量
此电脑-右键->属性->高级系统设置->环境变量...->系统变量
找到Path
变量选择编辑
,新建一个值:C:\Program Files\php-x.x.xx-nts-Win32-VC15-x64
指向我们的源码解压路径,一路保存即可。
配置文件
[CLI Server]
; Whether the CLI web server uses ANSI color coding in its terminal output.
cli_server.color = On
[Date]
; Defines the default timezone used by the date functions
; http://php.net/date.timezone
date.timezone=Asia/Shanghai
[opcache]
# https://www.php.net/manual/zh/opcache.configuration.php
opcache.enable = 1
opcache.enable_cli=0
opcache.memory_consumption=128
opcache.interned_strings_buffer=8
opcache.max_accelerated_files=10000
opcache.revalidate_freq=2
opcache.save_comments=1