执行时:
doctrine orm:schema-tool:create
我明白了:
'"@php_bin@"' is not recognized as an internal or external command, operable program or batch file.
我通过将bin \ doctrine.php更改为:
来修复此问题php "C:\Program Files\DoctrineORM-2.2.2\bin\doctrine.php" %*
现在,我走得更远了。从命令行执行以下操作时:
doctrine orm:schema-tool:create
部分输出如下:
Fatal error: require_once(): Failed opening required 'Doctrine/ORM/Tools/Setup.php' (include_path='.;C:\xampp\php\PEAR') in C:\Users\bam1216\Documents\Development\DoctrineTutorial\project\bootstrap_doctrine.php on line 7
失败的文件是bootstrap_doctrine.php的第7行,它是下面的require_once行:
use Doctrine\ORM\Tools\Setup;
require_once "Doctrine/ORM/Tools/Setup.php";
它引用的Setup.php位于我的计算机上的C:\ Program Files \ DoctrineORM-2.2.2 \ Doctrine \ ORM \ Tools \ Setup.php。如何配置它以查找该安装文件?
答案 0 :(得分:0)
我通过更改PHP的包含路径来修复此问题。我在bootstrap_doctrine.php的开头添加了以下几行:
$path = 'C:\Program Files\DoctrineORM-2.2.2';
set_include_path(get_include_path() . PATH_SEPARATOR . $path);