在本地启动和运行现有symfony2应用程序的问题

时间:2015-01-25 13:00:02

标签: git symfony composer-php

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

以下是我的不同尝试

  1. " php app \ console服务器:运行" 提供" proc_open():CreateProcess 失败,错误代码 - 267 [...]"

  2. 我做了"作曲家更新" 但这会导致错误"无法执行git状态--porcelain --untracked-files = no / n错误:错误索引文件sha1签名/ n致命:索引文件损坏" 。对于几个第三方捆绑包会发生此错误。

  3. 在互联网上搜索显示我应该使用" rm -f .git / index; git 复位" 即可。这在主项目文件夹中执行时没有区别。我也在第三方软件包的特定文件夹中完成了这项工作,因为它们还包含.git / index。这会产生新的错误:' atal:引用的格式无效:' refs / remotes / origin / master
  4.   

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

         

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

         

    备注:使用composer进行更新时,此特定捆绑包不存在问题(请参阅步骤2),该类可在" vendor \ symfony \ swiftmailer-中找到bundle \ SwiftmailerBundle.php" 并在自动加载中添加*"' Symfony \ Bundle \ SwiftmailerBundle' =>数组($ vendorDir。' / symfony / swiftmailer-bundle'),"

    我一直在解决每一个新问题,但我在这里无处可去。我是通过FTP复制项目做错了吗?我没有得到原始开发人员作为git存储库访问项目的任何响应。

2 个答案:

答案 0 :(得分:0)

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

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

我已经读到这可能是由于索引损坏而发生的。

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

您是否尝试过此Laravel4 Composer update failing链接?我在这里找到了更多答案!

答案 1 :(得分:0)

您使用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"
        ]
    },