Configure PHP

Check the file has the same values for the parameters shown next, but leave the rest of the parameters with their default values.

/etc/php/8.2/fpm/pool.d/www.conf:
---------------------------------
user = www-data
group = www-data
listen = /run/php/php8.2-fpm.sock
listen.owner = www-data
listen.group = www-data
listen.mode = 0660

env[HOSTNAME] = $HOSTNAME
env[PATH] = /usr/local/bin:/usr/bin:/bin
env[TMP] = /tmp
env[TMPDIR] = /tmp
env[TEMP] = /tmp

Set memory_limit to 512 MB:

/etc/php/8.2/fpm/php.ini:
-------------------------
memory_limit = 512M
_$: systemctl restart php8.2-fpm.service

Once restarted, check the socket has been created with the proper permissions:

_$: ll /run/php
total 4
drwxr-xr-x  2 www-data www-data 100 Dec  7 00:15 ./
drwxr-xr-x 30 root     root     960 Dec  6 23:26 ../
-rw-r--r--  1 root     root       7 Dec  7 00:15 php8.2-fpm.pid
srw-rw----  1 www-data www-data   0 Dec  7 00:15 php8.2-fpm.sock=