简体   繁体   English

Doctrine2 - 'vendor\\bin\\doctrine' 未被识别为内部或外部命令

[英]Doctrine2 - 'vendor\bin\doctrine' is not recognized as an internal or external command

I'm trying to install doctrine 2 on a folder in my Windows WAMP server C:\\wamp\\www\\doctrine .我正在尝试在我的 Windows WAMP 服务器C:\\wamp\\www\\doctrine的文件夹上安装学说 2。 I'm following tutorial here:-我在这里学习教程:-

http://doctrine-orm.readthedocs.org/projects/doctrine-orm/en/latest/tutorials/getting-started.html http://doctrine-orm.readthedocs.org/projects/doctrine-orm/en/latest/tutorials/getting-started.html

After writing composer.json :-编写composer.json :-

{
    "name": "xxxx/doctrine-test",
    "authors": [
        {
            "name": "omar",
            "email": "xxxx@gmail.com"
        }
    ],
    "require": {
        "doctrine/orm": "2.4.*",
        "symfony/yaml": "2.*"
    }
}

I ran composer install which resulted in the following directories:-我运行了composer install这导致了以下目录:-

└───vendor
    ├───bin
    ├───composer
    ├───doctrine
    │   ├───annotations
    │   │   └───lib
    │   │       └───Doctrine
    │   │           └───Common
    │   │               └───Annotations
    │   │                   └───Annotation
    │   ├───cache
    │   │   ├───lib
    │   │   │   └───Doctrine
    │   │   │       └───Common
    │   │   │           └───Cache
    │   │   └───tests
    │   │       ├───Doctrine
    │   │       │   └───Tests
    │   │       │       └───Common
    │   │       │           └───Cache
    │   │       └───travis
    │   ├───collections
    │   │   ├───lib
    │   │   │   └───Doctrine
    │   │   │       └───Common
    │   │   │           └───Collections
    │   │   │               └───Expr
    │   │   └───tests
    │   │       └───Doctrine
    │   │           └───Tests
    │   │               └───Common
    │   │                   └───Collections
    │   ├───common
    │   │   ├───lib
    │   │   │   ├───Doctrine
    │   │   │   │   └───Common
    │   │   │   │       ├───Persistence
    │   │   │   │       │   ├───Event
    │   │   │   │       │   └───Mapping
    │   │   │   │       │       └───Driver
    │   │   │   │       ├───Proxy
    │   │   │   │       │   └───Exception
    │   │   │   │       ├───Reflection
    │   │   │   │       └───Util
    │   │   │   └───vendor
    │   │   │       └───doctrine-build-common
    │   │   └───tests
    │   │       └───Doctrine
    │   │           └───Tests
    │   │               └───Common
    │   │                   ├───ClassLoaderTest
    │   │                   ├───Persistence
    │   │                   │   └───Mapping
    │   │                   │       ├───_custom_ns
    │   │                   │       │   ├───dir
    │   │                   │       │   │   └───sub
    │   │                   │       │   │       └───subsub
    │   │                   │       │   └───dot
    │   │                   │       └───_files
    │   │                   │           └───annotation
    │   │                   ├───Proxy
    │   │                   ├───Reflection
    │   │                   │   └───Dummies
    │   │                   └───Util
    │   ├───dbal
    │   │   ├───bin
    │   │   └───lib
    │   │       ├───Doctrine
    │   │       │   └───DBAL
    │   │       │       ├───Cache
    │   │       │       ├───Connections
    │   │       │       ├───Driver
    │   │       │       │   ├───DrizzlePDOMySql
    │   │       │       │   ├───IBMDB2
    │   │       │       │   ├───Mysqli
    │   │       │       │   ├───OCI8
    │   │       │       │   ├───PDOIbm
    │   │       │       │   ├───PDOMySql
    │   │       │       │   ├───PDOOracle
    │   │       │       │   ├───PDOPgSql
    │   │       │       │   ├───PDOSqlite
    │   │       │       │   ├───PDOSqlsrv
    │   │       │       │   ├───SQLAnywhere
    │   │       │       │   └───SQLSrv
    │   │       │       ├───Event
    │   │       │       │   └───Listeners
    │   │       │       ├───Exception
    │   │       │       ├───Id
    │   │       │       ├───Logging
    │   │       │       ├───Platforms
    │   │       │       │   └───Keywords
    │   │       │       ├───Portability
    │   │       │       ├───Query
    │   │       │       │   └───Expression
    │   │       │       ├───Schema
    │   │       │       │   ├───Synchronizer
    │   │       │       │   └───Visitor
    │   │       │       ├───Sharding
    │   │       │       │   ├───ShardChoser
    │   │       │       │   └───SQLAzure
    │   │       │       │       └───Schema
    │   │       │       ├───Tools
    │   │       │       │   └───Console
    │   │       │       │       ├───Command
    │   │       │       │       └───Helper
    │   │       │       └───Types
    │   │       └───vendor
    │   │           ├───doctrine-build-common
    │   │           ├───doctrine-common
    │   │           └───Symfony
    │   │               └───Component
    │   │                   └───Console
    │   ├───doctrine-bundle
    │   │   ├───Command
    │   │   │   └───Proxy
    │   │   ├───Controller
    │   │   ├───DataCollector
    │   │   ├───DependencyInjection
    │   │   │   └───Compiler
    │   │   ├───Mapping
    │   │   ├───Resources
    │   │   │   ├───config
    │   │   │   │   └───schema
    │   │   │   ├───doc
    │   │   │   └───views
    │   │   │       └───Collector
    │   │   ├───Tests
    │   │   │   ├───Command
    │   │   │   ├───DataCollector
    │   │   │   ├───DependencyInjection
    │   │   │   │   └───Fixtures
    │   │   │   │       ├───Bundles
    │   │   │   │       │   ├───AnnotationsBundle
    │   │   │   │       │   │   └───Entity
    │   │   │   │       │   ├───Vendor
    │   │   │   │       │   │   └───AnnotationsBundle
    │   │   │   │       │   │       └───Entity
    │   │   │   │       │   ├───XmlBundle
    │   │   │   │       │   │   ├───Entity
    │   │   │   │       │   │   └───Resources
    │   │   │   │       │   │       └───config
    │   │   │   │       │   │           └───doctrine
    │   │   │   │       │   └───YamlBundle
    │   │   │   │       │       ├───Entity
    │   │   │   │       │       └───Resources
    │   │   │   │       │           └───config
    │   │   │   │       │               └───doctrine
    │   │   │   │       └───config
    │   │   │   │           ├───xml
    │   │   │   │           └───yml
    │   │   │   ├───Mapping
    │   │   │   └───Twig
    │   │   └───Twig
    │   ├───doctrine-cache-bundle
    │   │   └───Doctrine
    │   │       └───Bundle
    │   │           └───DoctrineCacheBundle
    │   │               ├───Acl
    │   │               │   └───Model
    │   │               ├───Command
    │   │               ├───DependencyInjection
    │   │               │   └───Definition
    │   │               ├───Resources
    │   │               │   └───config
    │   │               │       └───schema
    │   │               └───Tests
    │   │                   ├───Acl
    │   │                   │   └───Model
    │   │                   ├───DependencyInjection
    │   │                   │   └───Fixtures
    │   │                   │       ├───Bundles
    │   │                   │       │   ├───XmlBundle
    │   │                   │       │   └───YamlBundle
    │   │                   │       ├───Cache
    │   │                   │       ├───config
    │   │                   │       │   ├───xml
    │   │                   │       │   └───yml
    │   │                   │       └───Definition
    │   │                   ├───Functional
    │   │                   │   ├───Command
    │   │                   │   └───Fixtures
    │   │                   │       └───config
    │   │                   └───travis
    │   ├───inflector
    │   │   ├───lib
    │   │   │   └───Doctrine
    │   │   │       └───Common
    │   │   │           └───Inflector
    │   │   └───tests
    │   │       └───Doctrine
    │   │           └───Tests
    │   │               └───Common
    │   │                   └───Inflector
    │   └───lexer
    │       └───lib
    │           └───Doctrine
    │               └───Common
    │                   └───Lexer
    ├───jdorn
    │   └───sql-formatter
    │       ├───examples
    │       ├───lib
    │       └───tests
    ├───psr
    │   └───log
    │       └───Psr
    │           └───Log
    │               └───Test
    └───symfony
        ├───asset
        │   ├───Context
        │   ├───Exception
        │   ├───Tests
        │   └───VersionStrategy
        ├───config
        │   ├───Definition
        │   │   ├───Builder
        │   │   ├───Dumper
        │   │   └───Exception
        │   ├───Exception
        │   ├───Loader
        │   ├───Resource
        │   ├───Tests
        │   │   ├───Definition
        │   │   │   ├───Builder
        │   │   │   └───Dumper
        │   │   ├───Exception
        │   │   ├───Fixtures
        │   │   │   ├───Again
        │   │   │   ├───Builder
        │   │   │   ├───Configuration
        │   │   │   └───Util
        │   │   ├───Loader
        │   │   ├───Resource
        │   │   └───Util
        │   └───Util
        ├───console
        │   ├───Command
        │   ├───Descriptor
        │   ├───Event
        │   ├───Formatter
        │   ├───Helper
        │   ├───Input
        │   ├───Logger
        │   ├───Output
        │   ├───Question
        │   ├───Resources
        │   │   └───bin
        │   ├───Style
        │   ├───Tester
        │   └───Tests
        │       ├───Command
        │       ├───Descriptor
        │       ├───Fixtures
        │       │   └───Style
        │       │       └───SymfonyStyle
        │       │           ├───command
        │       │           └───output
        │       ├───Formatter
        │       ├───Helper
        │       ├───Input
        │       ├───Logger
        │       ├───Output
        │       ├───Style
        │       └───Tester
        ├───debug
        │   ├───Exception
        │   ├───FatalErrorHandler
        │   ├───Resources
        │   │   └───ext
        │   │       └───tests
        │   └───Tests
        │       ├───Exception
        │       ├───FatalErrorHandler
        │       ├───Fixtures
        │       │   └───psr4
        │       └───Fixtures2
        ├───dependency-injection
        │   ├───Compiler
        │   ├───Dumper
        │   ├───Exception
        │   ├───Extension
        │   ├───LazyProxy
        │   │   ├───Instantiator
        │   │   └───PhpDumper
        │   ├───Loader
        │   │   └───schema
        │   │       └───dic
        │   │           └───services
        │   ├───ParameterBag
        │   └───Tests
        │       ├───Compiler
        │       ├───Dumper
        │       ├───Extension
        │       ├───Fixtures
        │       │   ├───containers
        │       │   ├───graphviz
        │       │   ├───includes
        │       │   │   └───schema
        │       │   ├───ini
        │       │   ├───php
        │       │   ├───xml
        │       │   │   ├───extension1
        │       │   │   ├───extension2
        │       │   │   └───extensions
        │       │   └───yaml
        │       ├───LazyProxy
        │       │   ├───Instantiator
        │       │   └───PhpDumper
        │       ├───Loader
        │       └───ParameterBag
        ├───doctrine-bridge
        │   ├───CacheWarmer
        │   ├───DataCollector
        │   ├───DataFixtures
        │   ├───DependencyInjection
        │   │   ├───CompilerPass
        │   │   └───Security
        │   │       └───UserProvider
        │   ├───ExpressionLanguage
        │   ├───Form
        │   │   ├───ChoiceList
        │   │   ├───DataTransformer
        │   │   ├───EventListener
        │   │   └───Type
        │   ├───HttpFoundation
        │   ├───Logger
        │   ├───Security
        │   │   ├───RememberMe
        │   │   └───User
        │   ├───Test
        │   ├───Tests
        │   │   ├───DataCollector
        │   │   ├───DataFixtures
        │   │   ├───DependencyInjection
        │   │   │   └───CompilerPass
        │   │   ├───ExpressionLanguage
        │   │   ├───Fixtures
        │   │   ├───Form
        │   │   │   ├───ChoiceList
        │   │   │   ├───DataTransformer
        │   │   │   └───Type
        │   │   ├───HttpFoundation
        │   │   ├───Logger
        │   │   ├───Security
        │   │   │   └───User
        │   │   └───Validator
        │   │       └───Constraints
        │   └───Validator
        │       └───Constraints
        ├───event-dispatcher
        │   ├───Debug
        │   ├───DependencyInjection
        │   └───Tests
        │       ├───Debug
        │       └───DependencyInjection
        ├───filesystem
        │   ├───Exception
        │   └───Tests
        ├───framework-bundle
        │   ├───CacheWarmer
        │   ├───Command
        │   ├───Console
        │   │   ├───Descriptor
        │   │   └───Helper
        │   ├───Controller
        │   ├───DataCollector
        │   ├───DependencyInjection
        │   │   └───Compiler
        │   ├───EventListener
        │   ├───Fragment
        │   ├───HttpCache
        │   ├───Resources
        │   │   ├───config
        │   │   │   └───schema
        │   │   ├───meta
        │   │   ├───public
        │   │   │   ├───css
        │   │   │   └───images
        │   │   └───views
        │   │       ├───Form
        │   │       └───FormTable
        │   ├───Routing
        │   ├───Templating
        │   │   ├───Asset
        │   │   ├───Helper
        │   │   └───Loader
        │   ├───Test
        │   ├───Tests
        │   │   ├───CacheWarmer
        │   │   ├───Command
        │   │   │   └───CacheClearCommand
        │   │   │       └───Fixture
        │   │   ├───Console
        │   │   │   └───Descriptor
        │   │   ├───Controller
        │   │   ├───DependencyInjection
        │   │   │   ├───Compiler
        │   │   │   └───Fixtures
        │   │   │       ├───php
        │   │   │       ├───TestBundle
        │   │   │       │   └───Resources
        │   │   │       │       └───config
        │   │   │       ├───xml
        │   │   │       └───yml
        │   │   ├───Fixtures
        │   │   │   ├───BaseBundle
        │   │   │   │   └───Resources
        │   │   │   │       └───views
        │   │   │   │           └───controller
        │   │   │   ├───Descriptor
        │   │   │   ├───Resources
        │   │   │   │   ├───BaseBundle
        │   │   │   │   │   └───views
        │   │   │   │   │       └───controller
        │   │   │   │   ├───translations
        │   │   │   │   └───views
        │   │   │   └───TestBundle
        │   │   │       ├───Fabpot
        │   │   │       │   └───FooBundle
        │   │   │       │       └───Controller
        │   │   │       ├───FooBundle
        │   │   │       │   └───Controller
        │   │   │       │       ├───Sub
        │   │   │       │       └───Test
        │   │   │       └───Sensio
        │   │   │           ├───Cms
        │   │   │           │   └───FooBundle
        │   │   │           │       └───Controller
        │   │   │           └───FooBundle
        │   │   │               └───Controller
        │   │   ├───Fragment
        │   │   ├───Functional
        │   │   │   ├───app
        │   │   │   │   ├───config
        │   │   │   │   ├───ConfigDump
        │   │   │   │   ├───Fragment
        │   │   │   │   ├───Profiler
        │   │   │   │   ├───Resources
        │   │   │   │   └───Session
        │   │   │   └───Bundle
        │   │   │       └───TestBundle
        │   │   │           ├───Controller
        │   │   │           ├───DependencyInjection
        │   │   │           │   └───Config
        │   │   │           └───Resources
        │   │   │               └───config
        │   │   ├───Routing
        │   │   ├───Templating
        │   │   │   ├───Helper
        │   │   │   │   ├───Fixtures
        │   │   │   │   └───Resources
        │   │   │   │       ├───Child
        │   │   │   │       ├───Custom
        │   │   │   │       └───Parent
        │   │   │   └───Loader
        │   │   ├───Translation
        │   │   └───Validator
        │   ├───Translation
        │   └───Validator
        ├───http-foundation
        │   ├───File
        │   │   ├───Exception
        │   │   └───MimeType
        │   ├───Resources
        │   │   └───stubs
        │   ├───Session
        │   │   ├───Attribute
        │   │   ├───Flash
        │   │   └───Storage
        │   │       ├───Handler
        │   │       └───Proxy
        │   └───Tests
        │       ├───File
        │       │   ├───Fixtures
        │       │   │   └───directory
        │       │   └───MimeType
        │       └───Session
        │           ├───Attribute
        │           ├───Flash
        │           └───Storage
        │               ├───Handler
        │               └───Proxy
        ├───http-kernel
        │   ├───Bundle
        │   ├───CacheClearer
        │   ├───CacheWarmer
        │   ├───Config
        │   ├───Controller
        │   ├───DataCollector
        │   │   └───Util
        │   ├───Debug
        │   ├───DependencyInjection
        │   ├───Event
        │   ├───EventListener
        │   ├───Exception
        │   ├───Fragment
        │   ├───HttpCache
        │   ├───Log
        │   ├───Profiler
        │   └───Tests
        │       ├───Bundle
        │       ├───CacheClearer
        │       ├───CacheWarmer
        │       ├───Config
        │       ├───Controller
        │       ├───DataCollector
        │       │   └───Util
        │       ├───Debug
        │       ├───DependencyInjection
        │       ├───EventListener
        │       ├───Fixtures
        │       │   ├───BaseBundle
        │       │   │   └───Resources
        │       │   ├───Bundle1Bundle
        │       │   │   └───Resources
        │       │   ├───Bundle2Bundle
        │       │   ├───ChildBundle
        │       │   │   └───Resources
        │       │   ├───ExtensionAbsentBundle
        │       │   ├───ExtensionLoadedBundle
        │       │   │   └───DependencyInjection
        │       │   ├───ExtensionNotValidBundle
        │       │   │   └───DependencyInjection
        │       │   ├───ExtensionPresentBundle
        │       │   │   ├───Command
        │       │   │   └───DependencyInjection
        │       │   └───Resources
        │       │       ├───BaseBundle
        │       │       ├───Bundle1Bundle
        │       │       ├───ChildBundle
        │       │       └───FooBundle
        │       ├───Fragment
        │       ├───HttpCache
        │       └───Profiler
        │           └───Mock
        ├───routing
        │   ├───Annotation
        │   ├───Exception
        │   ├───Generator
        │   │   └───Dumper
        │   ├───Loader
        │   │   └───schema
        │   │       └───routing
        │   ├───Matcher
        │   │   └───Dumper
        │   └───Tests
        │       ├───Annotation
        │       ├───Fixtures
        │       │   ├───AnnotatedClasses
        │       │   ├───dumper
        │       │   └───OtherAnnotatedClasses
        │       ├───Generator
        │       │   └───Dumper
        │       ├───Loader
        │       └───Matcher
        │           └───Dumper
        ├───security
        │   └───Symfony
        │       └───Component
        │           └───Security
        │               ├───Acl
        │               │   ├───Dbal
        │               │   ├───Domain
        │               │   ├───Exception
        │               │   ├───Model
        │               │   ├───Permission
        │               │   ├───Resources
        │               │   │   ├───bin
        │               │   │   └───schema
        │               │   └───Voter
        │               ├───Core
        │               │   ├───Authentication
        │               │   │   ├───Provider
        │               │   │   ├───RememberMe
        │               │   │   └───Token
        │               │   ├───Authorization
        │               │   │   └───Voter
        │               │   ├───Encoder
        │               │   ├───Event
        │               │   ├───Exception
        │               │   ├───Role
        │               │   ├───User
        │               │   ├───Util
        │               │   └───Validator
        │               │       └───Constraints
        │               ├───Http
        │               │   ├───Authentication
        │               │   ├───Authorization
        │               │   ├───EntryPoint
        │               │   ├───Event
        │               │   ├───Firewall
        │               │   ├───Logout
        │               │   ├───RememberMe
        │               │   └───Session
        │               ├───Resources
        │               │   └───translations
        │               └───Tests
        │                   ├───Acl
        │                   │   ├───Dbal
        │                   │   ├───Domain
        │                   │   ├───Permission
        │                   │   └───Voter
        │                   ├───Core
        │                   │   ├───Authentication
        │                   │   │   ├───Provider
        │                   │   │   ├───RememberMe
        │                   │   │   └───Token
        │                   │   ├───Authorization
        │                   │   │   └───Voter
        │                   │   ├───Encoder
        │                   │   ├───Role
        │                   │   ├───User
        │                   │   ├───Util
        │                   │   └───Validator
        │                   │       └───Constraints
        │                   └───Http
        │                       ├───Authentication
        │                       ├───EntryPoint
        │                       ├───Firewall
        │                       ├───Logout
        │                       ├───RememberMe
        │                       └───Session
        ├───security-core
        │   ├───Authentication
        │   │   ├───Provider
        │   │   ├───RememberMe
        │   │   └───Token
        │   │       └───Storage
        │   ├───Authorization
        │   │   └───Voter
        │   ├───Encoder
        │   ├───Event
        │   ├───Exception
        │   ├───Resources
        │   │   └───translations
        │   ├───Role
        │   ├───Tests
        │   │   ├───Authentication
        │   │   │   ├───Provider
        │   │   │   ├───RememberMe
        │   │   │   └───Token
        │   │   │       └───Storage
        │   │   ├───Authorization
        │   │   │   └───Voter
        │   │   ├───Encoder
        │   │   ├───Exception
        │   │   ├───Role
        │   │   ├───User
        │   │   ├───Util
        │   │   └───Validator
        │   │       └───Constraints
        │   ├───User
        │   ├───Util
        │   └───Validator
        │       └───Constraints
        ├───security-csrf
        │   ├───Exception
        │   ├───Tests
        │   │   ├───TokenGenerator
        │   │   └───TokenStorage
        │   ├───TokenGenerator
        │   └───TokenStorage
        ├───stopwatch
        │   └───Tests
        ├───templating
        │   ├───Asset
        │   ├───Helper
        │   ├───Loader
        │   ├───Storage
        │   └───Tests
        │       ├───Fixtures
        │       │   └───templates
        │       ├───Helper
        │       ├───Loader
        │       └───Storage
        └───translation
            ├───Catalogue
            ├───DataCollector
            ├───Dumper
            ├───Exception
            ├───Extractor
            ├───Loader
            │   └───schema
            │       └───dic
            │           └───xliff-core
            ├───Tests
            │   ├───Catalogue
            │   ├───DataCollector
            │   ├───Dumper
            │   ├───fixtures
            │   │   └───resourcebundle
            │   │       ├───corrupted
            │   │       ├───dat
            │   │       └───res
            │   └───Loader
            └───Writer

