joshp23 / YOURLS-IQRCodes

YOURLS QRCode plugin with exposed options and full integration
GNU General Public License v3.0
22 stars 11 forks source link

Cannot serve directory /var/www/html/ No matching DirectoryIndex (index.php,index.html) found, and server-generated directory index forbidden by Options directive #43

Closed sutidor closed 3 years ago

sutidor commented 3 years ago

YOURLS 1.7.9, docker image USRV and IQRCODES: latest

When I create a url I get infinite loop like in https://github.com/joshp23/YOURLS-IQRCodes/issues/33, regardless of which filetype I choose.

I had to create cache folder in user/plugins/usrv/cache/ and gave permissions 755, but also relaxed permission 777 did not solve the issue.

I use yourls behind nginx reverse proxy, which works fine. The error only occurs when IQRCodes is activated. It does not occur with only usrv activated.

What can I do? Thank you

joshp23 commented 3 years ago

You try to create a shortlink after enabling this plugin, and YOURLS hangs regardless of file-type for the qrcode. You apparently get the errors

Cannot serve directory /var/www/html/ 
No matching DirectoryIndex (index.php,index.html) found

and something like

and server-generated directory index forbidden by Options directive

From where exactly? These seem like general configuration errors from a web-server to me.

This issue is vague and needs more specific data. Log files and output in developers console in your web-browser can be helpful.

sutidor commented 3 years ago

The error persists (infinite loading) but I cant reproduce where I got the error from. Both the reverse proxy and the apache show successful accesses. But the QR code is not generated (folder empty)

If I do massupdate I get following error

Fatal error: Uncaught Error: Call to undefined function imagecreatetruecolor() in /var/www/html/user/plugins/iqrcodes/assets/phpqrcode.php:965 Stack trace: #0 /var/www/html/user/plugins/iqrcodes/assets/phpqrcode.php(883): QRimage::image(Array, '5', '2') #1 /var/www/html/user/plugins/iqrcodes/assets/phpqrcode.php(3142): QRimage::png(Array, '/var/www/html/u...', '5', '2', false) #2 /var/www/html/user/plugins/iqrcodes/assets/phpqrcode.php(2923): QRencode->encodePNG('https://domain.tld//...', '/var/www/html/u...', false) #3 /var/www/html/user/plugins/iqrcodes/plugin.php(668): QRcode::png('https://domain.tld//...', '/var/www/html/u...', 'H', '5', '2') #4 /var/www/html/user/plugins/iqrcodes/plugin.php(423): iqrcodes_mass_chk() #5 /var/www/html/user/plugins/iqrcodes/plugin.php(25): iqrcodes_form_1() #6 /var/www/html/includes/functions-plugins.php(643): iqrcodes_do_page() #7 /var/www/html/admin/plugins.php(8): yourls_plugin_admin_page('iqrcodes') #8 {main} thrown in /var/www/html/user/plugins/iqrcodes/assets/phpqrcode.php on line 965

maybe it is related?

joshp23 commented 3 years ago

A quick google search of the undefined function imagecreatetruecolor() from your log file data shows that it is from the php-gd library.

Resolve by installing the appropriate version of the library. This would do the trick is using php 8.0 in Ubuntu:

$ sudo apt install php8.0-gd
sutidor commented 3 years ago

Thanks a lot for pointing me in the right direction.

Full solution

(exec -it bash into the yourls container) php -v (in my case php8.0.3) sudo apt-get update && apt-get install -y libpng-dev zlib1g-dev docker-php-ext-install gd

joshp23 commented 3 years ago

glad that you have it working. In my system, I do not need libpng-dev zlib1g-dev