Class “Vtiful\Kernel\Excel” not found, troubleshooting problems during the use of php-ext-xlswriter

重启 PHP 后,再次报错:[ERROR] workbook_close(): Error creating 'E:\wwwroot\object\storage\app\export/order/订单导出任务2024-02-19 10:24:06.xls'. Error = No error
1. Error: class “vtifulkernelexcel” not found. 2. The reason is that the extension php-ext-xlswriter is not installed. 3. GitHub Release: https://github.com/viest/php-ext-xlswriter/releases download php-windows-xlswriter-cf7e1933-8.1-ts-vs16-x64.zip. as shown in Figure 1
GitHub Release:https://github.com/viest/php-ext-xlswriter/releases 下载 php-windows-xlswriter-cf7e1933-8.1-ts-vs16-x64.zip
Figure 1
4. After decompression, copy php_xlswriter.dll to C:php-8.1.27extphp_xlswriter.dll 5. Edit php.ini, add extension=xlswriter 6. After restarting php, the error is reported again:[ERROR]workbook_close(): error creatingE:WWWRootObjectStorageAppExport/Order/Order Export Task 2024-02-19 10:24:06.xls. error = no error. as shown in Figure 2
重启 PHP 后,再次报错:[ERROR] workbook_close(): Error creating 'E:wwwrootobjectstorageappexport/order/订单导出任务2024-02-19 10:24:06.xls'. Error = No error
Figure 2
7. Check the exception details in the table failed_jobs: ERRORREException: fopen(e:wwwrootobjectstorageappexport/order/order export task 2024-02-19 10:24:06.xls): Failed to open Stream: No such file or directory in


	$path = Storage::disk($this->disk)->putFileAs(
		$this->basePath,
		$this->excel->output(),
		basename($this->excel->{'localFileName'})
	);




