My host turned on SAfe Mode for PHP so I have to use absolute pahts with php includes.
Problems is as soon as they did I received the following error from random block.
Quote:
Warning: main(errors/configure_instructions.php): failed to open stream: No such file or directory in /home/user/public/gallery/errors/unconfigured.php on line 10
Fatal error: main(): Failed opening required 'errors/configure_instructions.php' (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/user/public/gallery/errors/unconfigured.php on line 10
Any Ideas?? Its like it can't find the GAllery config without using a URL instead of an absolute path in the include.
Posts: 3474
Make sure to set $GALLERY_BASEDIR properly at the top of the page that has the random block. It should be the full Unix path to your Gallery directory. Something like:
$GALLERY_BASEDIR = '/var/www/site.com/html/gallery/';
(be sure to include the trailing slash)
-Beckett (
)
Posts: 14
Thanks. Now the photos display, but the code kicks out the following error immediately before the photo:
Posts: 3474
Okay. Move the include() line from the top of block-random.php to the very very top of the page you're displaying the random block on. As long as the call to load init.php is the first thing on the page, you won't get this warning.
-Beckett (
)
Posts: 14
OK, I don't have any include lines at the top of my random-block. I do have
require($GALLERY_BASEDIR . "init.php");
but moving that to the page top kills the entire page.
Posts: 3474
Yep... that's the line i'm talking about.
Kills the page? How? Make sure the top of your page is:
I can't see how this will "kill" the page. Can you be more specific? A blank page entirely usually means a PHP syntax error somewhere.
-Beckett (
)
Posts: 14
Error generated:
Posts: 3474
Hrm... perhaps things are being included more than once.
Try changing "require" to "require_once" in all instances.
-Beckett (
)
Posts: 14
That got it. I had forgotten to comment out the require line in block-random, duh.
Thank you so much for taking the time tosolve my problems.
Posts: 54
I'm running PHPNuke and some of my users who use Safari on their Macs are reporting this error. Which file would I move the require to? Mainfile.php?
Thanks.
-Ben