Jump to content


XHTML with php

  • Please log in to reply
1 reply to this topic

#1 leedude

  • Members
  • PipPip
  • Member
  • 13 posts

Posted 25 July 2006 - 11:42 PM

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:

LoadModule php5_module /modules/libphp5.so
AddHandler php5-script php
AddHandler php5-script xphp
AddType text/html php
AddType text/xhtml xphp
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?

#2 leedude

  • Members
  • PipPip
  • Member
  • 13 posts

Posted 25 July 2006 - 11:56 PM

ok, ive managed to get it to pass xphp as xhtml by setting the default mime type in php.ini to:
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:
LoadModule php5_module /modules/libphp5.so
AddHandler php5-script .php
AddHandler php5-script .xphp
AddType text/html .php
AddType application/xhtml+xml .xphp

Please Help.

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users