Will not ../ include

Problems with the Windows version of XAMPP, questions, comments, and anything related.

Will not ../ include

Postby Shumba » 29. March 2012 21:04

Wont include unless its in the same folder. :roll:
Its also ignoring my style sheet

Code: Select all
include ('settings.php');

works perfectly

Code: Select all
include ('../../settings.php');

Dose not work perfectly!

Code: Select all
Warning: include(settings.php) [function.include]: failed to open stream: No such file or directory in C:\xampp\htdocs\GryphonScript\Users\UserName\User profile.php on line 3

Warning: include() [function.include]: Failed opening 'settings.php' for inclusion (include_path='.;C:\xampp\php\PEAR') in C:\xampp\htdocs\GryphonScript\Users\UserName\User profile.php on line 3


Iv done a little digging but I didn’t find a fix yet, someone said it might be a setting in XAMPP tho im not sure id know how to fix that even if i knew where it was and what i was changing! (Relatively new to this)

XAMPP control panel V 2.5
XAMPP V 1.7.7
Windows 7 64bit
Shumba
 
Posts: 6
Joined: 26. March 2012 01:32
Operating System: windows 7 64bit

Re: Will not ../ include

Postby WilliL » 30. March 2012 18:30

have a look to your error.log, it will show you what's wrong
Willi
WilliL
 
Posts: 660
Joined: 08. January 2010 10:54
Operating System: Win7Home Prem 64 SP1

Re: Will not ../ include

Postby Shumba » 30. March 2012 19:28

WilliL wrote:have a look to your error.log, it will show you what's wrong


