Welcome! Log In Create A New Profile

Advanced

More Detailed Error logging on Failure to use PHP GD Library Function

Posted by rhand 
More Detailed Error logging on Failure to use PHP GD Library Function
January 29, 2019 06:33PM
Been posting about it here https://github.com/Intervention/image/issues/926 . I am using Laradock with PHP-FPM and Nginx. Each time I use the GD library to manipulate images with Laravel and Image Intervention I get an error 500 before or on start of using a resize method.

I get no other useful errors at all besides that error 500. According to php info and some other checks the GD Library is up and running. And there do not seem to be permission issues as I can manipulate images with Imagemagick and as the first step (storing original and basic thumbnail) do work.

Here is my currently using default.conf

server {

listen 80 default_server;
listen [::]:80 default_server ipv6only=on;

# For https
listen 443 ssl default_server;
listen [::]:443 ssl default_server ipv6only=on;
ssl_certificate /etc/nginx/ssl/default.crt;
ssl_certificate_key /etc/nginx/ssl/default.key;

server_name localhost;
root /var/www/public;
index index.php index.html index.htm;

location / {
try_files $uri $uri/ /index.php$is_args$args;
}

location ~ \.php$ {
try_files $uri /index.php =404;
fastcgi_pass php-upstream;
fastcgi_index index.php;
fastcgi_buffers 16 16k;
fastcgi_buffer_size 32k;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
#fixes timeouts
fastcgi_read_timeout 600;
include fastcgi_params;
}

location ~ /\.ht {
deny all;
}

location /.well-known/acme-challenge/ {
root /var/www/letsencrypt/;
log_not_found off;
}
}

It the one included by https://laradock.io/ and works fine locally as well as on a test server.

How can I make this error 500 on posting the image become more useful so I can debug this issue? Is there a way to get a more useful error message using Nginx than error 500? Can PHP-FPM send over some more details somehow?



Edited 3 time(s). Last edit at 01/29/2019 06:39PM by rhand.
Re: More Detailed Error logging on Failure to use PHP GD Library Function
January 30, 2019 04:10AM
Well, I found out it was a lack of memory and or execution or time out time. So now laravel.ini has

date.timezone=UTC
display_errors=Off
log_errors=On

; Maximum amount of memory a script may consume (128MB)
; http://php.net/memory-limit
memory_limit = 512M
; Maximum allowed size for uploaded files.
; http://php.net/upload-max-filesize
upload_max_filesize = 40M
; Sets max size of post data allowed.
; http://php.net/post-max-size
post_max_size = 40M
max_execution_time=1200
default_socket_timeout=3600
request_terminate_timeout=1200


My question still remains though. How can I let PHP FPM let Nginx and or me know there is a lack of memory or execution time? A bare error 500 does not help out at all.



Edited 1 time(s). Last edit at 01/30/2019 04:10AM by rhand.
Re: More Detailed Error logging on Failure to use PHP GD Library Function
January 30, 2019 06:55AM
Realized GD was still not processing. Had it on imagemagick post memory update. So issue not solved and better logging still needed. Also error 500 with Imagick with larger images by the way. So the question how to let PHP FPM show better errors or get nginx to display useful data still stands.
Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 86
Record Number of Users: 6 on February 13, 2018
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready