[GH-ISSUE #134] Unable to generate 2 factor authentication QR code #110

Closed
opened 2026-02-25 21:34:11 +03:00 by kerem · 5 comments
Owner

Originally created by @dhuyvetter on GitHub (Oct 10, 2016).
Original GitHub issue: https://github.com/cypht-org/cypht/issues/134

Originally assigned to: @jasonmunro on GitHub.

Is there a specific PHP module or something that needs to be enabled to generate QR codes when 2FA is enabled? I have edited the 2fa init and moved it to app_data/2fa.ini but when I check "2 Factor Authentication" under "Site Settings" I get an error saying "Unable to generate 2 factor authentication QR code"

Originally created by @dhuyvetter on GitHub (Oct 10, 2016). Original GitHub issue: https://github.com/cypht-org/cypht/issues/134 Originally assigned to: @jasonmunro on GitHub. Is there a specific PHP module or something that needs to be enabled to generate QR codes when 2FA is enabled? I have edited the 2fa init and moved it to app_data/2fa.ini but when I check "2 Factor Authentication" under "Site Settings" I get an error saying "Unable to generate 2 factor authentication QR code"
kerem 2026-02-25 21:34:11 +03:00
  • closed this issue
  • added the
    2fa
    label
Author
Owner

@jasonmunro commented on GitHub (Oct 10, 2016):

We use a third party library for QR code generation (http://phpqrcode.sourceforge.net/), which does require that you have the PHP GD extension installed. On my Debian PHP 7 setup I have this package installed:

$ dpkg -l | grep php | grep -i gd
ii php7.0-gd 7.0.11-1 amd64 GD module for PHP

Hopefully installing that will solve the problem.

<!-- gh-comment-id:252661188 --> @jasonmunro commented on GitHub (Oct 10, 2016): We use a third party library for QR code generation (http://phpqrcode.sourceforge.net/), which does require that you have the PHP GD extension installed. On my Debian PHP 7 setup I have this package installed: $ dpkg -l | grep php | grep -i gd ii php7.0-gd 7.0.11-1 amd64 GD module for PHP Hopefully installing that will solve the problem.
Author
Owner

@dhuyvetter commented on GitHub (Oct 11, 2016):

I'm still running PHP 5.5:

~# dpkg -l | grep php | grep -i gd
ii  php5-gd                          5.5.9+dfsg-1ubuntu4.20           amd64        GD module for php5

I installed the PHP GD library:

~# sudo apt-get install php5-gd

and restarted Apache:

~# service apache2 restart
 * Restarting web server apache2 

But still get

Unable to generate 2 factor authentication QR code

<!-- gh-comment-id:252849851 --> @dhuyvetter commented on GitHub (Oct 11, 2016): I'm still running PHP 5.5: ``` ~# dpkg -l | grep php | grep -i gd ii php5-gd 5.5.9+dfsg-1ubuntu4.20 amd64 GD module for php5 ``` I installed the PHP GD library: ``` ~# sudo apt-get install php5-gd ``` and restarted Apache: ``` ~# service apache2 restart * Restarting web server apache2 ``` But still get > Unable to generate 2 factor authentication QR code
Author
Owner

@jasonmunro commented on GitHub (Oct 11, 2016):

Bummer, I was hoping for an easy fix :) Next thing to try is to check the PHP error log while loading the settings page and running Cypht in debug mode (see section 5 here for info about debug mode: https://cypht.org/install.html) .Hopefully that will give us a clue about the issue. If not, I will whip up some patches to the code to dig in more.

<!-- gh-comment-id:252955507 --> @jasonmunro commented on GitHub (Oct 11, 2016): Bummer, I was hoping for an easy fix :) Next thing to try is to check the PHP error log while loading the settings page and running Cypht in debug mode (see section 5 here for info about debug mode: https://cypht.org/install.html) .Hopefully that will give us a clue about the issue. If not, I will whip up some patches to the code to dig in more.
Author
Owner

@dhuyvetter commented on GitHub (Oct 12, 2016):

I mananged to figure it out: it was a rights issue. Since I installed
Cypht with my root account, the app_data was only writeable by root, not
by www-data, I changed the permissions and now am getting a QR code

$/var/lib/hm3# ls -la
total 4
drwxr-xr-x 5 www-data root 51 Oct 10 09:28 .
drwxr-xr-x 35 root root 4096 Oct 7 07:45 ..
drwxr-xr-x 2 root root 40 Oct 10 11:07 app_data
drwxr-xr-x 2 www-data root 6 Oct 7 07:45 attachments
drwxr-xr-x 2 www-data root 6 Oct 7 07:45 users


Dimitri Dhuyvetter
https://dhuyvetter.eu
+27 846 054 999

Jason Munro schreef op 2016-10-11 17:40:

Bummer, I was hoping for an easy fix :) Next thing to try is to check the PHP error log while loading the settings page and running Cypht in debug mode (see section 5 here for info about debug mode: https://cypht.org/install.html) .Hopefully that will give us a clue about the issue. If not, I will whip up some patches to the code to dig in more.

You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub [1], or mute the thread [2].

[1]
https://github.com/jasonmunro/cypht/issues/134#issuecomment-252955507
[2]
https://github.com/notifications/unsubscribe-auth/AATvSKYT9lc-HEak5fwvxBUIQZKUumZjks5qy63WgaJpZM4KSeZ3

<!-- gh-comment-id:253152970 --> @dhuyvetter commented on GitHub (Oct 12, 2016): I mananged to figure it out: it was a rights issue. Since I installed Cypht with my root account, the app_data was only writeable by root, not by www-data, I changed the permissions and now am getting a QR code $/var/lib/hm3# ls -la total 4 drwxr-xr-x 5 www-data root 51 Oct 10 09:28 . drwxr-xr-x 35 root root 4096 Oct 7 07:45 .. drwxr-xr-x 2 root root 40 Oct 10 11:07 app_data drwxr-xr-x 2 www-data root 6 Oct 7 07:45 attachments drwxr-xr-x 2 www-data root 6 Oct 7 07:45 users --- Dimitri Dhuyvetter https://dhuyvetter.eu +27 846 054 999 Jason Munro schreef op 2016-10-11 17:40: > Bummer, I was hoping for an easy fix :) Next thing to try is to check the PHP error log while loading the settings page and running Cypht in debug mode (see section 5 here for info about debug mode: https://cypht.org/install.html) .Hopefully that will give us a clue about the issue. If not, I will whip up some patches to the code to dig in more. > > ## > > You are receiving this because you authored the thread. > Reply to this email directly, view it on GitHub [1], or mute the thread [2]. ## Links: [1] https://github.com/jasonmunro/cypht/issues/134#issuecomment-252955507 [2] https://github.com/notifications/unsubscribe-auth/AATvSKYT9lc-HEak5fwvxBUIQZKUumZjks5qy63WgaJpZM4KSeZ3
Author
Owner

@jasonmunro commented on GitHub (Oct 12, 2016):

Thanks for the follow up. Glad you got it sorted. Closing this issue since this is resolved. Feel free to re-open or create a new one if you find another problem!

<!-- gh-comment-id:253236757 --> @jasonmunro commented on GitHub (Oct 12, 2016): Thanks for the follow up. Glad you got it sorted. Closing this issue since this is resolved. Feel free to re-open or create a new one if you find another problem!
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/cypht#110
No description provided.