[BlueOnyx:19873] Re: GD image problem

fastreplies fastreplies at shaw.ca
Sun Jul 24 16:10:57 -05 2016


Hello Michael,

We have added  /usr/bin/ to OpenBasedir vsites and servers but to no avail 
the problem is still there

As to referring to gd.php script code that is not working but was working 
before we have moved to new server and 5209R
-------------------------
<?php
//check to see if security code feature is on
if ($usesecuritycode == "true") {
$randcode = mt_rand(100000, 999999);
$randcodesec = base64_encode($randcode);
?>
Type the code you see on the image below
<input type="text" name="userSecurityCode" maxlength="6" size="8">
<input type="hidden" name="SecurityCode" value="<?php echo $randcodesec; ?>" 
/>
<img src="gd.php?randcode=<?php echo $randcodesec; ?>" alt="Security Code" 
/>
<?php } ?>
--------------------------

You can see form example here http://www.amray.com/form/mform.php

Cheers
Bart


----- Original Message ----- 
From: "Michael Stauber" <mstauber at blueonyx.it>
To: "BlueOnyx General Mailing List" <blueonyx at mail.blueonyx.it>
Sent: Saturday, July 23, 2016 10:55 AM
Subject: [BlueOnyx:19868] Re: GD image problem


> Hi Bart,
>
>> I have noticed that programs which are using GD wouldn't work.
>>
>> Main problem, it wouldn't display image code used in mailform
>> and programs which are relying on GD to resize image,
>> wouldn't work.
>
> Do you by chance have an actual code sample that isn't working?
>
> The thing is: PHP has a couple of different methods how to generate and
> manipulate images.
>
> Something like this will work just fine - even on 5209R:
>
> <?
> header("Content-Type: image/png");
> $im = @imagecreate(110, 20)
>    or die("Cannot Initialize new GD image stream");
> $background_color = imagecolorallocate($im, 0, 0, 0);
> $text_color = imagecolorallocate($im, 233, 14, 91);
> imagestring($im, 1, 5, 5,  "A Simple Text String", $text_color);
> imagepng($im);
> imagedestroy($im);
> ?>
>
> It works fine, because it just uses GD to do these things. There are
> other forms of creating/manipulating images via PHP, which rely on
> external programs as provided by ImageMagick to convert or modify
> images. While GD is native (i.e.: built into PHP), ImageMagick usage
> requires that PHP has access to these external binaries:
>
> /usr/bin/animate
> /usr/bin/compare
> /usr/bin/composite
> /usr/bin/conjure
> /usr/bin/convert
> /usr/bin/display
> /usr/bin/identify
> /usr/bin/import
> /usr/bin/mogrify
> /usr/bin/montage
> /usr/bin/stream
>
> As you can see, they reside in /usr/bin/ and it could be that your
> OpenBasedir restrictions for that Vsite don't allow the PHP script(s)
> access to /usr/bin/ for security reasons.
>
> So please add /usr/bin/ to your OpenBasedir allowances in the PHP
> configuration of that Vsite and see if that fixes the problem.
>
> -- 
> With best regards
>
> Michael Stauber
> _______________________________________________
> Blueonyx mailing list
> Blueonyx at mail.blueonyx.it
> http://mail.blueonyx.it/mailman/listinfo/blueonyx 





More information about the Blueonyx mailing list