How to enable PHP short tags?

后端 未结 19 2851
清酒与你
清酒与你 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条回答
  •  萌比男神i
    2020-11-21 05:52

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

    1.To locate php.ini file,on comment line execute

     php --ini
    

    you will get some thing like this,

    Configuration File (php.ini) Path: /etc
    Loaded Configuration File:         /etc/php.ini
    Scan for additional .ini files in: /etc/php.d
    Additional .ini files parsed:      /etc/php.d/curl.ini,
    /etc/php.d/fileinfo.ini,
    /etc/php.d/gd.ini,
    /etc/php.d/json.ini,
    /etc/php.d/mcrypt.ini,
    /etc/php.d/mysql.ini,
    /etc/php.d/mysqli.ini,
    /etc/php.d/pdo.ini,
    /etc/php.d/pdo_mysql.ini,
    /etc/php.d/pdo_sqlite.ini,
    /etc/php.d/phar.ini,
    /etc/php.d/sqlite3.ini,
    /etc/php.d/zip.ini
    

    See 2nd line from the comment output.The file will be in the mentioned path.

    2.Open php.ini file and find short_open_tag. By default it is in off change it to on.

    3.Restart the server,execute this comment

    service httpd restart
    

    Thanks

提交回复
热议问题