LibreBooking / docker

Librebooking as a docker container
GNU General Public License v3.0
11 stars 12 forks source link

PHP errors uploading images. #54

Closed LensHunnel closed 1 year ago

LensHunnel commented 1 year ago

Hello,

I'm using the following docker's image : librebooking/librebooking:2.8.6-2.1.1

When I try to upload an image file, I get the following error :

gd extension is required for image upload

How can I fix that issue ? Thanks

colisee commented 1 year ago

Hi @LensHunnel

How do you get this error? Could you also share the container log?

Cheers.

LensHunnel commented 1 year ago

I get this error when I try to upload an image on a ressource and there's nothing significant on logs but it seems like the PHP gd library is not installed.

image

root@b15e038a0a65:/var/www/html# tail -f /var/log/librebooking/log/app.log

[2023-08-20T16:57:47.154962+02:00] app.INFO: [User=] Action passed all validations [File=/var/www/html/Pages/ActionPage.php,Line=80] [] [] [2023-08-20T16:57:47.155958+02:00] app.INFO: [User=] Processing page action. Action image [File=/var/www/html/Presenters/ActionPresenter.php,Line=67] [] [] [2023-08-20T16:57:47.156012+02:00] app.INFO: [User=] Changing resource image for resource id 5 [File=/var/www/html/Presenters/Admin/ManageResourcesPresenter.php,Line=374] [] []

docker compose logs -f

librebooking | 172.18.0.3 - - [20/Aug/2023:16:56:36 +0200] "POST /Web/admin/manage_resources.php?action=image&rid=2 HTTP/1.1" 200 324 "/Web/admin/manage_resources.php" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/116.0.0.0 Safari/537.36"

colisee commented 1 year ago

OK, I believe I didn’t include the gd php extension into the docker image. I will make the change and revert to you.

—- Colisee

Le 20 août 2023 à 17:06, Lens Hunnel @.***> a écrit :



I get this error when I try to upload an image on a ressource and there's nothing significant on logs but it seems like the PHP gd library is not installed.

[image]https://user-images.githubusercontent.com/6883486/261859984-394ac2db-a152-46f6-bea3-21744fa1d62c.png

@.***:/var/www/html# tail -f /var/log/librebooking/log/app.log

[2023-08-20T16:57:47.154962+02:00] app.INFO: [User=] Action passed all validations [File=/var/www/html/Pages/ActionPage.php,Line=80] [] [] [2023-08-20T16:57:47.155958+02:00] app.INFO: [User=] Processing page action. Action image [File=/var/www/html/Presenters/ActionPresenter.php,Line=67] [] [] [2023-08-20T16:57:47.156012+02:00] app.INFO: [User=] Changing resource image for resource id 5 [File=/var/www/html/Presenters/Admin/ManageResourcesPresenter.php,Line=374] [] []

docker compose logs -f

librebooking | 172.18.0.3 - - [20/Aug/2023:16:56:36 +0200] "POST /Web/admin/manage_resources.php?action=image&rid=2 HTTP/1.1" 200 324 "/Web/admin/manage_resources.php" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/116.0.0.0 Safari/537.36"

— Reply to this email directly, view it on GitHubhttps://github.com/LibreBooking/docker/issues/54#issuecomment-1685307186, or unsubscribehttps://github.com/notifications/unsubscribe-auth/APKUZBIBHG4TJ542H5XIJ6LXWIRVRANCNFSM6AAAAAA3XGZNGY. You are receiving this because you commented.Message ID: @.***>

colisee commented 1 year ago

Hi @LensHunnel,

Could you please test the following:

  1. Start the librebooking container as you did previously
  2. From your host (ie. the hardware where docker is running), run the following commands, assuming that the librebooking container name is librebooking, to install the required gd module:
    docker exec -it librebooking bash -c 'apt update'
    docker exec -it librebooking bash -c 'apt install -y libpng-dev libjpeg-dev'
    docker exec -it librebooking bash -c 'docker-php-ext-configure gd --with-jpeg'
    docker exec -it librebooking bash -c 'docker-php-ext-install gd'
  3. Try to upload the image

If the test is successful, then I will make the change in the dockerfile.

LensHunnel commented 1 year ago

Hi @colisee ,

the test is successful. Thanks for your effort

colisee commented 1 year ago

Hi @LensHunnel ,

New docker images are available: