[SOLVED] Random Block works on dev server, not on prod
coberg
Joined: 2005-12-13
Posts: 13 |
Posted: Thu, 2006-02-02 02:44 |
Gallery URL (optional but very useful): http://www.flagsonthe48.org/forums/modules.php?op=modload&name=gallery&file=index I recent moved this website over from another host where the image block was working well. Once I got it to the new host, it stopped working but only in the one way I needed it to work. If I simply link to the block-random.php file everything works well, but then when anyone clicks on the image, they go to the non-embedded version which I don't want. If I use the full embedded URL I get errors: Quote:
main(/home/the8r/flagsonthe48.org/forums/modules.php?op=modload&name=gallery&file=index&include=block-random.php): failed to open stream: No such file or directory Oddly enough, when I use this exact configuration on my dev server (FC4, Apache 2.0.54, php 5.0.4) and point to the Gallery on the production server, it works fine! I posted a sample of what I mean: http://www.flagsonthe48.org/testindex.php Any help would be appreciated! Thanks! |
|
Posts: 2258
"when I use this exact configuration on my dev server (FC4, Apache 2.0.54, php 5.0.4) and point to the Gallery on the production server"
perhaps it has to do with url fopen versus local file fopen?
Posts: 13
Thought I would post the solution to this, since it was not found here. It turns out that with allow_url_fopen disabled, php has to be able to serve exactly what is written in the include, so if I reference the block-random.php file itself, we're all set. However, when Gallery is embedded in phpBB, the block-random.php file called within the modules.php page, so php has to parse all of the "?op=modload&name=gallery&file=index&include=block-random.php" - which it can't do, so it tries to call a file with all that extra information, which it can't do.
So the solution?
Use cURL. The code I used is:
Problem solved.
Posts: 7
Thanks!! Great solution, really handy a forum like this, also found another solution just ago, keep it coming!