ErrorException: fopen(E:wwwrootobjectstorageappexport/order/订单导出任务2024-02-19 10:24:06.xls): Failed to open stream: No such file or directory in E:wwwrootobjectvendorlaravelframeworksrcIlluminateFilesystemFilesystemAdapter.php:396
Stack trace:
#0 E:wwwrootobjectvendorlaravelframeworksrcIlluminateFoundationBootstrapHandleExceptions.php(259): IlluminateFoundationBootstrapHandleExceptions->handleError(2, 'fopen(E:\wwwroo...', 'E:\wwwroot\erp-...', 396)
#1 [internal function]: IlluminateFoundationBootstrapHandleExceptions->IlluminateFoundationBootstrap{closure}(2, 'fopen(E:\wwwroo...', 'E:\wwwroot\erp-...', 396)
#2 E:wwwrootobjectvendorlaravelframeworksrcIlluminateFilesystemFilesystemAdapter.php(396): fopen('E:\wwwroot\erp-...', 'r')
#3 E:wwwrootobjectappServicesExportService.php(81): IlluminateFilesystemFilesystemAdapter->putFileAs('export/order', 'E:\wwwroot\erp-...', 'xE8xAExA2xE5x8Dx95xE5xAFxBCxE5x87xBAxE4xBBxBB...')
#4 E:wwwrootobjectModulesOrderServicesOrderExportService.php(593): AppServicesExportService->save()
#5 E:wwwrootobjectModulesOrderServicesOrderExportService.php(230): ModulesOrderServicesOrderExportService->exportCheck(Array, Array, 'xE8xAExA2xE5x8Dx95xE5xAFxBCxE5x87xBAxE4xBBxBB...')
#6 E:wwwrootobjectModulesOrderJobsOrderExportJob.php(52): ModulesOrderServicesOrderExportService->exportOrderExcel(Array, Object(AppModelsJobStatus))
#7 E:wwwrootobjectvendorlaravelframeworksrcIlluminateContainerBoundMethod.php(36): ModulesOrderJobsOrderExportJob->handle()
#8 E:wwwrootobjectvendorlaravelframeworksrcIlluminateContainerUtil.php(41): IlluminateContainerBoundMethod::IlluminateContainer{closure}()
#9 E:wwwrootobjectvendorlaravelframeworksrcIlluminateContainerBoundMethod.php(93): IlluminateContainerUtil::unwrapIfClosure(Object(Closure))
#10 E:wwwrootobjectvendorlaravelframeworksrcIlluminateContainerBoundMethod.php(37): IlluminateContainerBoundMethod::callBoundMethod(Object(IlluminateFoundationApplication), Array, Object(Closure))
#11 E:wwwrootobjectvendorlaravelframeworksrcIlluminateContainerContainer.php(651): IlluminateContainerBoundMethod::call(Object(IlluminateFoundationApplication), Array, Array, NULL)
#12 E:wwwrootobjectvendorlaravelframeworksrcIlluminateBusDispatcher.php(128): IlluminateContainerContainer->call(Array)
#13 E:wwwrootobjectvendorlaravelframeworksrcIlluminatePipelinePipeline.php(141): IlluminateBusDispatcher->IlluminateBus{closure}(Object(ModulesOrderJobsOrderExportJob))
#14 E:wwwrootobjectvendorlaravelframeworksrcIlluminatePipelinePipeline.php(116): IlluminatePipelinePipeline->IlluminatePipeline{closure}(Object(ModulesOrderJobsOrderExportJob))
#15 E:wwwrootobjectvendorlaravelframeworksrcIlluminateBusDispatcher.php(132): IlluminatePipelinePipeline->then(Object(Closure))
#16 E:wwwrootobjectvendorlaravelframeworksrcIlluminateQueueCallQueuedHandler.php(124): IlluminateBusDispatcher->dispatchNow(Object(ModulesOrderJobsOrderExportJob), false)
#17 E:wwwrootobjectvendorlaravelframeworksrcIlluminatePipelinePipeline.php(141): IlluminateQueueCallQueuedHandler->IlluminateQueue{closure}(Object(ModulesOrderJobsOrderExportJob))
#18 E:wwwrootobjectvendorlaravelframeworksrcIlluminatePipelinePipeline.php(116): IlluminatePipelinePipeline->IlluminatePipeline{closure}(Object(ModulesOrderJobsOrderExportJob))
#19 E:wwwrootobjectvendorlaravelframeworksrcIlluminateQueueCallQueuedHandler.php(126): IlluminatePipelinePipeline->then(Object(Closure))
#20 E:wwwrootobjectvendorlaravelframeworksrcIlluminateQueueCallQueuedHandler.php(70): IlluminateQueueCallQueuedHandler->dispatchThroughMiddleware(Object(IlluminateQueueJobsRedisJob), Object(ModulesOrderJobsOrderExportJob))
#21 E:wwwrootobjectvendorlaravelframeworksrcIlluminateQueueJobsJob.php(98): IlluminateQueueCallQueuedHandler->call(Object(IlluminateQueueJobsRedisJob), Array)
#22 E:wwwrootobjectvendorlaravelframeworksrcIlluminateQueueWorker.php(425): IlluminateQueueJobsJob->fire()
#23 E:wwwrootobjectvendorlaravelframeworksrcIlluminateQueueWorker.php(375): IlluminateQueueWorker->process('redis', Object(IlluminateQueueJobsRedisJob), Object(IlluminateQueueWorkerOptions))
#24 E:wwwrootobjectvendorlaravelframeworksrcIlluminateQueueWorker.php(173): IlluminateQueueWorker->runJob(Object(IlluminateQueueJobsRedisJob), 'redis', Object(IlluminateQueueWorkerOptions))
#25 E:wwwrootobjectvendorlaravelframeworksrcIlluminateQueueConsoleWorkCommand.php(150): IlluminateQueueWorker->daemon('redis', 'export_queue', Object(IlluminateQueueWorkerOptions))
#26 E:wwwrootobjectvendorlaravelframeworksrcIlluminateQueueConsoleWorkCommand.php(134): IlluminateQueueConsoleWorkCommand->runWorker('redis', 'export_queue')
#27 E:wwwrootobjectvendorlaravelframeworksrcIlluminateContainerBoundMethod.php(36): IlluminateQueueConsoleWorkCommand->handle()
#28 E:wwwrootobjectvendorlaravelframeworksrcIlluminateContainerUtil.php(41): IlluminateContainerBoundMethod::IlluminateContainer{closure}()
#29 E:wwwrootobjectvendorlaravelframeworksrcIlluminateContainerBoundMethod.php(93): IlluminateContainerUtil::unwrapIfClosure(Object(Closure))
#30 E:wwwrootobjectvendorlaravelframeworksrcIlluminateContainerBoundMethod.php(37): IlluminateContainerBoundMethod::callBoundMethod(Object(IlluminateFoundationApplication), Array, Object(Closure))
#31 E:wwwrootobjectvendorlaravelframeworksrcIlluminateContainerContainer.php(651): IlluminateContainerBoundMethod::call(Object(IlluminateFoundationApplication), Array, Array, NULL)
#32 E:wwwrootobjectvendorlaravelframeworksrcIlluminateConsoleCommand.php(144): IlluminateContainerContainer->call(Array)
#33 E:wwwrootobjectvendorsymfonyconsoleCommandCommand.php(312): IlluminateConsoleCommand->execute(Object(SymfonyComponentConsoleInputArgvInput), Object(IlluminateConsoleOutputStyle))
#34 E:wwwrootobjectvendorlaravelframeworksrcIlluminateConsoleCommand.php(126): SymfonyComponentConsoleCommandCommand->run(Object(SymfonyComponentConsoleInputArgvInput), Object(IlluminateConsoleOutputStyle))
#35 E:wwwrootobjectvendorsymfonyconsoleApplication.php(1022): IlluminateConsoleCommand->run(Object(SymfonyComponentConsoleInputArgvInput), Object(SymfonyComponentConsoleOutputConsoleOutput))
#36 E:wwwrootobjectvendorsymfonyconsoleApplication.php(314): SymfonyComponentConsoleApplication->doRunCommand(Object(IlluminateQueueConsoleWorkCommand), Object(SymfonyComponentConsoleInputArgvInput), Object(SymfonyComponentConsoleOutputConsoleOutput))
#37 E:wwwrootobjectvendorsymfonyconsoleApplication.php(168): SymfonyComponentConsoleApplication->doRun(Object(SymfonyComponentConsoleInputArgvInput), Object(SymfonyComponentConsoleOutputConsoleOutput))
#38 E:wwwrootobjectvendorlaravelframeworksrcIlluminateConsoleApplication.php(102): SymfonyComponentConsoleApplication->run(Object(SymfonyComponentConsoleInputArgvInput), Object(SymfonyComponentConsoleOutputConsoleOutput))
#39 E:wwwrootobjectvendorlaravelframeworksrcIlluminateFoundationConsoleKernel.php(151): IlluminateConsoleApplication->run(Object(SymfonyComponentConsoleInputArgvInput), Object(SymfonyComponentConsoleOutputConsoleOutput))
#40 E:wwwrootobjectartisan(37): IlluminateFoundationConsoleKernel->handle(Object(SymfonyComponentConsoleInputArgvInput), Object(SymfonyComponentConsoleOutputConsoleOutput))
#41 {main}


