.htaccess and disabling short_open_tag in PHP

software development

#1

Greets -

I’m attempting to disable short_open_tag for PHP by using

php_value short_open_tag off

in an .htaccess file, but this doesn’t seem to work. Has anyone been able to do this? I need to turn this off so that I can use

<?xml version="1.0" encoding="UTF-8"?>

in my XHTML documents that are served as MIME type application/xhtml+xml

Any help would be greatly appreciated.


#2

I am not sure of a way to get the short tag feature turned off, but if you want a quick fix, you can use:

<? echo '<?xml version="1.0" encoding="UTF-8"?>';?>

Hope that gets you up and running.


#3

Actually, I switched PHP to run as a module, instead of CGI. This resolved some other issues as well. Once I did that, the .htaccess file started working fine.