Require() & GD Library

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View

I have 2 files... one that is very simple and only contains (for right

$fontcolor = "0,0,0";

image.php is a simple image creation via GD library.  When I go to the
first page, i get the generic image cannot be displayed because of
errors.  However if I go to image.php and paste the $fontcolor =
"0,0,0"; line into the top of that file, the image displays. This says
I have some funkiness with my require().  Is this just not possible to
do?  I don't understand what the difference is between the file pasted
above, and pasting the one line on top of image.php.

And yes, i took out the <? ?> tags of image.php when i used it as the

Re: Require() & GD Library

Then put the <?php ?> tags back in the require()d script because that's
why it doesn't work. PHP scripts must always be delimited by <?php ?>
tags even when they are require()d by another PHP script.

Re: Require() & GD Library

errr yeah, yer right. I gotta start posting mid-day.  That still didn't
fix my problem tho... i'm getting the same error.

Re: Require() & GD Library

Are you able to find out whether your PHP installation is running in
safe_mode or an open_basedir restriction is in effect?

If so it can sometimes help to use a relative rather than absolute path
to the included file, like:


Or whatever the actual path is to your included file.

Re: Require() & GD Library

Jasper Bryant-Greene wrote:
Quoted text here. Click to load it

Yeah, and no to both.  Pretty sure that isn't it - I have other
require/includes on other pages that use absolute path.

Site Timeline