Koozali.org: home of the SME Server
Legacy Forums => General Discussion (Legacy) => Topic started by: djhomeless on April 30, 2005, 01:02:37 AM
-
Hi Everyone,
I'm pulling my hair out over a fairly basic (so it seems) include.
One of my sites is using Gallery 2, in combination with a blogging tool (WordPress). All I'm trying to do is show a random image in WP which is failing.
Basically, the failure seems to be environmental. For example, if I try to execute the code as stated by the Gallery2 docs, it fails.
<?php readfile('http://idiotabroad.com/photos/main.php?g2_view=imageblock:External&g2_blocks=randomImage&g2_show=title'); ?>
The error is:
Warning: readfile(http://idiotabroad.com/photos/main.php?g2_view=imageblock:External&g2_blocks=randomImage&g2_show=title): failed to open stream: HTTP request failed! HTTP/1.0 404 Not Found in /home/e-smith/files/ibays/blog/html/foo.php on line 2
Now the interesting part is, if I replace the hostname, with the local IP (127.0.0.1), the function at least executes, but the image doesn't stream.
<?php readfile('http://127.0.0.1/blog/photos/main.php?g2_view=imageblock:External&g2_blocks=randomImage&g2_show=title'); ?>
I'm really lost here. Has anyone run into this problem with PHP on SME before??
Thanks all,
Geoffrey
-
I'm sure this is simple setup problem, but I don't know enough to figure it out.
Basically, if I change the code to reference the internal lan hostname, the code and image executes properly (since my client pc is on the internal lan).
<?php readfile('http://hostname/ibayname/photos/main.php?g2_view=imageblock:External&g2_blocks=randomImage&g2_show=title'); ?>
Of course this won't work externally, but it begs the question:
Why do I get a 404 if I try to execute the include using the hostname? Is PHP not able to resolve the domain?
I'm really confused here. Any help would be appreciated!
Thanks,
Geoffrey