【发布时间】:2011-07-13 20:56:56
【问题描述】:
我正在尝试让 Doctrine 2 与 Codeigniter 2 一起使用,但在尝试启动并运行 Doctrine 控制台时遇到了一个问题,这涉及执行一个运行几行 php 的 shell 脚本。
我以此作为参考: Integrating Doctrine 2 with CodeIgniter 2
我是 OSX 的新手和 unix 命令的新手,但我确信我已经正确设置了 shell 脚本,如下所示:
#!/usr/bin/env php
<?php
chdir(dirname(__FILE__));
include('doctrine.php');
我在同一个目录中有php文件doctrine.php。
每当我尝试运行脚本时:
bash doctrine
我收到此错误:
doctrine: line 2: ?php: No such file or directory
doctrine: line 3: syntax error near unexpected token `dirname'
doctrine: line 3: `chdir(dirname(__FILE__));'
在我看来,php 甚至根本没有运行。我觉得我做错了一些相当基本的错误!
任何帮助表示赞赏, 标记。
【问题讨论】:
标签: php macos terminal doctrine-orm