473,657 Members | 2,427 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Apache2, PHP, and the W3C xhtml validator

Hello NG

Sorry if this is the wrong NG to post this in. 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.

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.**

My understanding in this instance, that the page should
be processed and delivered to the validator. This isnt happening. Does
anyone have an idea why it is failing in this manner?

At this stage, I am confused as to whether its a setting in PHP or Apache
that needs adjusting. As info.php works through my web-browser, I dont
understand why the page isnt being validated.

Any advice would be thankfully received!

--
== cBe! ==== @ntho === 8 ^ ) =============== =============== ==========
== Famous last words from Registered Linux User #296186 =============
== "I would have made a good Pope." - Richard M. Nixon (1913-1994) ==

Jul 17 '05 #1
9 5119
Antho <pr**********@c oz.spam.sux> writes:
Sorry if this is the wrong NG to post this in. 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.

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.**

My understanding in this instance, that the page should
be processed and delivered to the validator. This isnt happening. Does
anyone have an idea why it is failing in this manner?
Apparently the page is being delivered to the validator -- it's
just being delivered with a Content-Type that the validator doesn't
like.
At this stage, I am confused as to whether its a setting in PHP or Apache
that needs adjusting. As info.php works through my web-browser, I dont
understand why the page isnt being validated.


What's default_mimetyp e set to in php.ini? Have you set it to
application/octet-stream anywhere?

--
Michael Fuhr
http://www.fuhr.org/~mfuhr/
Jul 17 '05 #2
Posted by Michael Fuhr on Sun, 16 Nov 2003 18:15:57 -0700:

<smipped stuff>
Apparently the page is being delivered to the validator -- it's
just being delivered with a Content-Type that the validator doesn't
like.
Hmmm ... thanks! That makes sense, I think.
What's default_mimetyp e set to in php.ini? Have you set it to
application/octet-stream anywhere?


Not that I am aware. As far as I know it is a standard install.

This is what /etc/php.ini has:

; As of 4.0b4, PHP always outputs a character encoding by default in
; the Content-type: header. To disable sending of the charset, simply
; set it to be empty.
;
; PHP's built-in default is text/html
default_mimetyp e = "text/html"
;default_charse t = "iso-8859-1"

--
== cBe! ==== @ntho === 8 ^ ) =============== =============== ==========
== Famous last words from Registered Linux User #296186 =============
== "I would have made a good Pope." - Richard M. Nixon (1913-1994) ==

Jul 17 '05 #3
Antho <pr**********@c oz.spam.sux> writes:
Posted by Michael Fuhr on Sun, 16 Nov 2003 18:15:57 -0700:
What's default_mimetyp e set to in php.ini? Have you set it to
application/octet-stream anywhere?


Not that I am aware. As far as I know it is a standard install.

This is what /etc/php.ini has:

; As of 4.0b4, PHP always outputs a character encoding by default in
; the Content-type: header. To disable sending of the charset, simply
; set it to be empty.
;
; PHP's built-in default is text/html
default_mimetyp e = "text/html"
;default_charse t = "iso-8859-1"


Is your PHP installation using /etc/php.ini? Some installations
look for php.ini elsewhere, such as in /usr/local/lib. A phpinfo()
page will show you which php.ini file PHP is using, and it'll show
you the configuration settings.

--
Michael Fuhr
http://www.fuhr.org/~mfuhr/
Jul 17 '05 #4
Posted by Michael Fuhr on Sun, 16 Nov 2003 21:35:24 -0700:
Is your PHP installation using /etc/php.ini? Some installations
look for php.ini elsewhere, such as in /usr/local/lib. A phpinfo()
page will show you which php.ini file PHP is using, and it'll show
you the configuration settings.


Yes, phpinfo() shows it is using /etc/php.ini.

--
== cBe! ==== @ntho === 8 ^ ) =============== =============== ==========
== Famous last words from Registered Linux User #296186 =============
== "I would have made a good Pope." - Richard M. Nixon (1913-1994) ==

Jul 17 '05 #5
Antho wrote:
The only thing is, when I upload the info.php file to the W3C validator,
it complains:
I'm guessing you're using the validator's upload facility to upload
your file for validation. I'm not aware of any case where I'd wish to
validate a PHP file against an *ML DTD. Why do you wish to do so?
**Sorry, I am unable to validate this document because its content type is
application/octet-stream, which is not currently supported by this service.**


When you're uploading a file, your browser should send along a
Content-Type header; in the absence of that header, text/plain is
assumed. Your browser's evidently sending your file with a Content-
Type of application/octet-stream, which, as the error message says,
isn't supported by the W3C's validator.

If you're hellbent on validating PHP files by uploading them from
your system, try the WDG's HTML validator instead, or figure out how
to get your browser to send a Content-Type of text/html.

--
Jock
Jul 17 '05 #6
Antho <pr**********@c oz.spam.sux> writes:
Posted by Michael Fuhr on Sun, 16 Nov 2003 21:35:24 -0700:
Is your PHP installation using /etc/php.ini? Some installations
look for php.ini elsewhere, such as in /usr/local/lib. A phpinfo()
page will show you which php.ini file PHP is using, and it'll show
you the configuration settings.


Yes, phpinfo() shows it is using /etc/php.ini.


I overlooked something that John Dunlop commented on in another
followup: you said that you were *uploading* the file to the W3C
Validation Service. I assumed (Bad Mike! Bad Mike!) that you were
using the "Validate URI" button to have the validator check the
output of a PHP page rather than using the "Validate File" button
to check the page containing the PHP source. Sorry about not asking
for clarification on that point.

