1. Гость, мы просим Вас ознакомиться с Правилами Форума и Отказом от ответственности!

Любая версия Php и короткие тэги.

Тема в разделе 'PW Документация', создана пользователем pilad, 13 фев 2014.

Статус темы:
Закрыта.
  1. TopicStarter Overlay

    pilad Команда форума Модератор Пользователи

    Сообщения:
    1.740
    Лайки:
    480
    Пол:
    Мужской
    Репутация:
    1
    Команда:
    Freeman
    Если при открытии php скриптов у Вас открывается страничка в виде текста то:
    1.Вы забыли установить php - apt-get install php5
    2.Или в Вашем скрипте используются короткие тэги
    Код:
    <?
    //Тут код..
    ?>
    Значит при этом функция коротких тэгов отключена в php.ini по пути /etc/php5/apache2
    Код:
    ; 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 = Off
    Включите :
    Код:
    ; 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
    и перезапустите апач командой: apache2ctl restart
    Или так: /etc/init.d/apache2 reload
    3.Или просто пишем код так:
    Код:
    <?php
    //тут сам код..
    ?>
    P.S.
    Если используете Убунту , то перед командами пишем : sudo
    Akwoyning, Stranger, FrozenThrone и ещё 1-му нравится это.
Черновик сохранён Черновик удалён
Similar Threads
  1. ricco
    Ответов:
    4
    Просмотров:
    1.174
Загрузка...
Статус темы:
Закрыта.

Поделиться этой страницей