8. Decided to download from the PHP official website: https://pecl.php.net/package/xlswriter/1.5.1/Windows. 8.1 Thread Safe (ts) x64. 9. Report an error: Worksheet row or column index out of range. Reference: list of exception codes. https://xlswriter-docs.viest.me/zh-cn/exception/code . The row or column index of the worksheet is outside the Excel specified range, please check the array key value. as shown in Figure 3
报错:Worksheet row or column index out of range. 参考:异常码列表 。https://xlswriter-docs.viest.me/zh-cn/exception/code 。工作表的行或列索引超出Excel规定范围,请检查数组键值
Figure 3


VtifulKernelException: Worksheet row or column index out of range. in E:wwwrootobjectappServicesExportService.php:107
Stack trace:
#0 E:wwwrootobjectappServicesExportService.php(107): VtifulKernelExcel->data(Array)
#1 E:wwwrootobjectModulesOrderServicesOrderExportService.php(581): AppServicesExportService->writeRows(Array)
#2 E:wwwrootobjectModulesOrderServicesOrderExportService.php(230): ModulesOrderServicesOrderExportService->exportCheck(Array, Array, 'xE8xAExA2xE5x8Dx95xE5xAFxBCxE5x87xBAxE4xBBxBB...')
#3 E:wwwrootobjectModulesOrderJobsOrderExportJob.php(52): ModulesOrderServicesOrderExportService->exportOrderExcel(Array, Object(AppModelsJobStatus))
#4 E:wwwrootobjectvendorlaravelframeworksrcIlluminateContainerBoundMethod.php(36): ModulesOrderJobsOrderExportJob->handle()
#5 E:wwwrootobjectvendorlaravelframeworksrcIlluminateContainerUtil.php(41): IlluminateContainerBoundMethod::IlluminateContainer{closure}()
#6 E:wwwrootobjectvendorlaravelframeworksrcIlluminateContainerBoundMethod.php(93): IlluminateContainerUtil::unwrapIfClosure(Object(Closure))
#7 E:wwwrootobjectvendorlaravelframeworksrcIlluminateContainerBoundMethod.php(37): IlluminateContainerBoundMethod::callBoundMethod(Object(IlluminateFoundationApplication), Array, Object(Closure))
#8 E:wwwrootobjectvendorlaravelframeworksrcIlluminateContainerContainer.php(651): IlluminateContainerBoundMethod::call(Object(IlluminateFoundationApplication), Array, Array, NULL)
#9 E:wwwrootobjectvendorlaravelframeworksrcIlluminateBusDispatcher.php(128): IlluminateContainerContainer->call(Array)
#10 E:wwwrootobjectvendorlaravelframeworksrcIlluminatePipelinePipeline.php(141): IlluminateBusDispatcher->IlluminateBus{closure}(Object(ModulesOrderJobsOrderExportJob))
#11 E:wwwrootobjectvendorlaravelframeworksrcIlluminatePipelinePipeline.php(116): IlluminatePipelinePipeline->IlluminatePipeline{closure}(Object(ModulesOrderJobsOrderExportJob))
#12 E:wwwrootobjectvendorlaravelframeworksrcIlluminateBusDispatcher.php(132): IlluminatePipelinePipeline->then(Object(Closure))
#13 E:wwwrootobjectvendorlaravelframeworksrcIlluminateQueueCallQueuedHandler.php(124): IlluminateBusDispatcher->dispatchNow(Object(ModulesOrderJobsOrderExportJob), false)
#14 E:wwwrootobjectvendorlaravelframeworksrcIlluminatePipelinePipeline.php(141): IlluminateQueueCallQueuedHandler->IlluminateQueue{closure}(Object(ModulesOrderJobsOrderExportJob))
#15 E:wwwrootobjectvendorlaravelframeworksrcIlluminatePipelinePipeline.php(116): IlluminatePipelinePipeline->IlluminatePipeline{closure}(Object(ModulesOrderJobsOrderExportJob))
#16 E:wwwrootobjectvendorlaravelframeworksrcIlluminateQueueCallQueuedHandler.php(126): IlluminatePipelinePipeline->then(Object(Closure))
#17 E:wwwrootobjectvendorlaravelframeworksrcIlluminateQueueCallQueuedHandler.php(70): IlluminateQueueCallQueuedHandler->dispatchThroughMiddleware(Object(IlluminateQueueJobsRedisJob), Object(ModulesOrderJobsOrderExportJob))
#18 E:wwwrootobjectvendorlaravelframeworksrcIlluminateQueueJobsJob.php(98): IlluminateQueueCallQueuedHandler->call(Object(IlluminateQueueJobsRedisJob), Array)
#19 E:wwwrootobjectvendorlaravelframeworksrcIlluminateQueueWorker.php(425): IlluminateQueueJobsJob->fire()
#20 E:wwwrootobjectvendorlaravelframeworksrcIlluminateQueueWorker.php(375): IlluminateQueueWorker->process('redis', Object(IlluminateQueueJobsRedisJob), Object(IlluminateQueueWorkerOptions))
#21 E:wwwrootobjectvendorlaravelframeworksrcIlluminateQueueWorker.php(173): IlluminateQueueWorker->runJob(Object(IlluminateQueueJobsRedisJob), 'redis', Object(IlluminateQueueWorkerOptions))
#22 E:wwwrootobjectvendorlaravelframeworksrcIlluminateQueueConsoleWorkCommand.php(150): IlluminateQueueWorker->daemon('redis', 'export_queue', Object(IlluminateQueueWorkerOptions))
#23 E:wwwrootobjectvendorlaravelframeworksrcIlluminateQueueConsoleWorkCommand.php(134): IlluminateQueueConsoleWorkCommand->runWorker('redis', 'export_queue')
#24 E:wwwrootobjectvendorlaravelframeworksrcIlluminateContainerBoundMethod.php(36): IlluminateQueueConsoleWorkCommand->handle()
#25 E:wwwrootobjectvendorlaravelframeworksrcIlluminateContainerUtil.php(41): IlluminateContainerBoundMethod::IlluminateContainer{closure}()
#26 E:wwwrootobjectvendorlaravelframeworksrcIlluminateContainerBoundMethod.php(93): IlluminateContainerUtil::unwrapIfClosure(Object(Closure))
#27 E:wwwrootobjectvendorlaravelframeworksrcIlluminateContainerBoundMethod.php(37): IlluminateContainerBoundMethod::callBoundMethod(Object(IlluminateFoundationApplication), Array, Object(Closure))
#28 E:wwwrootobjectvendorlaravelframeworksrcIlluminateContainerContainer.php(651): IlluminateContainerBoundMethod::call(Object(IlluminateFoundationApplication), Array, Array, NULL)
#29 E:wwwrootobjectvendorlaravelframeworksrcIlluminateConsoleCommand.php(144): IlluminateContainerContainer->call(Array)
#30 E:wwwrootobjectvendorsymfonyconsoleCommandCommand.php(312): IlluminateConsoleCommand->execute(Object(SymfonyComponentConsoleInputArgvInput), Object(IlluminateConsoleOutputStyle))
#31 E:wwwrootobjectvendorlaravelframeworksrcIlluminateConsoleCommand.php(126): SymfonyComponentConsoleCommandCommand->run(Object(SymfonyComponentConsoleInputArgvInput), Object(IlluminateConsoleOutputStyle))
#32 E:wwwrootobjectvendorsymfonyconsoleApplication.php(1022): IlluminateConsoleCommand->run(Object(SymfonyComponentConsoleInputArgvInput), Object(SymfonyComponentConsoleOutputConsoleOutput))
#33 E:wwwrootobjectvendorsymfonyconsoleApplication.php(314): SymfonyComponentConsoleApplication->doRunCommand(Object(IlluminateQueueConsoleWorkCommand), Object(SymfonyComponentConsoleInputArgvInput), Object(SymfonyComponentConsoleOutputConsoleOutput))
#34 E:wwwrootobjectvendorsymfonyconsoleApplication.php(168): SymfonyComponentConsoleApplication->doRun(Object(SymfonyComponentConsoleInputArgvInput), Object(SymfonyComponentConsoleOutputConsoleOutput))
#35 E:wwwrootobjectvendorlaravelframeworksrcIlluminateConsoleApplication.php(102): SymfonyComponentConsoleApplication->run(Object(SymfonyComponentConsoleInputArgvInput), Object(SymfonyComponentConsoleOutputConsoleOutput))
#36 E:wwwrootobjectvendorlaravelframeworksrcIlluminateFoundationConsoleKernel.php(151): IlluminateConsoleApplication->run(Object(SymfonyComponentConsoleInputArgvInput), Object(SymfonyComponentConsoleOutputConsoleOutput))
#37 E:wwwrootobjectartisan(37): IlluminateFoundationConsoleKernel->handle(Object(SymfonyComponentConsoleInputArgvInput), Object(SymfonyComponentConsoleOutputConsoleOutput))
#38 {main}

Next VtifulKernelException: Worksheet row or column index out of range. in E:wwwrootobjectappServicesExportService.php:107
Stack trace:
#0 E:wwwrootobjectappServicesExportService.php(107): VtifulKernelExcel->data(Array)
#1 E:wwwrootobjectModulesOrderServicesOrderExportService.php(581): AppServicesExportService->writeRows(Array)
#2 E:wwwrootobjectModulesOrderServicesOrderExportService.php(230): ModulesOrderServicesOrderExportService->exportCheck(Array, Array, 'xE8xAExA2xE5x8Dx95xE5xAFxBCxE5x87xBAxE4xBBxBB...')
#3 E:wwwrootobjectModulesOrderJobsOrderExportJob.php(52): ModulesOrderServicesOrderExportService->exportOrderExcel(Array, Object(AppModelsJobStatus))
#4 E:wwwrootobjectvendorlaravelframeworksrcIlluminateContainerBoundMethod.php(36): ModulesOrderJobsOrderExportJob->handle()
#5 E:wwwrootobjectvendorlaravelframeworksrcIlluminateContainerUtil.php(41): IlluminateContainerBoundMethod::IlluminateContainer{closure}()
#6 E:wwwrootobjectvendorlaravelframeworksrcIlluminateContainerBoundMethod.php(93): IlluminateContainerUtil::unwrapIfClosure(Object(Closure))
#7 E:wwwrootobjectvendorlaravelframeworksrcIlluminateContainerBoundMethod.php(37): IlluminateContainerBoundMethod::callBoundMethod(Object(IlluminateFoundationApplication), Array, Object(Closure))
#8 E:wwwrootobjectvendorlaravelframeworksrcIlluminateContainerContainer.php(651): IlluminateContainerBoundMethod::call(Object(IlluminateFoundationApplication), Array, Array, NULL)
#9 E:wwwrootobjectvendorlaravelframeworksrcIlluminateBusDispatcher.php(128): IlluminateContainerContainer->call(Array)
#10 E:wwwrootobjectvendorlaravelframeworksrcIlluminatePipelinePipeline.php(141): IlluminateBusDispatcher->IlluminateBus{closure}(Object(ModulesOrderJobsOrderExportJob))
#11 E:wwwrootobjectvendorlaravelframeworksrcIlluminatePipelinePipeline.php(116): IlluminatePipelinePipeline->IlluminatePipeline{closure}(Object(ModulesOrderJobsOrderExportJob))
#12 E:wwwrootobjectvendorlaravelframeworksrcIlluminateBusDispatcher.php(132): IlluminatePipelinePipeline->then(Object(Closure))
#13 E:wwwrootobjectvendorlaravelframeworksrcIlluminateQueueCallQueuedHandler.php(124): IlluminateBusDispatcher->dispatchNow(Object(ModulesOrderJobsOrderExportJob), false)
#14 E:wwwrootobjectvendorlaravelframeworksrcIlluminatePipelinePipeline.php(141): IlluminateQueueCallQueuedHandler->IlluminateQueue{closure}(Object(ModulesOrderJobsOrderExportJob))
#15 E:wwwrootobjectvendorlaravelframeworksrcIlluminatePipelinePipeline.php(116): IlluminatePipelinePipeline->IlluminatePipeline{closure}(Object(ModulesOrderJobsOrderExportJob))
#16 E:wwwrootobjectvendorlaravelframeworksrcIlluminateQueueCallQueuedHandler.php(126): IlluminatePipelinePipeline->then(Object(Closure))
#17 E:wwwrootobjectvendorlaravelframeworksrcIlluminateQueueCallQueuedHandler.php(70): IlluminateQueueCallQueuedHandler->dispatchThroughMiddleware(Object(IlluminateQueueJobsRedisJob), Object(ModulesOrderJobsOrderExportJob))
#18 E:wwwrootobjectvendorlaravelframeworksrcIlluminateQueueJobsJob.php(98): IlluminateQueueCallQueuedHandler->call(Object(IlluminateQueueJobsRedisJob), Array)
#19 E:wwwrootobjectvendorlaravelframeworksrcIlluminateQueueWorker.php(425): IlluminateQueueJobsJob->fire()
#20 E:wwwrootobjectvendorlaravelframeworksrcIlluminateQueueWorker.php(375): IlluminateQueueWorker->process('redis', Object(IlluminateQueueJobsRedisJob), Object(IlluminateQueueWorkerOptions))
#21 E:wwwrootobjectvendorlaravelframeworksrcIlluminateQueueWorker.php(173): IlluminateQueueWorker->runJob(Object(IlluminateQueueJobsRedisJob), 'redis', Object(IlluminateQueueWorkerOptions))
#22 E:wwwrootobjectvendorlaravelframeworksrcIlluminateQueueConsoleWorkCommand.php(150): IlluminateQueueWorker->daemon('redis', 'export_queue', Object(IlluminateQueueWorkerOptions))
#23 E:wwwrootobjectvendorlaravelframeworksrcIlluminateQueueConsoleWorkCommand.php(134): IlluminateQueueConsoleWorkCommand->runWorker('redis', 'export_queue')
#24 E:wwwrootobjectvendorlaravelframeworksrcIlluminateContainerBoundMethod.php(36): IlluminateQueueConsoleWorkCommand->handle()
#25 E:wwwrootobjectvendorlaravelframeworksrcIlluminateContainerUtil.php(41): IlluminateContainerBoundMethod::IlluminateContainer{closure}()
#26 E:wwwrootobjectvendorlaravelframeworksrcIlluminateContainerBoundMethod.php(93): IlluminateContainerUtil::unwrapIfClosure(Object(Closure))
#27 E:wwwrootobjectvendorlaravelframeworksrcIlluminateContainerBoundMethod.php(37): IlluminateContainerBoundMethod::callBoundMethod(Object(IlluminateFoundationApplication), Array, Object(Closure))
#28 E:wwwrootobjectvendorlaravelframeworksrcIlluminateContainerContainer.php(651): IlluminateContainerBoundMethod::call(Object(IlluminateFoundationApplication), Array, Array, NULL)
#29 E:wwwrootobjectvendorlaravelframeworksrcIlluminateConsoleCommand.php(144): IlluminateContainerContainer->call(Array)
#30 E:wwwrootobjectvendorsymfonyconsoleCommandCommand.php(312): IlluminateConsoleCommand->execute(Object(SymfonyComponentConsoleInputArgvInput), Object(IlluminateConsoleOutputStyle))
#31 E:wwwrootobjectvendorlaravelframeworksrcIlluminateConsoleCommand.php(126): SymfonyComponentConsoleCommandCommand->run(Object(SymfonyComponentConsoleInputArgvInput), Object(IlluminateConsoleOutputStyle))
#32 E:wwwrootobjectvendorsymfonyconsoleApplication.php(1022): IlluminateConsoleCommand->run(Object(SymfonyComponentConsoleInputArgvInput), Object(SymfonyComponentConsoleOutputConsoleOutput))
#33 E:wwwrootobjectvendorsymfonyconsoleApplication.php(314): SymfonyComponentConsoleApplication->doRunCommand(Object(IlluminateQueueConsoleWorkCommand), Object(SymfonyComponentConsoleInputArgvInput), Object(SymfonyComponentConsoleOutputConsoleOutput))
#34 E:wwwrootobjectvendorsymfonyconsoleApplication.php(168): SymfonyComponentConsoleApplication->doRun(Object(SymfonyComponentConsoleInputArgvInput), Object(SymfonyComponentConsoleOutputConsoleOutput))
#35 E:wwwrootobjectvendorlaravelframeworksrcIlluminateConsoleApplication.php(102): SymfonyComponentConsoleApplication->run(Object(SymfonyComponentConsoleInputArgvInput), Object(SymfonyComponentConsoleOutputConsoleOutput))
#36 E:wwwrootobjectvendorlaravelframeworksrcIlluminateFoundationConsoleKernel.php(151): IlluminateConsoleApplication->run(Object(SymfonyComponentConsoleInputArgvInput), Object(SymfonyComponentConsoleOutputConsoleOutput))
#37 E:wwwrootobjectartisan(37): IlluminateFoundationConsoleKernel->handle(Object(SymfonyComponentConsoleInputArgvInput), Object(SymfonyComponentConsoleOutputConsoleOutput))
#38 {main}



