How to enable PHP short tags?

后端 未结 19 2476
清酒与你
清酒与你 2020-11-21 05:29

I have a web application on a Linux server which starts with

I needed to copy this application to a windows environment and everything is working

19条回答
  •  时光说笑
    2020-11-21 05:45

    This can be done by enabling short_open_tag in php.ini:

    short_open_tag = on
    

    If you don't have access to the php.ini you can try to enable them trough the .htaccess file but it's possible the hosting company disabled this if you are on shared hosting:

    php_value short_open_tag 1
    

    For the people thinking that short_open_tags are bad practice as of php 5.4 the shorttag will supported everywhere, regardless of the settings so there is no reason not to use them if you can control the settings on the server. Also said in this link: short_open_tag

提交回复
热议问题