Its ignoring the " ../../ " bit :(
Code: Select all
[Fri Mar 30 19:17:43 2012] [error] [client 127.0.0.1] File does not exist: C:/xampp/htdocs/GryphonScript/Users/UserName/style.css, referer: http://127.0.0.1/gryphonscript/Users/UserName/User%20profile.php
[Fri Mar 30 19:17:43 2012] [error] [client 127.0.0.1] File does not exist: C:/xampp/htdocs/GryphonScript/Users/UserName/username, referer: http://127.0.0.1/gryphonscript/Users/UserName/User%20profile.php
[Fri Mar 30 19:17:43 2012] [error] [client 127.0.0.1] File does not exist: C:/xampp/htdocs/GryphonScript/Users/UserName/01.jpg, referer: http://127.0.0.1/gryphonscript/Users/UserName/User%20profile.php
[Fri Mar 30 19:17:43 2012] [error] [client 127.0.0.1] File does not exist: C:/xampp/htdocs/GryphonScript/Users/UserName/02.jpg, referer: http://127.0.0.1/gryphonscript/Users/UserName/User%20profile.php


The files are located in C:/xampp/htdocs/GryphonScript/
page requesting them located in C:/xampp/htdocs/GryphonScript/Users/UserName/

Also
include ('../../settings.php');
and
include ('../../LoginCookieCheck.php');
don’t appear to get a mention in this log, assuming im looking at the right log :?

Code: Select all
<!DOCTYPE html>
<?php
include ('../../settings.php');
include ('../../LoginCookieCheck.php');
?>
<HTML>
<HEAD>
<LINK REL=StyleSheet HREF="../../style.css" TYPE="text/css">
</HEAD>
Shumba
 
Posts: 6
Joined: 26. March 2012 01:32
Operating System: windows 7 64bit

Re: Will not ../ include

Postby WilliL » 31. March 2012 21:55

Shumba wrote:
Code: Select all
[Fri Mar 30 19:17:43 2012] [error] [client 127.0.0.1] File does not exist: C:/xampp/htdocs/GryphonScript/Users/UserName/style.css, referer: http://127.0.0.1/gryphonscript/Users/UserName/User%20profile.php


The files are located in C:/xampp/htdocs/GryphonScript/
page requesting them located in C:/xampp/htdocs/GryphonScript/Users/UserName/

Code: Select all
<!DOCTYPE html>
<?php
include ('../../settings.php');
include ('../../LoginCookieCheck.php');
?>
<HTML>
<HEAD>
<LINK REL=StyleSheet HREF="../../style.css" TYPE="text/css">
</HEAD>


I'm not sure (I allways wor with absolute links) - try
Code: Select all
<LINK REL=StyleSheet HREF="http://127.0.0.1/gryphonscript/style.css" TYPE="text/css">

If it works, "../" is useble on file funktions and not on link functions
Willi
WilliL
 
Posts: 660
Joined: 08. January 2010 10:54
Operating System: Win7Home Prem 64 SP1

Re: Will not ../ include

Postby Shumba » 01. April 2012 02:24

Thanks that got the style sheet working!
It added another line to that page "http:// wrapper is disabled in the server configuration"
If that is poke-able ... where do I poke? *rubs hand together* :D :D

Code: Select all
Warning: include() [function.include]: http:// wrapper is disabled in the server configuration by allow_url_include=0 in C:\xampp\htdocs\GryphonScript\Users\UserName\User profile.php on line 3
Warning: include(http://127.0.0.1/gryphonscript/settings.php) [function.include]: failed to open stream: no suitable wrapper could be found in C:\xampp\htdocs\GryphonScript\Users\UserName\User profile.php on line 3
Warning: include() [function.include]: Failed opening 'http://127.0.0.1/gryphonscript/settings.php' for inclusion (include_path='.;C:\xampp\php\PEAR') in C:\xampp\htdocs\GryphonScript\Users\UserName\User profile.php on line 3
Shumba
 
Posts: 6
Joined: 26. March 2012 01:32
Operating System: windows 7 64bit

Re: Will not ../ include

Postby Sharley » 01. April 2012 02:47

If you include the http:// in your url then using the wrapper it may be applied twice like so
Code: Select all
http://http://127.0.0.1/gryphonscript/style.css

So try simply
Code: Select all
127.0.0.1/gryphonscript/style.css in your link

I don't know if that is your issue but might be worth a try.
User avatar
Sharley
AF Moderator
 
Posts: 3316
Joined: 03. October 2008 05:10
Location: Yeppoon, Australia Time Zone: GMT/UTC+10
Operating System: Win 7 Pro 32bit/XP Pro SP3

Re: Will not ../ include

Postby Shumba » 01. April 2012 18:38

Sharley wrote:If you include the http:// in your url then using the wrapper it may be applied twice like so
Code: Select all
http://http://127.0.0.1/gryphonscript/style.css

So try simply
Code: Select all
127.0.0.1/gryphonscript/style.css in your link

I don't know if that is your issue but might be worth a try.



That killed the style sheet and includes say...
Code: Select all
Warning: include(127.0.0.1/gryphonscript/settings.php) [function.include]: failed to open stream: No such file or directory in C:\xampp\htdocs\GryphonScript\Users\UserName\User profile.php on line 3

Warning: include() [function.include]: Failed opening '127.0.0.1/gryphonscript/settings.php' for inclusion (include_path='.;C:\xampp\php\PEAR') in C:\xampp\htdocs\GryphonScript\Users\UserName\User profile.php on line 3


The stylesheet seams happy with the http:// ... the includeds just dun like anything! lol :lol:
Shumba
 
Posts: 6
Joined: 26. March 2012 01:32
Operating System: windows 7 64bit

Re: Will not ../ include

Postby WilliL » 01. April 2012 19:09

Shumba wrote:
Code: Select all
Warning: include() [function.include]: http:// wrapper is disabled in the server configuration by allow_url_include=0 in C:\xampp\htdocs\GryphonScript\Users\UserName\User profile.php on line 3
Warning: include(http://127.0.0.1/gryphonscript/settings.php) [function.include]: failed to open stream: no suitable wrapper could be found in C:\xampp\htdocs\GryphonScript\Users\UserName\User profile.php on line 3
Warning: include() [function.include]: Failed opening 'http://127.0.0.1/gryphonscript/settings.php' for inclusion (include_path='.;C:\xampp\php\PEAR') in C:\xampp\htdocs\GryphonScript\Users\UserName\User profile.php on line 3

on including a fie use "../" or "c:/xampp/htdocs/..etc"
on linking or refering to a LINK use "http://127.0.0.1/..etc"
Willi
WilliL
 
Posts: 660
Joined: 08. January 2010 10:54
Operating System: Win7Home Prem 64 SP1

Re: Will not ../ include

Postby Shumba » 01. April 2012 20:52

WilliL wrote:
Shumba wrote:
Code: Select all
Warning: include() [function.include]: http:// wrapper is disabled in the server configuration by allow_url_include=0 in C:\xampp\htdocs\GryphonScript\Users\UserName\User profile.php on line 3
Warning: include(http://127.0.0.1/gryphonscript/settings.php) [function.include]: failed to open stream: no suitable wrapper could be found in C:\xampp\htdocs\GryphonScript\Users\UserName\User profile.php on line 3
Warning: include() [function.include]: Failed opening 'http://127.0.0.1/gryphonscript/settings.php' for inclusion (include_path='.;C:\xampp\php\PEAR') in C:\xampp\htdocs\GryphonScript\Users\UserName\User profile.php on line 3

on including a fie use "../" or "c:/xampp/htdocs/..etc"
on linking or refering to a LINK use "http://127.0.0.1/..etc"


useing this line
Code: Select all
include ('http://127.0.0.1/gryphonscript/settings.php');
Shumba
 
Posts: 6
Joined: 26. March 2012 01:32
Operating System: windows 7 64bit

Re: Will not ../ include

Postby WilliL » 01. April 2012 21:31

Shumba wrote:useing this line
Code: Select all
include ('http://127.0.0.1/gryphonscript/settings.php');

here you want to include a file
Code: Select all
include ('c:/xampp/gryphonscript/settings.php');
// or
include  ('../../settings.php');

sorry, I don't know how to explain it better
Willi
WilliL
 
Posts: 660
Joined: 08. January 2010 10:54
Operating System: Win7Home Prem 64 SP1

Re: Will not ../ include

Postby Shumba » 01. April 2012 22:04

Ok something odd is going on here... :shock:
include ('../../settings.php'); has just started working?! That is exactly how I started before when i wasn’t working and I haven’t altered anything else!

I can only assume there’s something unstable about the software handling this.
I will re-download and reinstall later and let you know if it breaks again.

Worth pointing out that others posts I found here with the same issue didn’t seem to find a fix for it.

For the record the style sheet now also is working with
<LINK REL=StyleSheet HREF="../../style.css" TYPE="text/css">
Shumba
 
Posts: 6
Joined: 26. March 2012 01:32
Operating System: windows 7 64bit

Re: Will not ../ include

Postby Altrea » 02. April 2012 18:04

Shumba wrote:I can only assume there’s something unstable about the software handling this.

I assume you are running in some kind of cache issue.
relative paths have always worked in HTML link header.

just my two cents,
Altrea
We don't provide any support via personal channels like PM, email, Skype, TeamViewer!

It's like porn for programmers 8)
User avatar
Altrea
AF Moderator
 
Posts: 8195
Joined: 17. August 2009 13:05
XAMPP version: several
Operating System: Windows 10 Pro x64

Re: Will not ../ include

Postby Theslcguy » 23. April 2012 21:10

Try using assigning your url a variable

For Stylesheet

$url = "http://127.0.0.1/";
<a href="<?php echo $url; ?>gryphonscript/style.css">
Theslcguy
 
Posts: 11
Joined: 23. April 2012 21:06
Operating System: Win7


Return to XAMPP for Windows

Who is online

Users browsing this forum: No registered users and 59 guests