【问题标题】:Problems getting existing symfony2 app up and running locally在本地启动和运行现有 symfony2 应用程序的问题
【发布时间】:2015-03-24 01:44:10
【问题描述】:

我目前正在为现有的 Web 应用程序实施一项新功能。这个 webapp 是用 Symfony2 开发的。我已经使用 FTP 从服务器复制了整个 webapp,但现在正在努力让该应用程序在本地运行。每次我尝试解决一个问题(通过在互联网上查找)都会出现一个新问题。

这是我做过的不同尝试

  1. "php app\console server:run" 给出 "proc_open(): CreateProcess 失败,错误代码 - 267 [...]"

  2. 我做了 "composer update" 但这给出了错误 "Failed to execute git status --porcelain --untracked-files=no /n error: bad index file sha1 signature /n致命:索引文件损坏“。几个第三方捆绑包会出现此错误。

  3. 网上搜索显示我应该使用 "rm -f .git/index;git 重置”。这在主项目文件夹中执行时没有什么区别。我也在第三方包的特定文件夹中完成了此操作,因为它们还包含一个 .git/index。这给出了一个新的错误:'atal:参考格式无效:'refs/remotes/origin/master

同时 - 在第 2 步之后 - 当尝试在服务器上运行应用程序时会出现新类型的错误:

致命错误:在第 16 行的 C:\PATH-TO-APP\app\AppKernel.php 中找不到类“Symfony\Bundle\SwiftmailerBundle\SwiftmailerBundle”。

备注:这个特定的bundle在用composer更新时没有问题(见步骤2),类可以在"vendor\symfony\swiftmailer-bundle\SwiftmailerBundle .php" 并在自动加载中添加 *"'Symfony\Bundle\SwiftmailerBundle' => array($vendorDir . '/symfony/swiftmailer-bundle'),"

我一直在努力解决每一个新问题,但在这里我一无所获。通过 FTP 复制项目是不是我做错了什么?我没有得到原始开发人员的任何回应,以将项目作为 git 存储库访问。

【问题讨论】:

    标签: git symfony composer-php


    【解决方案1】:

    这似乎与我曾经遇到的一个问题非常相关:

    error: bad index file sha1 signature
    fatal: index file corrupt
    

    我了解到这可能是由于索引损坏而发生的。

    我读过一个解决方案是删除索引文件并重置分支(进行备份!)

    你试过这个链接Laravel4 Composer update failing吗?在这里我找到了更多答案!

    【讨论】:

    • 我之前确实找到了那个链接。但是删除索引并重置并不能解决它。它给出了一个新错误:'atal: Reference has invalid format: 'refs/remotes/origin/master.
    【解决方案2】:

    您在使用composer.phar update 时似乎有一些 git 钩子和脚本要运行

    您可以将您的 composer.json 文件编辑为 post-load 默认脚本,而不是您的特定脚本:

    "scripts": {
            "post-install-cmd": [
                "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::buildBootstrap",
                "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::clearCache",
                "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::installAssets",
                "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::installRequirementsFile"
            ],
            "post-update-cmd": [
                "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::buildBootstrap",
                "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::clearCache",
                "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::installAssets",
                "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::installRequirementsFile"
            ]
        },
    

    【讨论】:

      猜你喜欢
      • 2019-01-21
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2015-02-18
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多