Windows

  1. 下载源码
    下载地址:https://www.php.net/downloads
    我们下载 VC15 x64 Non Thread Safe 版本的 zip
    包,解压放在任意路径,推荐放在 C:\Program Files 目录下。

  2. 配置环境变量
    此电脑-右键->属性->高级系统设置->环境变量...->系统变量
    找到 Path 变量选择编辑,新建一个值:
    C:\Program Files\php-x.x.xx-nts-Win32-VC15-x64
    指向我们的源码解压路径,一路保存即可。

配置文件

  1. [CLI Server]
  2. ; Whether the CLI web server uses ANSI color coding in its terminal output.
  3. cli_server.color = On
  4. [Date]
  5. ; Defines the default timezone used by the date functions
  6. ; http://php.net/date.timezone
  7. date.timezone=Asia/Shanghai
  8. [opcache]
  9. # https://www.php.net/manual/zh/opcache.configuration.php
  10. opcache.enable = 1
  11. opcache.enable_cli=0
  12. opcache.memory_consumption=128
  13. opcache.interned_strings_buffer=8
  14. opcache.max_accelerated_files=10000
  15. opcache.revalidate_freq=2
  16. opcache.save_comments=1