Jump to content

Recommended Posts

Posted

Pages and pages of the same error happening on 100's of different pages

 

>[Fri Oct  7 19:57:16 2005] [error] PHP Warning:  main(): Failed opening '/usr/local/apache/htdocs/alpha/songs/includes/google_ads.inc' for inclusion (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/lyricsp/public_html/alpha/songs/k/knots.shtml on line 76
[Fri Oct  7 19:57:16 2005] [error] PHP Warning:  main(/usr/local/apache/htdocs/alpha/songs/includes/google_ads.inc): failed to open stream: No such file or directory in /home/lyricsp/public_html/alpha/songs/k/knots.shtml on line 76

 

I'm using regular php includes which has been working fine for months and months

 

><?php 
include $_SERVER['DOCUMENT_ROOT']."/alpha/songs/includes/google_ads.inc"; 
?>

 

The files do exist, and they do display with the page. To me the error message itself looks odd, mostly the paths mentioned.

 

I think I've been staring at it too long. :thumbup1:

Any thoughts are always greatly appreciated.

 

Thanks!

Posted (edited)

But wait - there's more!!

 

Ok, I did some more thinking and it looks like all my content (almost 30,000 pages) is getting indexed by Google (at least) two ways. The first listing reads "Supplemental Result" and is listed by ip/~user/........ followed by a regular listing.

 

Try both of these and you'll see...

 

207.44.240.63/~lyricsp/alpha/songs/g/greenwoodcreek.shtml

 

lyricsplayground.com/alpha/songs/g/greenwoodcreek.shtml

 

It's the first one causing errors. Why?? And why is it even listed there??

 

Anyway - do I need to put some sort of redirect in .htaccess? Is that even the thing to do and how?

 

Thanks again.

Edited by boxturt
Posted

Hi Boxturt,

 

It's because you are including the file by reference - the clue is in the error

>Failed opening '/usr/local/apache/htdocs/alpha/songs/includes/google_ads.inc' for inclusion

which it not looking for the include in your file space.

 

Try something like

>RewriteEngine On
RewriteCond %{HTTP_HOST} !^lyricsplayground.com$ [NC]
RewriteRule ^(.*)$ http://lyricsplayground.com/$1 [R,L]

 

in your .htaccess - please note, that this does depend on if you have subdomains / other redirects in your .htaccess.

Posted

It works!! :thumbup1: Thank you, thank you.

 

I first put it in the htaccess file in the songs directory and got a 404 error. Then I put added it to the root htaccess file and victory was ours!

 

It's because you are including the file by reference - the clue is in the error

 

I'm lost here. :clapping: Could you tell me how else to should/could include this? (for future reference)

 

Thanks kindly Andy.

Posted

Hi Boxturt,

 

I'm glad it's all sorted now :)

 

Now you have that in your .htaccess it should be fine about everything in the future - apart from if you use subdomains.

 

Basically some scripts do not like to run without the domain name, often because of "includes", as in your case, where it interprets the include to reference an invalid path. There are some alternative workrounds - but they virtually all have problems of some sort or another. Unless anyone else knows of a failsafe system.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...