线上环境调试套件,DEBUG三板斧(安装编辑器、禁用OPcache、重启PHP-FPM).
| 运行环境要求 |
|---|
| PHP ^8.1.0 |
| Laravel Framework ^9.0 |
composer require gupo/laravel-debugging# php artisan debugging [--F | force] [--editor= nano | vim]
>> php artisan debugging -F
执行命令将自动进行以下操作:
- 离线安装
nano编辑器 (可选在线安装vim); - 禁用
OPcache; - 重启
PHP-FPM.
内置两种编辑器工具 vim、nano 的安装,其中 nano 支持离线安装, vim 目前需要在通外网的情况下安装.
# php artisan debugging:install [nano | vim]
>> php artisan debugging:install vim
离线安装
nano目前仅支持amd架构.
管理 OPcache 的启用与禁用.
# php artisan debugging:opcache [enable | true | disable | false] [--R | restart]
>> php artisan debugging:opcache false --restart
指定 --restart 时,尝试直接重启 PHP-FPM 使 OPcache 配置生效.
管理 PHP-FPM 服务状态.
# php artisan debugging:service [restart | stop | start]
>> php artisan debugging:service restart
