Проблем при php.ini с таговете определящи вашия php код

Случвало ли ви се е да направите php файл с тагове

<?
echo "asd";
?>

и този същия файл да не се изпълнява като php, а като html. Причината е, че в настройките на php е указано да се ползва само тагa "<?php
, а не краткия вариант "<?".

За да се предостави възможност да ползваме отварящи тагове "<?php" и "<?" трябва да редактираме php.ini и да направим следната промяна:

; This directive determines whether or not PHP will recognize code between
; <? and ?> tags as PHP source which should be processed as such. It's been
; recommended for several years that you not use the short tag "short cut" and
; instead to use the full <?php and ?> tag combination. With the wide spread use
; of XML and use of these tags by other languages, the server can become easily
; confused and end up parsing the wrong code in the wrong context. But because
; this short cut has been a feature for such a long time, it's currently still
; supported for backwards compatibility, but we recommend you don't use them.
; Default Value: On
; Development Value: Off
; Production Value: Off
; http://php.net/short-open-tag
short_open_tag = On

VN:F [1.9.22_1171]
Rating: 5.0/5 (1 vote cast)
VN:F [1.9.22_1171]
Rating: 0 (from 0 votes)
Проблем при php.ini с таговете определящи вашия php код, 5.0 out of 5 based on 1 rating

One thought on “Проблем при php.ini с таговете определящи вашия php код”

Вашият коментар

Вашият email адрес няма да бъде публикуван Задължителните полета са отбелязани с *