【问题标题】:Composer install Symfony 3.4 - bootstrap.php.cache作曲家安装 Symfony 3.4 - bootstrap.php.cache
【发布时间】:2018-11-14 23:05:08
【问题描述】:

在我的项目安装过程中,我必须安装和更新我的作曲家。但是我不能这样做,因为作曲家告诉我这个:

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

Warning: require_once(C:\Projects\private\p1\../app/bootstrap.php.cache): failed to open stream: No such file or directory in C:\Projects\private\p1\bin\console on line 11

Fatal error: require_once(): Failed opening required 'C:\Projects\private\p1\bin/../app/bootstrap.php.cache' (include_path='.;C:\php\pear') in C:\Projects\private\p1\bin\console on line 11
Script Sensio\Bundle\DistributionBundle\Composer\ScriptHandler::clearCache handling the post-install-cmd event terminated with an exception


  [RuntimeException]
  An error occurred when executing the ""cache:clear --no-warmup"" command:


  Warning: require_once(C:\Projects\private\p1\bin/../app/bootstrap.php.cache): failed to open stream
  : No such file or directory in C:\Projects\private\p1\bin\console on line 11

  Fatal error: require_once(): Failed opening required 'C:\Projects\private\p1\bin/../app/bootstrap.php.cache' (include_path='.;C:\php\pear') in C:\Projects\private\p1\bin\console on line 11

我已经搜索了 2 天的答案,我已经尝试了我在互联网上看到的所有内容......

我不知道你是否需要其他东西,但请帮助我

【问题讨论】:

  • 你能用composer.json文件的内容更新你的问题吗?

标签: php symfony nginx doctrine


【解决方案1】:

如果 bootstrap.php.cache 文件因其他原因未创建。一般应该是在你的项目目录下运行composer install后生成的。

如果您需要手动生成它,只需在您的 Symfony 项目文件夹中运行以下命令:

php vendor/sensio/distribution-bundle/Sensio/Bundle/DistributionBundle/Resources/bin/build_bootstrap.php

如果你有新的 Symfony 3 文件夹结构,你需要添加三个参数:

php vendor/sensio/distribution-bundle/Sensio/Bundle/DistributionBundle/Resources/bin/build_bootstrap.php var app new

然后该文件将在 var/bootstrap.php.cache 而不是 app/bootstrap.php.cache 中生成。

【讨论】:

  • 非常感谢您的时间和解释,它成功了!再见:)
  • 这是我能做的最少的事情。
【解决方案2】:

解决问题的步骤:

  1. 运行这个命令:bin/console cache:clear --env=prod
  2. 运行此chown www-data:www-data projectDirectory
  3. 运行这个命令SYMFONY_ENV=prod composer install --no-dev -o --prefer-dist
  4. 运行此命令chown www-data:www-data projectDirectory

【讨论】:

  • 你能检查一下你有没有这个文件吗?它应该是由 composer 安装后命令生成的。因此,要么失败,要么您的网络服务器无权读取该文件夹中的任何内容。
  • 我没有它,但我看到它在我的 gitignore 文件中,我不知道这是否改变了什么
  • 试试我的下一个回复
猜你喜欢
  • 2018-07-03
  • 2018-03-20
  • 2016-08-14
  • 2019-11-28
  • 1970-01-01
  • 2019-06-03
  • 2019-11-18
  • 2018-10-21
  • 2015-03-02
相关资源
最近更新 更多