简体   繁体   English

无法安装Composer Azure服务器

[英]Failed to install Composer Azure Server

I'm trying install composer on azure portal from extension and it throw: 我正在尝试从扩展名在azure门户上安装composer并抛出:

Failed to install Composer - ExitCode: -1073741819, Output: D:\\home\\SiteExtensions\\ComposerExtension># Install Composer D:\\home\\SiteExtensions\\ComposerExtension>cd Commands D:\\home\\SiteExtensions\\ComposerExtension\\Commands>IF EXIST composer.phar (rm -f composer.phar ) D:\\home\\SiteExtensions\\ComposerExtension\\Commands>IF NOT EXIST "D:\\local\\AppData\\Composer" (mkdir "D:\\local\\AppData\\Composer" ) D:\\home\\SiteExtensions\\ComposerExtension\\Commands>IF NOT EXIST "D:\\local\\LocalAppData\\Composer" (mkdir "D:\\local\\LocalAppData\\Composer" ) D:\\home\\SiteExtensions\\ComposerExtension\\Commands>php -r "readfile(' https://getcomposer.org/installer ');" 无法安装Composer-退出代码:-1073741819,输出:D:\\ home \\ SiteExtensions \\ ComposerExtension>#安装Composer D:\\ home \\ SiteExtensions \\ ComposerExtension> cd命令D:\\ home \\ SiteExtensions \\ ComposerExtension \\ Commands> IF EXIST作曲家。 phar(rm -f composer.phar)D:\\ home \\ SiteExtensions \\ ComposerExtension \\ Commands>如果不存在“ D:\\ local \\ AppData \\ Composer”(mkdir“ D:\\ local \\ AppData \\ Composer”)D:\\ home \\ SiteExtensions \\ ComposerExtension \\ Commands>如果不存在“ D:\\ local \\ LocalAppData \\ Composer”(mkdir“ D:\\ local \\ LocalAppData \\ Composer”)D:\\ home \\ SiteExtensions \\ ComposerExtension \\ Commands> php -r“ readfile( ' https://getcomposer.org/installer ');“ | | php, Error: '#' is not recognized as an internal or external command, operable program or batch file., Kudu.Core.Infrastructure.CommandLineException: '#' is not recognized as an internal or external command, operable program or batch file. php,错误:'#'不被识别为内部或外部命令,可操作程序或批处理文件。Kudu.Core.Infrastructure.CommandLineException:'#'不被识别为内部或外部命令,可操作程序或批处理文件。 D:\\home\\SiteExtensions\\ComposerExtension\\install.cmd at Kudu.Core.Infrastructure.Executable.ExecuteInternal(ITracer tracer, Func 2 onWriteOutput, Func 2 onWriteError, Encoding encoding, String arguments, Object[] args) at Kudu.Core.Infrastructure.Executable.ExecuteWithProgressWriter(ILogger logger, ITracer tracer, String arguments, Object[] args) at Kudu.Core.SiteExtensions.SiteExtensionManager.<>c__DisplayClass25_1.b__1() at Kudu.Core.Infrastructure.OperationManager.<>c__DisplayClass2_0.b__0() at Kudu.Core.Infrastructure.OperationManager.Attempt[T](Func 1 action, Int32 retries, Int32 delayBeforeRetry, Func 2 shouldRetry) at Kudu.Core.Infrastructure.OperationManager.Attempt(Action action, Int32 retries, Int32 delayBeforeRetry) at Kudu.Core.SiteExtensions.SiteExtensionManager.d__25.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwai Kudu.Core.Infrastructure.Executable.ExecuteInternal上的D:\\ home \\ SiteExtensions \\ ComposerExtension \\ install.cmd(ITracer跟踪器,Func 2 onWriteOutput, Func 2 onWriteError,编码编码,字符串参数,Object [] args)在Kudu.Core。在Kudu.Core.SiteExtensions.SiteExtensionManager。<> c__DisplayClass25_1.b__1()在Kudu.Core.Infrastructure.OperationManager。<> c__DisplayClass2_0.b__0处的Infrastructure.Executable.ExecuteWithProgressWriter(ILogger记录器,ITracer跟踪器,字符串参数,Object [] args) ()在Kudu.Core.Infrastructure.OperationManager.Attempt( 1 action, Int32 retries, Int32 delayBeforeRetry, Func 2应该1 action, Int32 retries, Int32 delayBeforeRetry, Func )(动作在动作,Int32重试,Int32 delayBeforeRetry)在Kudu.Core.SiteExtensions.SiteExtensionManager.d__25.MoveNext()处-从上一个引发异常的位置开始的堆栈跟踪-在System.Runtime处System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task任务) CompilerServices.TaskAwai ter.HandleNonSuccessAndDebuggerNotification(Task task) at Kudu.Core.SiteExtensions.SiteExtensionManager.d__24.MoveNext() Kudu.Core.SiteExtensions.SiteExtensionManager.d__24.MoveNext()上的ter.HandleNonSuccessAndDebuggerNotification(任务任务)

Thank for your help. 谢谢您帮忙。

In my test, it seems due to the build in PHP runtime version. 在我的测试中,这似乎归因于PHP运行时版本中的构建。 I will reproduce your issue if I set the PHP version to 7.1 in Azure portal. 如果在Azure门户中将PHP版本设置为7.1,我将重现您的问题。 But the composer extension will be installed fine if I downgrade the build in PHP version to 7.0. 但是,如果我将PHP版本的版本降级到7.0,将会很好地安装composer扩展程序。

So currently, you can downgrade the PHP runtime to 7.0 as a workaround. 因此,目前,您可以将PHP运行时降级到7.0。 Or try to manually download composer.phar extension in your project. 或尝试在项目中手动下载composer.phar扩展名。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM