Doctrine CLI displays the contents of doctrine.php

i followed the online tutorial on integrating doctrine 2 and ZF2. I can insert data into the database, but whenever I run the CLI doctrine, it outputs:

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

which is the contents of doctrine.php, which I replaced with the codes from the tutorial.

+6
source share
5 answers

Copy the path to the doctrine binaries (containing "doctrine", "doctrine.php", "doctrine.bat" ...

Go to the root of your project and enter:

 php path_to_doctrine_bin/doctrine.php [options] 

That should do it.

+2
source

I found this on another issue here, and it works on Windows. There is also a bin folder in vendor / doctrine / orm / bin / you can use this in the console:

php vendor / doctrine / orm / bin / doctrine orm: schema-tool: create

+4
source

On Windows, you need to run .bat files instead. eg.

 vendor\bin\doctrine.bat orm:schema-tool:create 
+1
source

Facing the same problem, it turns out that using a slash instead of a backslash was the real culprit

So, navigate inside the project directory and do

 vendor\bin\doctrine.bat orm:schema-tool:create 
+1
source

What works for me is to use the original shell / bash script in the vendor directory (works on win7)

 $ vendor/doctrine/orm/bin/doctrine orm:schema-tool:create 
0
source

All Articles