Azure上的"php composer.phar install"错误"无法终止进程"错误

Nik*_*Nik 11 php azure symfony

我正在尝试将我的Symfony 2应用程序部署到Microsoft Azure网站云.为此,我遵循本指南中的步骤http://symfony.com/doc/current/cookbook/deployment/azure-website.html#configure-the-symfony-application

现在,当我进入"配置Symfony应用程序"步骤时,我运行命令php composer.phar install.-d extension=php_intl.dll由于扩展已加载,我省略了开关.我实际上尝试了两者,它没有任何区别.

现在,在运行安装后命令时,我收到以下错误:

[Symfony\Component\Process\Exception\RuntimeException]
Unable to kill the process                              
Run Code Online (Sandbox Code Playgroud)

我尝试增加max_execution_time(但无论如何都设置为0)并尝试将SCM_COMMAND_IDLE_TIMEOUTapp_settings中的参数设置为3600这样的值.仍然无法正常工作.

有任何想法吗?这是完整的输出:

D:\home\site\wwwroot>php composer.phar install
 Loading composer repositories with package information

Installing dependencies (including require-dev) from lock file

Warning: The lock file is not up to date with the latest changes in composer.json. You may be getting outdated dependencies. Run update to update them.

Nothing to install or update

Generating autoload files

> Incenteev\ParameterHandler\ScriptHandler::buildParameters

Updating the "app/config/parameters.yml" file

> Sensio\Bundle\DistributionBundle\Composer\ScriptHandler::buildBootstrap

> Sensio\Bundle\DistributionBundle\Composer\ScriptHandler::clearCache

Script Sensio\Bundle\DistributionBundle\Composer\ScriptHandler::clearCache handling the post-install-cmd event terminated with an exception







  [Symfony\Component\Process\Exception\RuntimeException]  

  Unable to kill the process                              







install [--prefer-source] [--prefer-dist] [--dry-run] [--dev] [--no-dev] [--no-plugins] [--no-custom-installers] [--no-autoloader] [--no-scripts] [--no-    progress] [-v|vv|vvv|--verbose] [-o|--optimize-autoloader] [--ignore-platform-reqs] [packages1] ... [packagesN]






Fatal error: Uncaught exception 'Symfony\Component\Process\Exception\RuntimeException' with message 'Unable to kill the process' in phar://D:/home/site/wwwroot    /composer.phar/vendor/symfony/process/Symfony/Component/Process/Process.php:801
Stack trace:
#0 phar://D:/home/site/wwwroot/composer.phar/vendor/symfony/process/Symfony/Component/Process/Process.php(177): Symfony\Component\Process\Process->stop()
#1 [internal function]: Symfony\Component\Process\Process->__destruct()
#2 {main}
  thrown in phar://D:/home/site/wwwroot/composer.phar/vendor/symfony/process/Symfony/Component/Process/Process.php on line 801
Run Code Online (Sandbox Code Playgroud)

Gar*_*SFT 3

我尝试重现您的问题,但失败了,作曲家在我的 Azure 项目中运行良好。请尝试以下步骤:

1、使用 MySQL 数据库在 Azure 上创建 Web 应用程序并从 git 设置部署。

2、通过cmdlet在本地创建一个新的symfony 2.7项目:

php -r "readfile('http://symfony.com/installer');" > symfony

symfony new my_project
Run Code Online (Sandbox Code Playgroud)

然后将项目部署到Web应用程序上。

3、切换回Kudu应用的在线控制台,执行以下命令:

"cd site\wwwroot"

"curl -sS https://getcomposer.org/installer | php"

"php composer.phar install"
Run Code Online (Sandbox Code Playgroud)

4、回答composer安装过程中出现的提示问题。

对我来说效果很好。

顺便说一句,当作曲家清理项目环境中的缓存时,超时 RuntimeException 似乎有问题。有2种方法可以处理:

1、我们可以在部署到Azure之前手动清理缓存。

2、我们可以在.c中设置命令执行超时选项composer.json。在composer.Json文件中,有这样的代码:

"config": {
   "bin-dir": "bin",
   "process-timeout":0 
}, 
Run Code Online (Sandbox Code Playgroud)

我们添加“process-timeout:0”来消除命令执行时间的限制。