Then I added 4 directories:-然后我添加了 4 个目录:-

project root folder
|-- config
|   |-- xml
|   `-- yaml
`-- src

I added bootstrap.php file in the root folder of project with content:-我在项目的根文件夹中添加了bootstrap.php文件,内容如下:-

require_once "vendor/autoload.php"; require_once "供应商/autoload.php";

<?php    
// Create a simple "default" Doctrine ORM configuration for Annotations
$isDevMode = true;
$config = Setup::createAnnotationMetadataConfiguration(array(__DIR__."/src"), $isDevMode);
// or if you prefer yaml or XML
//$config = Setup::createXMLMetadataConfiguration(array(__DIR__."/config/xml"), $isDevMode);
//$config = Setup::createYAMLMetadataConfiguration(array(__DIR__."/config/yaml"), $isDevMode);

// database configuration parameters
$dbParams = array(
    'driver'   => 'pdo_mysql',
    'user'     => 'root',
    'password' => 'xxx',
    'dbname'   => 'doctrine',
);

// obtaining the entity manager
$entityManager = EntityManager::create($conn, $config);

Then I made cli-config.php file with contents:-然后我用内容制作了cli-config.php文件:-

<?php
// cli-config.php
require_once "bootstrap.php";

return \Doctrine\ORM\Tools\Console\ConsoleRunner::createHelperSet($entityManager);

After doing all this.做完这一切之后。 Now when I run the following command in the cmd现在当我在 cmd 中运行以下命令时

vendor\bin\doctrine orm:schema-tool:create

then it says:-然后它说:-

'vendor\bin\doctrine' is not recognized as an internal or external command,
operable program or batch file.

Any idea, why is it so?任何想法,为什么会这样?

Update:-更新:-

Complete list of directories including files can be found here: http://pastebin.com/AEHsyVNs可以在此处找到包含文件的完整目录列表: http : //pastebin.com/AEHsyVNs

You can add this directory("yourProjectDirectory\\vendor\\bin\\") to your system PATH environment variable on Windows OS.您可以将此目录(“yourProjectDirectory\\vendor\\bin\\”)添加到 Windows 操作系统上的系统 PATH 环境变量中。 Then you can call as '$doctrine orm:schema-tool:create'然后你可以调用'$doctrine orm:schema-tool:create'

Please execute the following command:请执行以下命令:

.\vendor\bin\doctrine-migrations.bat migrations:generate

Please call .bat file!请调用.bat文件!

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM