For Programmers: Free Programming Magazines  


Home > Archive > PHP Pear > March 2007 > Re: [PEAR] error with Captcha









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Re: [PEAR] error with Captcha
Tiron Adrian

2007-03-17, 7:04 pm

$options =3D array(=0A 'font_size' =3D> 24,=0A 'font_path' =3D> './',=
=0A 'font_file' =3D> 'COUR.TTF'=0A);=0AIt's just like in the example at =
http://pear.php.net/manual/en/packa....php=0A=0A----- Orig=
inal Message ----=0AFrom: brian <brian@zijn-digital.com>=0ATo: pear-general=
@lists.php.net=0ASent: Saturday, March 17, 2007 6:51:27 PM=0ASubject: Re: [=
PEAR] error with Captcha=0A=0ATiron Adrian wrote:=0A> Hello,=0A> =0A> I'm t=
rying the first example from the Captcha pakage(wich tries to=0A> create a =
png) and i get the following error: Error initializing=0A> Image_Text (font=
missing?!).=0A> =0A> This is form from my phpinfo(): ./configure..........=
..'=0A> '--with-freetype-dir=3D/usr'...........and this:=0A> =0A> GD Support=
enabled GD Version bundled (2.0.28 compatible) =0A> FreeType Suppo=
rt enabled FreeType Linkage with freetype =0A> FreeType Version =
2.2.1=0A> =0A> and the command locate ttf | grep -i COUR.TTF gives me: =0A=
> /usr/share/fonts/msttcorefonts/cour.ttf=0A> =0A> so perhaps i should reco=

mpile php with a different path to=0A> freetype?But i'm not sure exactly wh=
ich path.......any ideas?Thanks. =0A> Is there a freetype extention availab=
le with yum?(I'm using FC6) .=0A> =0A=0AMaybe a permissions problem? You di=
dn't say spceifically how you passed=0Athe location of the font in the opti=
ons array.=0A=0AIf you think the path is correct, try copying the font to s=
ome place=0Aunder document root and pointing to there.=0A=0Ab=0A=0A-- =0APE=
AR General Mailing List (http://pear.php.net/)=0ATo unsubscribe, visit: htt=
p://www.php.net/unsub.php=0A=0A=0A=0A=0A=0A=0A =0A_________________________=
________________________________________
___________________=0ALooking for e=
arth-friendly autos? =0ABrowse Top Cars by "Green Rating" at Yahoo! Autos' =
Green Center.=0Ahttp://autos.yahoo.com/green_center/
brian

2007-03-17, 7:04 pm

Tiron Adrian wrote:
> $options = array(
> 'font_size' => 24,
> 'font_path' => './',
> 'font_file' => 'COUR.TTF'
> );
> It's just like in the example at http://pear.php.net/manual/en/packa...ext-captcha.php
>
> ----- Original Message ----
> From: brian <brian@zijn-digital.com>
> To: pear-general@lists.php.net
> Sent: Saturday, March 17, 2007 6:51:27 PM
> Subject: Re: [PEAR] error with Captcha
>
> Tiron Adrian wrote:
>
>
>
> Maybe a permissions problem? You didn't say spceifically how you passed
> the location of the font in the options array.
>
> If you think the path is correct, try copying the font to some place
> under document root and pointing to there.
>


Please don't top-post.

The example assumes that the font is sitting in the same directory as
the script that is invoking PEAR_Captcha. Either copy COUR.TTF to the
same directory as your script or make '/usr/share/fonts/msttcorefonts/'
the font_path (not recommended, for portability reasons).

b
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com