Php includes not doing their job

Php includes not doing their job

Posted by: cenamaria
Posted on: 2005-04-22 10:18:00

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.

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


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.

Re: Php includes not doing their job

Posted by: jrahaim
Posted on: 2005-04-22 10:25:00

Read this Thread:

Dreamhosts Policy on fopen and remote URLS

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

Re: Php includes not doing their job

Posted by: cenamaria
Posted on: 2005-04-22 10:37:00

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.

Re: Php includes not doing their job

Posted by: scjessey
Posted on: 2005-04-22 11:09:00

In reply to:

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.


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.

Re: Php includes not doing their job

Posted by: GokuMew2
Posted on: 2005-04-22 16:08:00

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?

Re: Php includes not doing their job

Posted by: scjessey
Posted on: 2005-04-22 17:27:00

In reply to:

It seems the document root doesn't include the ".abdonwasher" part


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.

Re: Php includes not doing their job

Posted by: GokuMew2
Posted on: 2005-04-22 17:31:00

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.

Tags: php includesheader phpknowledgablehttpblogline 1indexmain urlserver configurationopen streamfile accesssubdomainsusrlibinclusionpath