You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by David Blomstrom <da...@yahoo.com> on 2004/06/10 03:51:51 UTC

[users@httpd] "C is not a recognized protocol"

OK, I want to start from square one, so you'll know
exactly where I'm "coming from." If it sounds like a
PHP question at first, just bear with me.

An error message I received in ZendStudio suggested
that my include links were a security risk and that I
switch to "constant" include links. After asking
around on several forums, I finally wound up with this
replacement:

<?php include
($_SERVER['DOCUMENT_ROOT']."/includes/footer.php"); ?>

It works fine, but I'm having trouble applying it to
non-include links. For example, if I change this
link...

<a href="../../world/index.php">World</a>

to this...

<a href="<?php echo
$_SERVER['DOCUMENT_ROOT']."world/index.php"?>">World</a>

then preview my page, I see this in the source code:

<a href="C:/sites/../../world/index.php">World</a>

That looks pretty logical, but when I click the link,
I receive an error message that says "C is not a
registered protocol."

Does this mean there's something wrong with my virtual
host set up, or is this a PHP problem?

Thanks.


	
		
__________________________________
Do you Yahoo!?
Friends.  Fun.  Try the all-new Yahoo! Messenger.
http://messenger.yahoo.com/ 

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] "C is not a recognized protocol"

Posted by Chris <li...@leftbrained.org>.
Try changing

<a href="C:/sites/../../

to

<a href="file://C:\sites\..\..\

Windows *needs* backslashes , and file is the correct protocol (though I think if you *just* change the backslashes it will still work.

Chris


David Blomstrom wrote:

>OK, I want to start from square one, so you'll know
>exactly where I'm "coming from." If it sounds like a
>PHP question at first, just bear with me.
>
>An error message I received in ZendStudio suggested
>that my include links were a security risk and that I
>switch to "constant" include links. After asking
>around on several forums, I finally wound up with this
>replacement:
>
><?php include
>($_SERVER['DOCUMENT_ROOT']."/includes/footer.php"); ?>
>
>It works fine, but I'm having trouble applying it to
>non-include links. For example, if I change this
>link...
>
><a href="../../world/index.php">World</a>
>
>to this...
>
><a href="<?php echo
>$_SERVER['DOCUMENT_ROOT']."world/index.php"?>">World</a>
>
>then preview my page, I see this in the source code:
>
><a href="C:/sites/../../world/index.php">World</a>
>
>That looks pretty logical, but when I click the link,
>I receive an error message that says "C is not a
>registered protocol."
>
>Does this mean there's something wrong with my virtual
>host set up, or is this a PHP problem?
>
>Thanks.
>
>
>	
>		
>__________________________________
>Do you Yahoo!?
>Friends.  Fun.  Try the all-new Yahoo! Messenger.
>http://messenger.yahoo.com/ 
>
>---------------------------------------------------------------------
>The official User-To-User support forum of the Apache HTTP Server Project.
>See <URL:http://httpd.apache.org/userslist.html> for more info.
>To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
>   "   from the digest: users-digest-unsubscribe@httpd.apache.org
>For additional commands, e-mail: users-help@httpd.apache.org
>
>  
>


---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] "C is not a recognized protocol"

Posted by Eugene Lee <li...@fsck.net>.
On Wed, Jun 09, 2004 at 06:51:51PM -0700, David Blomstrom wrote:
: 
: <?php include
: ($_SERVER['DOCUMENT_ROOT']."/includes/footer.php"); ?>
: 
: It works fine, but I'm having trouble applying it to
: non-include links. For example, if I change this
: link...
: 
: <a href="../../world/index.php">World</a>
: 
: to this...
: 
: <a href="<?php echo
: $_SERVER['DOCUMENT_ROOT']."world/index.php"?>">World</a>

This won't work.  In PHP, it expects absolute pathnames based on the
real filesystem itself.  Statements like include() and require() and
any file I/O functions will work with absolute pathnames.  But your
HTML file does *not* work with absolute pathnames based on the real
filesystem.  It does work with pathnames that appear to be absolute,
but in reality are relative to the *start* of Apache's document root.

: Does this mean there's something wrong with my virtual
: host set up, or is this a PHP problem?

It's more of a PHP problem, although it is not only a PHP problem.
This difference is between the absolute filesystem pathname vs. the
relative ("document root") pathname that starts from some point
within the absolute pathname filesystem.


-- 
Eugene Lee

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org