从命令行用短标签运行php [英] run php from command line with short tags
问题描述
我有一个使用大量文件的框架
当我从框架中包含文件时,include并不知道它是php文件,而是将其称为简单文本文件.
I have a framework with a lot of file using
when I include a file from the framework the include doesn't know it's a php file and refer it as a simple text file.
现在我在php.ini中的php定义是use_short_tags enable,当我浏览该站点时,它也可以正常工作.
now my php definition in the php.ini is use_short_tags enable, i also see it when I browse the site, it's working.
我的问题是,当我从命令行运行脚本时,如何使用框架文件并让php知道使用短标签
my question is how to use the framework files and let the php know to use short tags when i run my script from the command line
谢谢
推荐答案
在ubuntu/debian中,您必须进行更改
In ubuntu/debian you have to change
short_open_tag Off
到
short_open_tag On
在
/etc/php5/cli/php.ini
在此之后您无需重新启动任何服务,只需使用您的控制台 php.
And you no need to restart any service after this, just use your console php.
这篇关于从命令行用短标签运行php的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!