Назад | Перейти на главную страницу

10.6 Сервер - PHP не работает

Пытаюсь включить PHP на сервере 10.6.6, и он продолжает загружать текст php (я вижу код php в моем файле .php).

Я включил модуль php5 в админке сервера (и убедился, что он находится в httpd.conf) .. что еще я могу попробовать?

Я также удалил текущий httpd.conf и начал снова, не повезло ....

Также необходимо убедиться, что конфиг для выполнения php-кода на месте

AddHandler php5-script .php
AddType text/html .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

Не забудьте очистить кеш браузера или попробовать другой браузер.