Apache

From WhyNotWiki

Jump to: navigation, search

Apache  edit   (Category  edit)


[edit] Configuring with PHP

[edit] Want to use .html extension for all PHP scripts?

Good! Me too.

AddType application/x-httpd-php .php .html

For directories where you don't want .html files to be parsed (like files containing Ruby/Rdoc/etc. code):

RemoveType .html

[edit] Doesn't like your <?xml  ?> declaration?

You get errors like this:

'''Parse error''': parse error, unexpected T_STRING in /htdocs/index.html on line 1

Solution 1 (preferred):

Don't use short tags.

"Using short tags should be avoided when developing applications or libraries that are meant for redistribution, or deployment on PHP servers which are not under your control, because short tags may not be supported on the target server. For portable, redistributable code, be sure not to use short tags."

Solution 2:

# Allow <?xml ?> directives:
php_flag short_open_tag off

Solution 3:

<?php echo "<?xml"; ?>

Bold text

Personal tools