How to enable PHP short tags?

后端 未结 19 2417
清酒与你
清酒与你 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:56

    In CentOS 6(tested on Centos 7 too) you can't set short_open_tag in /etc/php.ini for php-fpm. You will have error:

    ERROR: [/etc/php.ini:159] unknown entry 'short_open_tag'
    ERROR: Unable to include /etc/php.ini from /etc/php-fpm.conf at line 159
    ERROR: failed to load configuration file '/etc/php-fpm.conf'
    ERROR: FPM initialization failed
    

    You must edit config for your site, which can found in /etc/php-fpm.d/www.conf And write at end of file:

    php_value[short_open_tag] =  On
    

提交回复
热议问题