This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.
I am receiving the follwoing error when I try to validate a .php file; Sorry, I am unable to validate this document because its content type is application/octet-stream, which is not currently supported by this service. The Content-Type field is sent by your web server (or web browser if you use the file upload interface) and depends on its configuration. Commonly, web servers will have a mapping of filename extensions (such as ".html") to MIME Content-Type values (such as text/html). That you received this message can mean that your server is not configured correctly, that your file does not have the correct filename extension, or that you are attempting to validate a file type that we do not support yet. However, If I JUST rename the file to .html it passes validation. What could be the problem? Thanks
Your web server or your PHP code is broken. It's claiming the output of your PHP is arbitrary binary data ("application/octet-stream") instead of HTML ("text/html") as it should. Take a look at http://php.net/header or ask on some PHP related forum for help with fixing this. In either case, this is not a Validator bug.
Hi, This is the header of my php file; <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en"> <!-- Administrator registration and validation adminform.php --> <head> <title>Administrator Registration Form Validation</title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"/> Content is set to text/html as you can see.
The <meta http-equiv="Content-Type" ... is not relevant here. Also, it sounds like you are using the file upload validation rather than by web address, in this case your browser determines the Content-Type it reports to the web server when uploading the file. It probably does not recognize .php files and uses some default content type. In this case it might be difficult for you to use the file upload feature with your PHP code.
If you are using the file upload interface, try to rename your files with extensions .html, this will probably help your browser send proper content-type information with the upload. If you are using the "by URL" interface, follow the instructions in Comment #1.