Doctrine 2 cli - 命令行工具 - 输入中出现意外字符 - 生成实体
我在通过 cli doctrine-cli.php
文件运行命令时遇到问题。我正在使用 Doctrine 2 和 Codeigniter 2。我想通过命令行工具生成实体,但没有成功。页面由 Hostgator 托管。该服务器上默认安装 PHP 版本 5.2,但您可以通过向位于根目录的 .htaccess 文件添加一些命令来使用 PHP 版本 5.3。
在命令行工具中,我收到此错误:
Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /home/tig3rb0y/public_html/naselsi/application/doctrine-cli.php on line 10
Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /home/tig3rb0y/public_html/naselsi/application/doctrine-cli.php on line 10
Parse error: syntax error, unexpected T_STRING in /home/tig3rb0y/public_html/naselsi/application/doctrine-cli.php on line 10
如果我通过 url 运行 PHP 版本的文件,我会得到 PHP 版本 5.3,但如果我通过命令行工具运行相同的文件,我会得到 php 版本 5.2。为什么会这样呢?
有什么解决办法吗?
问候,马里奥
I am having a problem with running commands via cli doctrine-cli.php
file. I am using Doctrine 2 and Codeigniter 2. I would like to generate entities via Command Line Tool, but without success. Page is hosted by Hostgator. On this server is installed by default PHP version 5.2, but you can use PHP version 5.3 by adding some commands to .htaccess file located in root.
In the Command Line Tool I get this error:
Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /home/tig3rb0y/public_html/naselsi/application/doctrine-cli.php on line 10
Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /home/tig3rb0y/public_html/naselsi/application/doctrine-cli.php on line 10
Parse error: syntax error, unexpected T_STRING in /home/tig3rb0y/public_html/naselsi/application/doctrine-cli.php on line 10
If I run a file with PHP version via url, I get PHP version 5.3, but if I run the same file via Command Line Tool, I get php version 5.2. Why is that so?
Is there any solution for that?
Regards, Mario
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我有一个解决方案。正如 @KeesSchepers 所说,存在一个问题,在命令行中存在默认的 5.2.17 PHP 版本。我简单地解决了这个问题,我只是将前缀
/opt/php53/bin/php
添加到所有doctrine2命令中,例如:/opt/php53/bin/phpdoctrine-cli.php orm:。 ..
谢谢你们!
I have a solution. As already @KeesSchepers said, there was a problem that in command line there was default 5.2.17 PHP version. I solved that simply, I just added prefix
/opt/php53/bin/php
to all doctrine2 commands, example:/opt/php53/bin/php doctrine-cli.php orm:...
Thank you guys!