gpt4 book ai didi

Symfony 2 无法使用 Composer 安装教义

转载 作者:行者123 更新时间:2023-12-04 13:16:30 26 4
gpt4 key购买 nike

我最近移动了我的 symfony 项目,所以我不得不重新安装所有依赖项。

当我运行 php composer.phar install ,当涉及到教义时,我收到以下错误:

[ErrorException]                                                                                                       
file_put_contents(/Users/me/Projets/sf2/site/bin/doctrine): failed to open stream: No such file or directory

这是我的 composer.json 的副本:
{
"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.3.*",
"doctrine/orm": ">=2.2.3,<2.4-dev",
"doctrine/doctrine-bundle": "1.2.*",
"twig/extensions": "1.0.*",
"symfony/assetic-bundle": "2.3.*",
"symfony/swiftmailer-bundle": "2.3.*",
"symfony/monolog-bundle": "2.3.*",
"sensio/distribution-bundle": "2.3.*",
"sensio/framework-extra-bundle": "2.3.*",
"sensio/generator-bundle": "2.3.*",
"incenteev/composer-parameter-handler": "~2.0",
"friendsofsymfony/user-bundle": "*",
"friendsofsymfony/jsrouting-bundle": "@stable",
"vich/uploader-bundle":"dev-master",
"knplabs/knp-gaufrette-bundle":"dev-master",
"knplabs/gaufrette":"dev-master"
},
"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"
},
"minimum-stability": "stable",
"extra": {
"symfony-app-dir": "app",
"symfony-web-dir": "web",
"incenteev-parameters": {
"file": "app/config/parameters.yml"
},
"branch-alias": {
"dev-master": "2.3-dev"
}
}
}

最佳答案

好的,问题解决了。

看来我是从 迁移过来的 window 基于环境到 linux 基于环境
此外,我的文件夹 bin 是版本化的(我为什么要这样做???)
所以bin/doctrine符号链接(symbolic link)看起来像这样:

window 版本:

#!/usr/bin/env sh
SRC_DIR="`pwd`"
cd "`dirname "$0"`"
cd "../vendor/doctrine/orm/bin"
BIN_TARGET="`pwd`/doctrine"
cd "$SRC_DIR"
"$BIN_TARGET" "$@"

Linux 版本:
../vendor/doctrine/orm/bin/doctrine

解决方案 :

只需删除文件 bin/doctrine 和 bin/doctrine.php 并再次启动 php composer.phar install

并记住避免将其置于版本控制中!

关于Symfony 2 无法使用 Composer 安装教义,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23316160/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com