Desarrollo y Tecnología > Servidores > Apache2 > Short Tag o Long Tag en PHP5.5.5

Short Tag o Long Tag en PHP5.5.5

Estoy actualizando mis servidores para la última versión de PHP, la versión 5.5.5 y para mi sorpresa muchas de mis aplicaciones no funcionaban.

Estuve lellendo un rato y no encontraba la razón hasta que vi que por defecto en el archivo de configuración de php para apache los short tags estaban desactivados ( Duh ! ).

En este caso existen dos soluciones,

  1. una cambiar todos los short tags por long tags
  2. Y la otra es simplemente decirle a php que acepte los short tags.

Para realizar la última vamos al archivo de configuración, en mi caso /etc/php5/apache2/php.ini y lo editamos para que el short open tag esté habilitado de la siguiente manera.

; This directive determines whether or not PHP will recognize code between
;  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  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

Yo por mi parte usé lo último debido a que era lo más sencillo, pero empezaré a codificar todo con long tags para no tener problemas a futuro.

¡Mantengamos el contacto!

Me encantaría que te mantuvieras al día con el contenido que estoy generando. Recuerda que no es solo el blog, son las redes sociales, libros, y distintos pódcast 😎.

Hago todo lo posible para no hacer Spam,

¡MANTENGÁMONOS EN CONTACTO!

Me encantaría que te mantuvieras al día con el contenido que estoy generando. Recuerda que no es solo el blog, son las redes sociales, libros, y distintos pódcast 😎.

Hago todo lo posible para no hacer Spam,

2 thoughts on “Short Tag o Long Tag en PHP5.5.5”

Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Share to...