raffix2 Posted December 10, 2012 Posted December 10, 2012 OK, i'm trying to revamp my website for 2013 and I've started from scratch to redo everything. I'm a self-thought web designer, I actually know nothing about it, but i'm good at getting the information I need and I am usually able to get things done on my own, but now, i'm having the worst time trying to figure this out. My website(http://www.jfpoitras.com) is showing a bunch or error about include path: Warning: include() [function.include]: Failed opening 'http://www.jfpoitras.com/sections/logo.php' for inclusion (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/raffix/public_html/index.php on line 14 & Warning: include() [function.include]: http:// wrapper is disabled in the server configuration by allow_url_include=0 in /home/raffix/public_html/index.php on line 14 It used to work well before when i used the PHP include command for repeating sections. I think I screwed things over when i used the NetBeans feature in "Run configuration" to have a remote connection to my ftp and upload changed files. I used to do it manually with FileZilla, and I think I shouldn't change that in my process. I think the key to this error is in the path shown here : (include_path='.:/usr/lib/php:/usr/local/lib/php') that path does not look right to me, it seems repeated with the extra local folder. Can anyone help me?
Shinryuu Posted December 10, 2012 Posted December 10, 2012 I think the key is this: Warning: include() [function.include]: http:// wrapper is disabled in the server configuration by allow_url_include=0 in /home/raffix/public_html/index.php on line 14 might wanna fix that. Every error on your page starts with the wrapper being disabled. 1
raffix2 Posted December 10, 2012 Author Posted December 10, 2012 OK that's great ... how did I manage to disable the wrapper, and how do I re-enable it now !? Also .. what is the wrapper? .. i do have a <div id="wrapper"> is that it ... please tell me like i'm 5 year old (in details)
Shinryuu Posted December 10, 2012 Posted December 10, 2012 how did I mange to disable the wrapper It's likely set that way by default as a security measure, don't point to resources with http:// use $_SERVER['DOCUMENT_ROOT']."myfolder/myfile.php" or relative paths.
raffix2 Posted December 10, 2012 Author Posted December 10, 2012 Hmm i'm not sure I understand what you mean. Did you mean to change my code from: <?php include 'http://www.jfpoitras.com/sections/title.php'; ?> to <?php include '/sections/title.php'; ?>
raffix2 Posted December 10, 2012 Author Posted December 10, 2012 Nope .. that didn't fix anything. I didn't think it would, as I said I was using include before the errors showed up. Ther errors showed after I let NetBeans upload files to my FTP. Seriously, I don't understand what I need to do to fix this, I need some PHP expert and maybe someone that can actually change the PHP configuration on the server. When i log to the Cpanel and go to the PHP configuration section, everything is static, I cannot change anything. It's probably better this way since I wouldn't know what to change to fix this. I would like to add, that english is not my first language, and that I'm serious about explaining stuff in details to me, when you write stuff like "use $_SERVER['DOCUMENT_ROOT']." I don't understand what you are talking about, I need details, FAQ, i need it to be explained to me as if I was a 5 year old kid. I think that the issue is located around this: wrapper is disabled in the server configuration by allow_url_include=0 Where can I modify the allow_url_include parameter?
ExtremeGaming Posted December 10, 2012 Posted December 10, 2012 You can not include a file via url for security reasons. Php settings are unchangeable by the user. Where is the file in correlation to where you are trying to include it? $_SERVER['DOCUMENT_ROOT'] is a php function that will use the full path to your root directory /something/something/something/public_html/
raffix2 Posted December 10, 2012 Author Posted December 10, 2012 wow i'm not trying to include files from another server, but simple php files, that's it.
ExtremeGaming Posted December 10, 2012 Posted December 10, 2012 Changeinclude 'sections/title.php'; to include $_SERVER['DOCUMENT_ROOT'].'/sections/title.php';
raffix2 Posted December 10, 2012 Author Posted December 10, 2012 ok, i'm trying to make a very very very simple website here's my index.php <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="content-type" content="text/html; charset=utf-8" /> <title>www.JFPoitras.com</title> <meta name="keywords" content="" /> <meta name="description" content="" /> <link href="/css/main.css" rel="stylesheet" type="text/css" media="screen, projection"> </head> <body> <div id="wrapper"> <div id="header"> <div id="logo"> <?php include '/sections/logo.php'; ?> </div> <!-- closing div #logo --> <div id="title"> <?php include '/sections/title.php'; ?> </div> <!-- closing div #title --> </div> <!-- closing div #header --> <div id="menu"> <?php include '/sections/menu.php'; ?> </div> <!-- closing div #menu--> <div id="content"> <h1>Hello World!</h1> <p class="paragraph"> Welcome to my site! </p> <br> <br> <p class="paragraph"> Please come back later. </p> <br> <br> <br> <br> </div> <!-- closing div #content --> <div id="widget"> </div> <!-- closing div #widget --> </div> <!-- closing div #wrapper --> <div id="footer"> <?php include '/sections/footer.php'; ?> </div> <!-- closing div #footer --> </body> </html> and here's what is in the /sections/logo.php <a href="index.php" style="text-decoration: none"><img src="/images/jfhead.jpg" border="0" alt="www.JFPoitras.com"></a> I have other little bits of HTML code within the php files i include (logo.php, title.php, menu.php, footer.php). And I do this so that these sections of my website, which will be repeated on every page can be easily changed lateron, by only updating that particular php file, not every page in my website. I'm not trying to access, include, require from any other server, just using a simple time saving feature of PHP. ok I tried that, here's my index.php now: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="content-type" content="text/html; charset=utf-8" /> <title>www.JFPoitras.com</title> <meta name="keywords" content="" /> <meta name="description" content="" /> <link href="/css/main.css" rel="stylesheet" type="text/css" media="screen, projection"> </head> <body> <div id="wrapper"> <div id="header"> <div id="logo"> <?php include $_SERVER['DOCUMENT_ROOT'].'/sections/logo.php'; ?> </div> <!-- closing div #logo --> <div id="title"> <?php include $_SERVER['DOCUMENT_ROOT'].'/sections/title.php'; ?> </div> <!-- closing div #title --> </div> <!-- closing div #header --> <div id="menu"> <?php include $_SERVER['DOCUMENT_ROOT'].'/sections/menu.php'; ?> </div> <!-- closing div #menu--> <div id="content"> <h1>Hello World!</h1> <p class="paragraph"> Welcome to my site! </p> <br> <br> <p class="paragraph"> Please come back later. </p> <br> <br> <br> <br> </div> <!-- closing div #content --> <div id="widget"> </div> <!-- closing div #widget --> </div> <!-- closing div #wrapper --> <div id="footer"> <?php include $_SERVER['DOCUMENT_ROOT'].'/sections/footer.php'; ?> </div> <!-- closing div #footer --> </body> </html> And I still see all the errors. It is my understanding that changing my code in index.php is not how to solve this because it was working well before. Something to do with the php.ini file or the actual server config might make more sense. But i don't think i have access to those files and I don't see how I could have manage to disable the wrapper. Btw, is the wrapper a PHP thing, or is it because i have a div with the id="wrapper" ? ok i got it to work somehow, maybe i wasn't refreshing the folders in FileZilla You can be sure I won't be using the Run feature on Netbeans anymore thanks for the help
Shinryuu Posted December 10, 2012 Posted December 10, 2012 Try clearing your cache, it's now fixed on my browser. EDIT:Sorry I was a bit late on that, had to peck my screen a lot to make a new post.
raffix2 Posted December 10, 2012 Author Posted December 10, 2012 Yeap, it all looks good now mods may mark this topic as [Answered] thanks for the help!
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now