If you want to validate the output of a PHP page (i.e., not the PHP
source but rather the output it produces) but you don't have a web
server that the W3C validator could reach, then load the page in
your browser (or use a tool like wget) and save it as a .html file,
then upload that file to the validator.

--
Michael Fuhr
http://www.fuhr.org/~mfuhr/
Jul 17 '05 #7
John Dunlop <jo*********@jo hndunlop.info> writes:
If you're hellbent on validating PHP files by uploading them from
your system, try the WDG's HTML validator instead, or figure out how
to get your browser to send a Content-Type of text/html.


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.

--
Michael Fuhr
http://www.fuhr.org/~mfuhr/
Jul 17 '05 #8
Posted by John Dunlop on Tue, 18 Nov 2003 16:35:05 +0000:
I'm guessing you're using the validator's upload facility to upload
your file for validation. I'm not aware of any case where I'd wish to
validate a PHP file against an *ML DTD. Why do you wish to do so?


Sorry John, I was unclear. I wanted to validate the output of the php
file, not the php itself.

I have gotten a solution to this problem and I am going to post it to the
NG's that I asked for help on.

Thanks for replying ...

--
== cBe! ==== @ntho === 8 ^ ) =============== =============== ==========
== Famous last words from Registered Linux User #296186 =============
== "I would have made a good Pope." - Richard M. Nixon (1913-1994) ==

Jul 17 '05 #9
Posted by Michael Fuhr on Tue, 18 Nov 2003 11:05:50 -0700:
If you want to validate the output of a PHP page (i.e., not the PHP
source but rather the output it produces) but you don't have a web
server that the W3C validator could reach, then load the page in
your browser (or use a tool like wget) and save it as a .html file,
then upload that file to the validator.


Michael, you actually supplied the solution in an
earlier posting to my question.

Adding php to the appropriate line in my /etc/mime.types file worked. I
can see the page on my browser, plus, the W3C validator now accepts the
file type as well.

I am going to put it up on the NG's I asked on. It was so simple. I am
surprised that my searching didnt turn it up. I spent about 4 hours
yesterday wracking my brains about it.

Anyway, I am a happy chappy now ... thanks for your help on this.

--
== cBe! ==== @ntho === 8 ^ ) =============== =============== ==========
== Famous last words from Registered Linux User #296186 =============
== "I would have made a good Pope." - Richard M. Nixon (1913-1994) ==

Jul 17 '05 #10

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
2897
by: Antho | last post by:
Firstly, thank you to everyone that replied to my OP. I am new to the PHP world and so its great that there are people out there who are prepared to share their knowledge. Anyway, I am developing a website on my home pc. I dont have server-space outside my home. So, I needed to be able to validate my code by file upload to the W3C's html validator at http://validator.w3.org/ This solution is so easy, I am surprised that my extensive...
13
2920
by: Ben Sharvy | last post by:
Is there a list of the changes you need to make to HTML 4.1 cose to make it dual compliant, with XHTML 1.1 also?
59
4753
by: Philipp Lenssen | last post by:
I've tested some of the new Nokia 6600 functionality. It ships with WAP2 and XHTML Support (it says). What it does is check the Doctype -- if it's not the XHTML Mobile Profile Doctype, but a XHTML1.0 Strict one, the media-handheld CSS is _ignored_. Only with the Nokia Doctype, the CSS is used. I find this really annoying as it goes against the whole idea of media-independent XHTML Strict along with stylesheets. On the good side, WML...
3
4093
by: Ney André de Mello Zunino | last post by:
Hello. I decided to start experimenting with XHTML 2.0, having never messed with any of its previous versions, except for a quick look at XHTML 1.0 when it came out. When I tried to validate the test document I was working on, I noticed that the W3C's validator does not yet deal with XHTML 2.0 files. Does anybody know of a validator that does? Also, does anybody have any information on when W3C will be updating their validator in order...
37
2740
by: Roedy Green | last post by:
does converting the XHTML make matters better or worse vis a vis CSS not behaving the way you expect? -- Bush crime family lost/embezzled $3 trillion from Pentagon. Complicit Bush-friendly media keeps mum. Rumsfeld confesses on video. http://www.infowars.com/articles/us/mckinney_grills_rumsfeld.htm Canadian Mind Products, Roedy Green. See http://mindprod.com/iraq.html photos of Bush's war crimes
9
2333
by: rbronson1976 | last post by:
Hello all, I have a very strange situation -- I have a page that validates (using http://validator.w3.org/) as "XHTML 1.0 Strict" just fine. This page uses this DOCTYPE: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> When I change the DOCTYPE to (what should be the equivalent):
11
4204
by: Tomek Toczyski | last post by:
What is the best way to attach a caption to an image in xhtml? I can attach a caption to a table by a "<caption>" tag but I would like to do sth similar to an image. How to do it in a natural way? -tt.
4
1280
by: Alan Silver | last post by:
Hello, I have a site that produces 100% valid XHTML 1.0 Strict when viewed in a browser (IE, Firefox, etc). I just tried validating the site with an on-line validator, and got several errors. It seems that the framework is sending the validator down-level code, as it assumes that the validator is a down-level browser. Is there any way to stop this? At the moment, anyone checking it (which
11
3096
by: Michael Powe | last post by:
How can I make an XHTML-compliant form of an expression in this format: document.write("<scr"+"ipt type='text/javascript' src='path/to/file.js'>"+"</scr"+"ipt>"); this turns out to be a non-trivial exercise. inserting '&lt;' and '&gt;' causes the browser to write the text to the page as literal text rather than as the intended script element. Using escape codes seemed to work (makes it standard compliant) but the text is not written to...
0
8402
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8315
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8829
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8734
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
7341
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6172
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4323
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2733
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
1627
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.