Folder and user rights on tmp and img folder o

We had a disk problem on our Ubuntu server on May 8. After that, we have not been able to upload pictures with our app. I am quite sure my problem is connected to user and folder rights.

This has resulted in that the images we try to upload are stuck in the tmp directory, and are not moved to the img directory and registered in the database.

I have changed the rights to 777 on the tmp and img directory and restarted the apache server, without success.

The rights, owner, group for the file and tmp directorise in the _lib directory:

drwxrwxr-x 19 www-data www-data 4096 May 8 23:33 ./
drwxrwxr-x 43 www-data www-data 4096 May 8 23:34 …/
drwxrwxr-x 4 www-data www-data 4096 May 8 23:33 file/
drwxrwxrwx 2 www-data www-data 4096 May 26 14:27 tmp/

The rights owner group for picture files uploaded to the tmp directory:

drwxrwxrwx 2 www-data www-data 4096 May 26 14:27 ./
drwxrwxr-x 19 www-data www-data 4096 May 8 23:33 …/
-rwxrwxr-x 1 www-data www-data 13 Jul 24 2020 index.html*
-rw-r–r-- 1 www-data www-data 2495702 May 26 14:21 sc_4a35df31_4fd001a41624503fb256ef6e36779893.jpg

The rights owner group for img folder:

drwxrwxr-x 4 www-data www-data 4096 May 8 23:33 ./
drwxrwxr-x 19 www-data www-data 4096 May 8 23:33 …/
drwxrwxr-x 2 www-data www-data 4096 May 8 23:33 doc/
drwxrwxrwx 2 www-data www-data 143360 May 23 20:05 img/
-rwxrwxr-x 1 www-data www-data 13 Jul 24 2020 index.html

The rights owner group for the old images in the img folder:

drwxrwxrwx 2 www-data www-data 143360 May 23 20:05 ./
drwxrwxr-x 4 www-data www-data 4096 May 8 23:33 …/
-rwxrwxr-x 1 www-data www-data 107658 Aug 8 2021 0114A49C-D10D-437F-AFE3-1DD2EAB43674.jpeg*
-rwxrwxr-x 1 www-data www-data 339269 Jan 20 2021 01346B1B-F11F-4420-9763-AD9171FFB60D.jpeg*

Would be appreciated if one of you could be so kind and guide me on the right path?

Thank you

It was a missing PHP extension and not folder permission. So after reinstalling all the PHP extension packs, it worked normally again.

sudo apt install php7.4-common php7.4-mysql php7.4-xml php7.4-xmlrpc php7.4-curl php7.4-gd php7.4-imagick php7.4-cli php7.4-dev php7.4-imap php7.4-mbstring php7.4-opcache php7.4-soap php7.4-zip php7.4-intl -y

I used this link: install php 7.4 ubuntu all extensions Code Example