“Unable to kill the process” error with “php composer.phar install” on Azure
我正在尝试将Symfony 2应用程序部署到Microsoft Azure网站云。
为此,我正在按照本指南中的步骤进行操作:http://symfony.com/doc/current/cookbook/deployment/azure-website.html#configure-the-symfony-application
现在,当我进入"配置Symfony应用程序"步骤时,我运行命令
现在,在运行安装后命令时,出现以下错误:
1 2 3 | [Symfony\\Component\\Process\\Exception\ untimeException] Unable to kill the process |
我尝试增加max_execution_time(但无论如何它都设置为0),并且还尝试将app_settings中的
有什么想法吗?
这是完整的输出:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 | 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\ untimeException] 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\ untimeException' 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 |
FYI
这是Symfony的官方下载站点,https://symfony.com/doc/current/book/installation.html#installing-the-symfony-installer
要在Azure上安装,请按照Windows的下载说明进行操作。希望能对您有所帮助。
FYI
我又测试了一次,看来composer.lock引起了一些问题。我删除了composer.lock,然后运行安装,它成功通过。
在尝试对其进行复制时,我遇到了相同的错误。超时是由于安装了以下两项引起的:
" Sensio \\\\ Bundle \\\\ DistributionBundle \\\\ Composer \\\\ ScriptHandler :: clearCache",
" Sensio \\\\ Bundle \\\\ DistributionBundle \\\\ Composer \\\\ ScriptHandler :: installAssets",
尝试解决:
从composer.json中删除ClearCache和InstallAsset,安装成功
重新添加这2个组件,再次安装即可。
由于Windows不支持符号链接,因此出现了有关符号链接的警告。这应该是另一个问题。
我试图重现您的问题,但是失败了,作曲家在我在Azure上的项目中运行得很好。请尝试以下步骤:
1,使用MySQL数据库在Azure上创建一个Web应用,并从git进行部署。
2,通过cmdlet在本地创建一个新的symfony 2.7项目:
1 2 3 | php -r"readfile('http://symfony.com/installer');"> symfony symfony new my_project |
然后在Web应用程序上部署项目。
3,切换回Kudu应用程序的在线控制台,执行以下命令:
1 2 3 4 5 | "cd site\\wwwroot" "curl -sS https://getcomposer.org/installer | php" "php composer.phar install" |
4,在作曲家安装过程中回答提示的问题。
对我来说很好。
顺便说一句,当作曲家清理项目环境中的缓存时,超时RuntimeException似乎有问题。有两种处理方法:
1,我们可以在部署到Azure之前手动清理缓存。
2,我们可以在
1 2 3 4 | "config": { "bin-dir":"bin", "process-timeout":0 }, |
我们添加" process-timeout:0"以消除命令执行时间的限制。