Enable short open tag without php.ini file

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-06 19:37:38

问题


Can I enable PHP short tags without touching any configuration files?


回答1:


You should be able to change it in your .htaccess file if it wasn't locked down

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

See http://php.net/manual/en/configuration.changes.php for more details




回答2:


I think the short_open_tag can't be modified with ini_set().




回答3:


If you have access to an .htaccess but not the php.ini, simply add this to .htaccess in root of the php app you are planning on running:

php_value short_open_tag 1



回答4:


Checkout this previous Questions:
How to enable PHP short tags - Manual Setting

You can use ini_set function for setting programmatically

Revised: I try using ini_set function to configure it but failed. You can check previous questions for better answer.




回答5:


Add into your .htaccess file,

php_value short_open_tag 1


来源:https://stackoverflow.com/questions/2287076/enable-short-open-tag-without-php-ini-file

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!