10. The reason for the final discovery is that the array of $this->excel->data($data); $data is caused by the associated array. When the array is indexed, an error is no longer reported: Worksheet Row or Column Index Out of Range. Continue to report errors:[ERROR]workbook_close(): Error Creating. In the end, I decided not to modify the code, and continue to use php-windows-xlswriter-cf7e1933-8.1-ts-vs16-x64, and the associated array is automatically compatible.


[
  {
    "plat_order_no": "GM20240204031613_3",
    "transaction_no": "202402041"
  }
]




[
  [
    "GM20240204031613_3",
    "202402041"
  ]
]


11. Finally found the direct cause, in the output(), the excel file was not generated successfully. The root cause is that the parameter of filename(); contains : , which in turn causes the excel file to not be generated. Rename an XLS file to: Order export task 2024-02-19 17:42:32, it will be automatically adjusted to: Order export task 2024-02-19 174232. Tip: The file name cannot contain any of the following characters: \:*?”<<>| . As shown in Figure 4
最终找到直接原因,在于 output() 时,Excel 文件未生成成功。根本原因在于 fileName(); 的参数中包含了 : ,进而导致 Excel 文件未生成。将一个 xls 文件重命名为:订单导出任务2024-02-19 17:42:32,会自动调整为:订单导出任务2024-02-19 174232。提示:文件名不能包含下列任何字符: \:*?&quot;&lt;&lt;&gt;|
Figure 4
12. Replace : in the filename after _. Exporting Excel file was successful.

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.