允许通过的.htaccess PHP短开放标记 [英] Enable PHP short open tags via .htaccess

查看:228
本文介绍了允许通过的.htaccess PHP短开放标记的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我目前通过教程的CMS系统,不幸的是使用较短的开放标签运行。

我已经证实了我的主人不会让这些在他们的PHP配置,但他们在阿帕奇模式下运行PHP(而不是CGI)。尽我所知,这应该然后让我在.htaccess文件的 short_open_tag的值为标记设置为

然而,这似乎不正常。在根目录下,我创建了一个.htaccess文件只需以下行,但短期开放标签仍然被忽略了。

的php_flag short_open_tag的值为上

我是不是做错了什么?如果没有,任何人都可以说明为什么它可能无法正常工作?谢谢你。

注意:有人已经打上了这个问题的回答被别的地方。不仅确定没有问题有一个公认的答案,它是基于各地以CGI模式PHP配置上运行,而不是Apache模式。

解决方案

试试这个

 < IfModule mod_php5.c>
   php_value short_open_tag的值为1
 < / IfModule>
 

这将解决这个问题

I’m currently running through a tutorial for a CMS system which unfortunately uses short open tags.

I’ve confirmed that my host will not allow these in their PHP config, but that they run PHP in Apache mode (as opposed to CGI). To the best of my knowledge, this should then allow me to set the short_open_tag flag to on in an .htaccess file.

However, this appears to not be working. In the root directory, I've created an .htaccess file with just the following line, but the short open tags are still being ignored.

php_flag short_open_tag on

Am I doing something wrong? If not, can anyone suggest why it may not be working? Thanks.

Note: Someone has marked this question as being answered somewhere else. Not only does the question identified not have an accepted answer, it's based around and PHP config running in CGI mode, not Apache mode.

解决方案

Try this

 <IfModule mod_php5.c>
   php_value short_open_tag 1
 </IfModule>

This would solve the problem

这篇关于允许通过的.htaccess PHP短开放标记的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