OJS OCS OMP OHS

You are viewing the PKP Support Forum | PKP Home Wiki



Captha not working

Are you responsible for making OJS work -- installing, upgrading, migrating or troubleshooting? Do you think you've found a bug? Post in this forum.

Moderators: jmacgreg, btbell, michael, bdgregg, barbarah, asmecher

Forum rules
What to do if you have a technical problem with OJS:

1. Search the forum. You can do this from the Advanced Search Page or from our Google Custom Search, which will search the entire PKP site. If you are encountering an error, we especially recommend searching the forum for said error.

2. Check the FAQ to see if your question or error has already been resolved.

3. Post a question, but please, only after trying the above two solutions. If it's a workflow or usability question you should probably post to the OJS Editorial Support and Discussion subforum; if you have a development question, try the OJS Development subforum.

Captha not working

Postby Tjerk » Tue Nov 27, 2012 4:49 pm

Hello,

the Captha is not working on my site.

I have turned it on in the config.ini

Code: Select all
[captcha]

; Whether or not to enable Captcha features
captcha = on

; Whether or not to use Captcha on user registration
captcha_on_register = on

; Whether or not to use Captcha on user comments
captcha_on_comments = on

; Whether or not to use Captcha on notification mailing list registration
captcha_on_mailinglist = on

; Font location for font to use in Captcha images
font_location = http://rdbg.tuxic.nl/euscreen-ojs/public/journals/1/fonts/FreeSerif.ttf


but if you look at the site http://rdbg.tuxic.nl/euscreen-ojs/index.php/view/user/register the Captcha isn't visible. Instead i get this error:

Code: Select all
ojs2 has produced an error Message: WARNING: imagefttext() [function.imagefttext]: Could not find/open font In file: /home/rdbg/euscreen/ojs/lib/pkp/classes/captcha/CaptchaManager.inc.php At line: 99 Stacktrace: File: (unknown) line (unknown) Function: PKPApplication->errorHandler(2, "imagefttext() [<a href='function.imagefttext'>function.imagefttext</a>]: Could not find/open font", "/home/rdbg/euscreen/ojs/lib/pkp/classes/captcha/CaptchaManager.inc.php", 99, Array(11)) File: /home/rdbg/euscreen/ojs/lib/pkp/classes/captcha/CaptchaManager.inc.php line 99 Function: imagefttext(Resource(), 32, 2, 91, 44, 10196632, "/public/journals/1/fonts/FreeSerif.ttf", "6") File: /home/rdbg/euscreen/ojs/pages/user/UserHandler.inc.php line 365 Function: CaptchaManager->generateImage(Object(Captcha)) File: (unknown) line (unknown) Function: UserHandler->viewCaptcha(Array(1), Object(Request)) File: /home/rdbg/euscreen/ojs/lib/pkp/classes/core/PKPRouter.inc.php line 370 Function: call_user_func(Array(2), Array(1), Object(Request)) File: /home/rdbg/euscreen/ojs/lib/pkp/classes/core/PKPPageRouter.inc.php line 266 Function: PKPRouter->_authorizeInitializeAndCallRequest(Array(2), Object(Request), Array(1), False) File: /home/rdbg/euscreen/ojs/lib/pkp/classes/core/Dispatcher.inc.php line 129 Function: PKPPageRouter->route(Object(Request)) File: /home/rdbg/euscreen/ojs/lib/pkp/classes/core/PKPApplication.inc.php line 180 Function: Dispatcher->dispatch(Object(Request)) File: /home/rdbg/euscreen/ojs/index.php line 65 Function: PKPApplication->execute() Server info: OS: Linux PHP Version: 5.3.3-7+squeeze14 Apache Version: Apache/2.2.16 (Debian) DB Driver: mysql DB server version: 5.1.63-0+squeeze1


I says that ojs can't open/find the font. But the location in the config.ini is correct and the ttf is readable.
Tjerk
 
Posts: 6
Joined: Wed Oct 24, 2012 4:03 am

Re: Captha not working

Postby asmecher » Tue Nov 27, 2012 4:53 pm

Hi Tjerk,

Try specifying a local path for the TTF, rather than an HTTP URL.

Regards,
Alec Smecher
Public Knowledge Project Team
asmecher
 
Posts: 8346
Joined: Wed Aug 10, 2005 12:56 pm

Re: Captha not working

Postby Tjerk » Tue Nov 27, 2012 5:04 pm

Thank you for your anwser.
What should be the local path?

i tried:

Code: Select all
/public/journals/1/fonts/FreeSerif.ttf


and

Code: Select all
/journals/1/fonts/FreeSerif.ttf


but that doesn't work
Tjerk
 
Posts: 6
Joined: Wed Oct 24, 2012 4:03 am

Re: Captha not working

Postby asmecher » Tue Nov 27, 2012 7:38 pm

Hi Tjerk,

Impossible for me to say -- it depends entirely on your server setup. However, those paths definitely don't look right; they should start with something like /home/ in most cases.

Regards,
Alec Smecher
Public Knowledge Project Team
asmecher
 
Posts: 8346
Joined: Wed Aug 10, 2005 12:56 pm

Re: Captha not working

Postby ramon » Wed Nov 28, 2012 5:09 am

Hello Tjerk,

You need to search your server for the font location (much like Windows or Mac OS, there's a specific font location). You may have to ask the administrator for this, as your user may not have access to the folders.
On a production server, I had to set it up at /fonts/truetype/ttf-dejavu/DejaVuSerif-Bold.ttf (Dejavu being a font available in the apt-get repository), for that's where it installed it.
This I believe is a Debian Distro, but I can't confirm.

On Ubuntu, the fonts are usually in /usr/share/fonts/truetype/


_______________________________
Ramón Martins Sodoma da Fonseca
Analista em C&T
Coordenação de Tecnologias de Informação
Instituto Brasileiro de Informação em Ciência e Tecnologia - IBICT
Ministério da Ciência e Tecnologia - MCT
ramon
 
Posts: 926
Joined: Wed Oct 15, 2003 6:15 am
Location: Brasí­lia/DF - Brasil


Return to OJS Technical Support

Who is online

Users browsing this forum: Google [Bot], Yahoo [Bot] and 3 guests