如何允许指令及QUOT; short_open_tag的值为"通过。 .htaccess的阿帕奇[PHP 5.3] [英] How to enable the directive "short_open_tag" via the. Htaccess Apache [PHP 5.3]
问题描述
我目前使用PHP 5.3.8,我无法用的php.ini
访问它。
I am currently using PHP 5.3.8 and I can not access it with php.ini
.
我绝对必须启用PHP指令short_open_tag的值为就可以了,因为我有一个伟大的CMS的工作,只使用了&LT ;? ?方式>
I absolutely must enable the PHP directive "short_open_tag" to On it because I work with a great CMS that uses only the <? ?>
.
我试着与我的Apache的.htaccess( php_value short_open_tag的值为1
)来启用它,但增加这导致Apache总是发出500错误。
I tried to enable it with my Apache .htaccess (php_value short_open_tag 1
), but adding this causes Apache to always issue 500 errors.
N.B。我的服务器用PHP工作在CGI模式。
N.B. My server works with PHP in CGI mode.
推荐答案
如果PHP运行为CGI,那么你就不能当PHP是一个Apache模块使用.htaccess文件来设置PHP的标志,这只是工作。
If PHP is running as a CGI, then you cannot use a .htaccess file to set PHP flags, this only works if PHP is an Apache module.
您可以使用的ini_set 从PHP脚本设置该标志,但是这不会帮助你,因为的ini_set只影响当前正在运行的PHP程序,不会持续下去。
You can use ini_set to set this flag from a PHP script, but this won't help you since ini_set only affects the currently running PHP process and doesn't persist.
您唯一的选择可能会要求你的主机启用短标签在php.ini,或编辑每个PHP文件来替换&LT ;?以&lt; PHP
Your only option may be to request your host enable short tags in php.ini, or edit each PHP file to replace <? with <?php
这篇关于如何允许指令及QUOT; short_open_tag的值为&QUOT;通过。 .htaccess的阿帕奇[PHP 5.3]的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!