Jump to content

Archived

This topic is now archived and is closed to further replies.

leedude

XHTML with php

Recommended Posts

is there a way i can set my httpd server to generate xhtml pages with the xphp extension?

The php parts of my httpd.conf file:

[code]
LoadModule php5_module /modules/libphp5.so
AddHandler php5-script php
AddHandler php5-script xphp
AddType text/html php
AddType text/xhtml xphp
[/code]
It isn't passing the xphp documents as xhtml, just html.
.xhtml documents work as xhtml though.

I am testing this with a piece of code that generates a table with the <table> tag in capital letters (this brings an error in table.xhtml, but not in table.html as xhtml is case-sensitive where as html isn't).
table.php and table.xphp both work! Why?

Share this post


Link to post
Share on other sites
ok, ive managed to get it to pass xphp as xhtml by setting the default mime type in php.ini to:
[code]application/xhtml+xml[/code]
Though this means that is doesnt pass php as html any more, but as xhtml.
It is as if the settings in httpd.conf do not affect it at all.
I've tried commenting the default mime type line in php.ini out, but that just makes it output as text/html.
I have updated my httpd.conf file to be:
[code]LoadModule php5_module /modules/libphp5.so
AddHandler php5-script .php
AddHandler php5-script .xphp
AddType text/html .php
AddType application/xhtml+xml .xphp[/code]

Please Help.

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.