PDA

View Full Version : intermittent php problem


Anonymous
02-28-2003, 05:40 PM
On my site I've got Invision Board setup and I've got an include statement on my main page that is supposed to pull the latest 5 posts from my message board and show them on the front page. My main page is supposed to include the output of a function from a php file that is part of the forums. It works sometimes, and other times it doesn't. The code I'm using on the main page for the include statement is:

include("http://www.doom3resource.net/forums/ssi.php?a=lasttopics");

The result of that produces a table that is displayed on my front page. Sometimes it works, and other times it returns an error. If I don't have the entire domain name listed and just try "/forums/ssi.php?blah" or "forums/ssi.php?blah" it returns 3 error messages instead of just 2 and it never works, but if I do include the entire domain name with the statement, it works sometimes. Does anyone know what the problem is? I get this error with the code above when it decides not to work:

Warning: php_hostconnect: connect failed in /home/virtual/site97/fst/var/www/html/index.php on line 65

Warning: Failed opening 'http://www.doom3resource.net/forums/ssi.php?a=lasttopics' for inclusion (include_path='.:/php/includes:/usr/share/php') in /home/virtual/site97/fst/var/www/html/index.php on line 65


Thanks for any help.

John
03-02-2003, 12:15 PM
Try this setting for your include:


include("home/virtual/site97/fst/var/www/html/forums/ssi.php?a=lasttopics");



John

Anonymous
03-02-2003, 04:06 PM
I tried that and got this error:

Warning: open_basedir restriction in effect. File is in wrong directory in /home/virtual/site97/fst/var/www/html/index.php on line 64

Warning: open_basedir restriction in effect. File is in wrong directory in /home/virtual/site97/fst/var/www/html/index.php on line 64

Warning: Failed opening 'home/virtual/site97/fst/var/www/html/forums/ssi.php?a=lasttopics' for inclusion (include_path='.:/php/includes:/usr/share/php') in /home/virtual/site97/fst/var/www/html/index.php on line 64

I haven't noticed the original code causing any problems in the past 24 hours so I'm not sure if it's still broken or not.

eugene
03-03-2003, 11:21 PM
Brandon-
Let me know if you are still having issues. I will try and guide you through it. (Private message me.)
-Eugene

dbmasters
03-07-2003, 08:46 PM
Try this setting for your include:


include("home/virtual/site97/fst/var/www/html/forums/ssi.php?a=lasttopics");



John

The path should begin with a /:


include("/home/virtual/site97/fst/var/www/html/forums/ssi.php?a=lasttopics");

John
03-07-2003, 09:12 PM
oops! My mistake!

Brandon
03-09-2003, 07:05 PM
I haven't changed anything on my site but it hasn't messed up in several days. Maybe it fixed itself. :)

nicklott
03-12-2003, 01:39 AM
Hey guys,
If you want to include something without putting all the directories in you can do it like this:

include($_SERVER['DOCUMENT_ROOT']."/forums/ssi.php");

It means you don't need to remember the whole dir string, helps eliminate typos and also makes your code more portable.
Don't know whether it will fix you problem or not though...

nick