1. 下载 php 8.1 文件
cd /d D:\work
curl -L -o php-8.1.10-Win32-vs16-x64.zip https://windows.php.net/downloads/releases/php-8.1.10-Win32-vs16-x64.zip
curl -L -o php-debug-pack-8.1.10-Win32-vs16-x64.zip https://windows.php.net/downloads/releases/php-debug-pack-8.1.10-Win32-vs16-x64.zip
curl -L -o php-devel-pack-8.1.10-Win32-vs16-x64.zip https://windows.php.net/downloads/releases/php-devel-pack-8.1.10-Win32-vs16-x64.zip
2. 解压文件3个zip文件,将文件复制到指定目录 d:\work\php-8.1.10-Win32-vs16-x64
3. 创建符号链接 d:\work\php
mklink /d d:\work\php d:\work\php-8.1.10-Win32-vs16-x64
cd /d D:\work\php
php -v
php -i
4. 通过 Supported Versions and Compatibility 可以检查 Xdebug 与 PHP 的兼容性
5. 通过 Xdebug Installation Wizard 来检查需要下载什么版本的 xdebug dll 文件
cd /d D:\work\php\ext
curl -L -o php_xdebug.dll https://xdebug.org/files/php_xdebug-3.1.5-8.1-vs16-x86_64.dll
6. 复制 php.ini-development 为 php.ini
7. 在 php.ini 下部增加以下内容
; 2022-09-15 add by Arno
[php]
max_execution_time = 600
max_input_time = 600
post_max_size = 8M
include_path = "d:/work/php/PEAR"
extension_dir = "d:/work/php/ext"
upload_tmp_dir = "d:/work/tmp"
upload_max_filesize = 20M
extension = bz2
extension = curl
extension = fileinfo
extension = ftp
extension = gd
extension = gettext
extension = imap
extension = ldap
extension = mbstring
extension = exif
extension = mysqli
extension = openssl
extension = pdo_mysql
extension = pdo_sqlite
asp_tags = Off
display_startup_errors = On
track_errors = Off
y2k_compliance = On
allow_call_time_pass_reference = Off
safe_mode = Off
safe_mode_gid = Off
safe_mode_allowed_env_vars = PHP_
safe_mode_protected_env_vars = LD_LIBRARY_PATH
error_log = "D:/work/logs/php_error.log"
register_globals = Off
register_long_arrays = Off
magic_quotes_gpc = Off
magic_quotes_runtime = Off
magic_quotes_sybase = Off
[Date]
date.timezone = "Asia/Shanghai"
[Pdo]
pdo_mysql.default_socket = "MySQL"
[Session]
session.save_path = "d:/work/tmp"
define_syslog_variables=Off
[curl]
;curl.cainfo="D:\work\apache\bin\curl-ca-bundle.crt"
;openssl.cafile="D:\work\apache\bin\curl-ca-bundle.crt"
[Syslog]
define_syslog_variables=Off
[MySQL]
mysql.allow_local_infile=On
mysql.allow_persistent=On
mysql.cache_size=2000
mysql.max_persistent=-1
mysql.max_link=-1
mysql.default_port=3306
mysql.default_socket="MySQL"
mysql.connect_timeout=3
mysql.trace_mode=Off
[MSSQL]
mssql.allow_persistent=On
mssql.max_persistent=-1
mssql.max_links=-1
mssql.min_error_severity=10
mssql.min_message_severity=10
mssql.compatability_mode=Off
mssql.secure_connection=Off
[xdebug]
zend_extension = "D:/work/php/ext/php_xdebug.dll"
xdebug.idekey=phpstorm
xdebug.mode=debug
xdebug.remote_handler=dbgp
xdebug.client_host=php.arno
xdebug.client_port=9000
xdebug.start_with_request=yes
php -v
: 版本信息增加了: with Xdebug v3.1.5, Copyright (c) 2002-2022, by Derick Rethans
8. 在 Windows 10 系统环境变量中增加 D:\work\php; D:\work\php\ext;
9. 安装 Composer
cd /d D:\work\composer
php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"
php -r "if (hash_file('sha384', 'composer-setup.php') === '55ce33d7678c5a611085589f1f3ddf8b3c52d662cd01d4ba75c0ee0459970c2200a51f492d557530c71c15d8dba01eae') { echo 'Installer verified'; } else { echo 'Installer corrupt'; unlink('composer-setup.php'); } echo PHP_EOL;"
php composer-setup.php
php -r "unlink('composer-setup.php');"
: 检查 composer 版本
php composer.phar
10. 在 Windows 10 系统环境变量中增加 D:\work\composer
11. 创建 D:\work\composer\composer.cmd 内容如下
@echo off
@php "%~dp0composer.phar" %*
: 检查 composer 版本
composer