Php includes not doing their job

software development

#1

Since yesterday, I have been getting this on my site. I’ve been using php includes for over two months and haven’t changed anything in the coding;everything was working just fine until yesterday when I this showed up out of nowhere.

[b]Warning: main(): URL file-access is disabled in the server configuration in /home/.sagebrush/cenamaria/cenamaria.com/blog/index.php on line 1

Warning: main(http://cenamaria.com/header.php): failed to open stream: no suitable wrapper could be found in /home/.sagebrush/cenamaria/cenamaria.com/blog/index.php on line 1

Warning: main(): Failed opening ‘http://cenamaria.com/header.php’ for inclusion (include_path=’.:/usr/local/lib/php’) in /home/.sagebrush/cenamaria/cenamaria.com/blog/index.php on line 1[/b]

I don’t understand because I haven’t made any changes to files or anything. None of my php includes are working on my http://cenamaria.com domain but the php includes are working on my two subdomains just fine. It’s as though it has changed overnight or something. Is it a problem with the server or what?

I’m not too knowledgable with php so anything about pathes, etc. you’ll have to break it down for me.


#2

Read this Thread:

Dreamhosts Policy on fopen and remote URLS

I40.com - Home Page
MP3Mystic - Personal Streaming Music server.
(No longer hosted with Dreamhost)


#3

I read it and I still don’t understand what is going on at all. I need someone to seriously break this down for me. All I know is includes. Everything from curl to magpie or whatever is WAY over my head.


#4

How are you doing your includes? If you are doing them like this, then you’ll have a problem:

<?php include("http://cenamaria.com/footer.php"); ?>That kind of path is called a remote path (sometimes erroneously referred to as an absolute path). Since the file you are including is a local file, there is no need to access it with the full remote pathname. I recommend using an absolute path (also called “relative from root”), like this:

<?php include($_SERVER['DOCUMENT_ROOT']."/footer.php"); ?>Give it a try. If it doesn’t work, come back here and we’ll see if is related to something else.


Simon Jessey
Keystone Websites | si-blog


#5

Hi. I have the same problem but what I’m trying to include is a counter file instead of a footer. I tried your document root thing and it doesn’t work for me. It seems the document root doesn’t include the “.abdonwasher” part, and I think that’s why the error I get says there’s there’s no such file.

Also, I still get that “failed opening blahblah for inclusion” error.

I use PHP includes on the same file and it works just fine. It points simply to “menu.txt,” yet when I try to include “counter/count.php?id=1,” it does not work. Any ideas?


#6

You don’t need that bit. In fact, it is unwise to include it because you may get moved to a different server (which would break the include).

I’ve never tried including anything with a querystring, so I can’t help you with that bit, but the path should be the same.


Simon Jessey
Keystone Websites | si-blog


#7

Oh I see. Well it didn’t work for me, but thanks. I hope there’s another solution out there. I can use an iFrame but then it looks pretty ugly.