$ head -5 index.php <?php /************************************************************************/ /* FlatNuke - Flat Text Based Content Management System */ /* ============================================ */ /* */ $ head -5 functions.php <? /** * File delle funzioni di sistema *
Siccome sul server in questione girano altri siti web e non avendo la possibilità di modificare il php.ini (è necessario avere un utente privilegiato per la modifica del file di configurazione del php e il successivo riavvio di apache) ho optato per l’inserimento del flag short_open_tag nel file “.htaccess” posizionato nella directory radice dell’installazione del sito web basato su flatnuke.
$ cat /etc/php.ini | grep -i -B12 '^short_open_tag' ; 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://www.php.net/manual/en/ini.core.php#ini.short-open-tag short_open_tag = Off
Ecco il file “.htaccess” che mi ha risparmiato la modifica di tutti i singoli file php (questa soluzione è possibile solo nel caso in cui il php viene eseguito come modulo di apache e non come CGI).
$ cat flatnuke/.htaccess php_flag short_open_tag On
Comunque, come riportato nel manuale php, è buona norma disabilitare la forma abbreviata ed utilizzare quella estesa, quindi è consigliabile impostare a Off questo valore.
[ad name=”HTML”]