Php file with <??> tags in XAMPP

Possible duplicate:
How to enable short PHP tags?

Hello

I have version Xampp 1.7.3. When viewing a project, an error is displayed. This is because my PHP code starts with <?....?> , So I want to execute my project with the tag <? ..... ?> <? ..... ?> and the tag <?php ....?> .

thanks

+4
source share
3 answers

You are looking for the short_open_tag directive; -)


To specify PHP, it must accept <? ... ?> <? ... ?> as valid PHP tags, you should put this in your php.ini :

 short_open_tag = On 

Instead of what you currently have:

 short_open_tag = Off 


Notes:

  • You can find out where your php.ini phpinfo() file is phpinfo() .
  • Generally speaking, you should not use short open tags, as they can be disabled (you just saw this)
+7
source

Set short_open_tag = on in your php.ini.

You can also use php_flag short_open_tag on in your .htaccess file.

However, you should use <?php as this cannot be disabled!

+1
source

Do not make this person ... <?php guaranteed on any server running PHP. As a compromise for the extra 3 characters, you can omit the closing ?> ... see the manual for more details.

http://php.net/manual/en/language.basic-syntax.instruction-separation.php

0
source

Source: https://habr.com/ru/post/1347345/


All Articles