【Azure App Service】Web Job 报错 UNC paths are not supported. Defaulting to Windows directory.

问题描述

PHP的Web Job,通过artisan来配置路径启动PHP任务,相关启动脚本如下:

artisan_path = "d:\\home\\site\\wwwroot";

cd ${artisan_path}
echo "\n"
pwd

php artisan schedule:run

但是,在运行的时候遇见报错:

[07/06/2023 01:57:31 > 0f21a2: INFO] /d/home/site/wwwroot
[07/06/2023 01:57:32 > 0f21a2: ERR ] '\\10.0.176.8\volume-30-default\532b2b267e7c072\a7d3f0082847394a45e5733bdeceafa2488ae\site\wwwroot'
[07/06/2023 01:57:32 > 0f21a2: ERR ] CMD.EXE was started with the above path as the current directory.
[07/06/2023 01:57:32 > 0f21a2: ERR ] UNC paths are not supported.  Defaulting to Windows directory.
[07/06/2023 01:57:33 > 0f21a2: INFO] No scheduled commands are ready to run.

 

问题解答

报错为UNC Paths不支持,所以最开始的解决办法就是把 artisan 的路径配置写为默认的 “ d:\home\site\wwwroot\artisa ” 全路径作为临时方案来解决问题。

 

另一种不用修改 artisan 配置代码的方案是为 App Service增加一个  MSYS 配置,设置值为: nonativeinnerlinks。

 

参考资料

PHP artisan: Artisan是Laravel中自带的命令行工具的名称。它提供了一些开发过程中有用的命令用。它是基于强大的Symfony Console 组件开发的。https://docs.golaravel.com/docs/4.0/artisan

UNC paths:Universal Naming Convention。格式:\servername\sharename,其中servername是服务器名。sharename是共享资源的名称。 https://learn.microsoft.com/en-us/answers/questions/1167298/kudu-deployment-script-throws-unc-path-error?page=1

MSYS : Minimal GNU(POSIX)system on Windows,是一个小型的GNU环境,包括基本的bash,make等等。是Windows下最优秀的GNU环境 https://github.com/msys2/msys2.github.io/issues/152

 

posted @   路边两盏灯  阅读(50)  评论(0编辑  收藏  举报
相关博文:
阅读排行:
· DeepSeek 开源周回顾「GitHub 热点速览」
· 物流快递公司核心技术能力-地址解析分单基础技术分享
· .NET 10首个预览版发布:重大改进与新特性概览!
· AI与.NET技术实操系列(二):开始使用ML.NET
· 单线程的Redis速度为什么快?
历史上的今天:
2022-07-13 【Azure 存储服务】Hadoop集群中使用ADLS(Azure Data Lake Storage)过程中遇见执行PUT操作报错
2021-07-13 【Azure 应用服务】Azure Function App使用SendGrid发送邮件遇见异常消息The operation was canceled,分析源码渐入最源端
点击右上角即可分享
微信分享提示