Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/symfony/6.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/qt/7.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Composer安装Symfony 3.4-bootstrap.php.cache_Php_Symfony_Nginx_Doctrine - Fatal编程技术网

Composer安装Symfony 3.4-bootstrap.php.cache

Composer安装Symfony 3.4-bootstrap.php.cache,php,symfony,nginx,doctrine,Php,Symfony,Nginx,Doctrine,在安装我的项目期间,我必须安装并更新我的composer。但我不能这么做,因为作曲家告诉我: > Sensio\Bundle\DistributionBundle\Composer\ScriptHandler::buildBootstrap > Sensio\Bundle\DistributionBundle\Composer\ScriptHandler::clearCache Warning: require_once(C:\Projects\private\p1\../app/

在安装我的项目期间,我必须安装并更新我的composer。但我不能这么做,因为作曲家告诉我:

> 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
我已经搜索了两天的答案,我已经尝试了所有我能在互联网上看到的东西


我不知道您是否需要其他服务,但请帮助我解决问题的步骤:

  • 运行此命令:
    bin/console cache:clear--env=prod
  • 运行此
    chown www-data:www-data-projectDirectory
  • 运行此命令
    SYMFONY\u ENV=prod composer install--no dev-o--preference dist
  • 运行此命令
    chown www-data:www-data-projectDirectory

  • 如果由于不同的原因没有创建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中生成。

    能否检查您是否拥有该文件?不支持由composer通过安装后命令生成。所以要么失败,要么你的Web服务器没有权限读取该文件夹中的任何内容。我没有它,但我看到它在我的gitignore文件中,我不知道这是否有什么变化请尝试我的下一个回答您可以用
    composer.json
    文件的内容更新您的问题吗?非常感谢您的时间和解释,它成功了!再见:)这是我至少能做的。