laradock配置编辑laradock/.env文件WORKSPACE_INSTALL_XDEBUG=truePHP_FPM_INSTALL_XDEBUG=true重建容器docker-composebuildworkspacephp-fpm#startdocker-composeup-dnginxmysqlredispasteworkspace/xdebug.ini&php-fpm/xdebug.ini默认配置,新手不要照搬网上教程配置,保持默认配置即可,这里只说明一个参数xdebug.remote_connect_back=1表示动态抓包源主机,不需要设置xdebug.remote_host,如果设置等于0,你需要指定xdebug.remote_host地址;xdebug.remote_host=dockerhost;Mac系统需要设置remote_host;xdebug.remote_host=docker.for.mac.localhost;xdebug.remote_host=docker.for.mac.host.internalxdebug.remote_connect_back=1xdebug.remote_port=9000xdebug.idekey=PHPSTORMxdebug.remote_autostart=0xdebug.remote_enable=0xdebug.cli_color=0xdebug.profiler_enable=0xdebug.profiler_output_debug/php~/storm_dir="/tmp/profiling"xdebug.remote_handler=dbgpxdebug.remote_mode=reqxdebug.var_display_max_children=-1xdebug.var_display_max_data=-1xdebug.var_display_max_depth=-1PHPStorm配置打开PHPStorm,File->SettingsintoLanguages&Frameworks->PHP->服务器。新建Servers,如下图,Name必须填写与laradock/.env文件serverName相同的内容,默认为laradockHost为服务器对应的Host地址;端口不需要修改;Debugger选择Xdebug设置目录映射(Usepathmappings),localdirectory->remoteDirectory###RemoteInterpreter#######################################选择一个远程解释器条目匹配名称。默认为`laradock`PHP_IDE_CONFIG=serverName=laradock设置断点,点击电话按钮开始监听即可调试断点
