Antho <prevent-shun@coz.spam.sux> writes:
[color=blue][color=green]
> > I have installed Apache2 and PHP on my Mdk 9.2 box. I have made an
> > info.php page to test if php is working. It appears that it is as my
> > info.php is displayed as it should be on my web-browser.
> >
> > The only thing is, when I upload the info.php file to the W3C validator,
> > it complains:
> >
> > **Sorry, I am unable to validate this document because its content type
> > is application/octet-stream, which is not currently supported by this
> > service.**[/color]
>
> The solution is very easy. Thank you to Michael Fuhr for the tip![/color]
John Dunlop really deserves the thanks -- he noticed that you were
uploading a file for validation, while I initially assumed (incorrectly)
that you were submitting a URI.
[color=blue][color=green][color=darkred]
> >> Some browsers on some systems use the file ~/.mime.types,
> >> /etc/mime.types, or another such file to determine an uploaded file's
> >> Content-Type. Creating or editing one of those files and adding a line
> >> such as "text/html php" should do the trick, although I don't know what
> >> other implications that might have.[/color][/color]
>
> On Mandrake Linux 9.2, in the file /etc/mime.types change this line:
>
> text/html html htm
>
> to
>
> text/html html htm php
>
> The W3C validator will then start accepting the output of php files.[/color]
Not so fast. Your browser is probably uploading the source PHP
file, not the output. Try again at the Extended File Upload
Interface:
http://validator.w3.org/file-upload.html
Turn on "Show Source" and then upload one of your PHP files. When
you get the validation result, scroll down to "Source Listing" and
you should see your PHP code, not the output of that code. If you
want to validate the output, which is what you should be validating,
then you'll have to make sure the PHP code is actually run, either
by the web server or via the command-line interface. You'll have
to save the output somewhere and upload *that* file, not the .php
file that generated the output.
--
Michael Fuhr
http://www.fuhr.org/~mfuhr/