dongyishe6689 2015-01-06 07:47
浏览 53
已采纳

如何为symfony2框架配置$ this-> cwd

I am new to Symfony and I was assigned a Symfony 2 project.Now I am facing some problem with app/console server:run.

The project is a working system, therefore the problem should be because of my limited knowledge in Symfony framework.

this is what I keep getting

proc_open() : CreateProcess failed, error code - 267 in C:\xampp\htdocs\xxx\vendor\symfony\symfony\src\Symfony\Component\Process\Process.php on line 246.

line 246 is this part

  $this->process = proc_open($commandline, $descriptors, $this->processPipes->pipes, $this->cwd, $this->env, $this->options);

I have tried changing the $this->cwd to "C:/xampp/htdocs/xxx", it can run but it will have another problem which is after I visit localhost:8000, it shows this

Warning: require(app_dev.php): failed to open stream: No such file or directory in C:\xampp\xxx\vendor\symfony\symfony\src\Symfony\Bundle\FrameworkBundle\Resources\configouter_dev.php on line 30


Fatal error: require(): Failed opening required 'app_dev.php' (include_path='.;C:\xampp\php\PEAR') in C:\xampp\htdocs\xxx\vendor\symfony\symfony\src\Symfony\Bundle\FrameworkBundle\Resources\configouter_dev.php on line 30

Any ideas what is wrong?

EDIT:

I have updated all my files as suggested my Matteo, a few issues came up with the vendors and I have solved it for new (hopefully). However now I am stuck at another problem which is this

The given document root directory "C:/xampp/htdocs/xxx/app/../web" does not exist. 

As mentioned in the comments, I do not have a folder called "web". It was renamed to public. I have already changed the composer.json but it does not seem to do anything.

{
"name": "symfony/framework-standard-edition",
"license": "MIT",
"type": "project",
"description": "The \"Symfony Standard Edition\" distribution",
"autoload": {
    "psr-0": { "": "src/" }
},
"require": {
    "php": ">=5.3.3",
    "symfony/symfony": "~2.4",
    "doctrine/orm": "~2.2,>=2.2.3",
    "doctrine/doctrine-bundle": "~1.2",
    "twig/extensions": "~1.0",
    "symfony/assetic-bundle": "~2.3",
    "symfony/swiftmailer-bundle": "~2.3",
    "symfony/monolog-bundle": "~2.4",
    "sensio/distribution-bundle": "~2.3",
    "sensio/framework-extra-bundle": "~3.0",
    "sensio/generator-bundle": "~2.3",
    "incenteev/composer-parameter-handler": "~2.0",
    "richsage/rms-push-notifications-bundle": "dev-master",
    "friendsofsymfony/user-bundle": "~1.3",
    "ircmaxell/password-compat": "~1.0.3"
},
"scripts": {
    "post-install-cmd": [
        "Incenteev\\ParameterHandler\\ScriptHandler::buildParameters",
        "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": [
        "Incenteev\\ParameterHandler\\ScriptHandler::buildParameters",
        "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::buildBootstrap",
        "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::clearCache",
        "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::installAssets",
        "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::installRequirementsFile"
    ]
},
"config": {
    "bin-dir": "bin"
},
"extra": {
    "symfony-app-dir": "app",
    "symfony-web-dir": "public",
    "incenteev-parameters": {
        "file": "app/config/parameters.yml"
    },
    "branch-alias": {
        "dev-master": "2.4-dev"
    }
}
}

If I type app/console --version in cmd, it shows Symfony version 2.6.1 - app/dev/debug

Please help me out.

  • 写回答

1条回答 默认 最新

  • douyiavxxh02727 2015-01-06 14:22
    关注

    It's a bug as described here. It is resolved in the current framework version (2.6.1).

    So the solution is to upgrade to the current version. You can verify in the UPGRADE files on the github repo is something is changed but there anren't BC (Break Compatibility).

    In addition, your current framework version (2.4.2) is out of support so is a good moment to do this task.

    In general is a good practice to upgrade to the last stable version of the framework. Take a look at the sf2 release roadmap for the release process and for the end of support of the various framework release.

    Hope this help

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 下图接收小电路,谁知道原理
  • ¥15 装 pytorch 的时候出了好多问题,遇到这种情况怎么处理?
  • ¥20 IOS游览器某宝手机网页版自动立即购买JavaScript脚本
  • ¥15 手机接入宽带网线,如何释放宽带全部速度
  • ¥30 关于#r语言#的问题:如何对R语言中mfgarch包中构建的garch-midas模型进行样本内长期波动率预测和样本外长期波动率预测
  • ¥15 ETLCloud 处理json多层级问题
  • ¥15 matlab中使用gurobi时报错
  • ¥15 这个主板怎么能扩出一两个sata口
  • ¥15 不是,这到底错哪儿了😭
  • ¥15 2020长安杯与连接网探