Error when searching large mailboxes

Additional info: When searching for the error with respect to roundcubemail, I found the following: default_socket_timeout needs to be increased in php.ini to reduce/eliminate the error. I’ve attempted to do this (changing the value from 60 to 180 in /etc/php/7.2/cli and fpm), with no success. I tried increasing it to 360, but the error still occurs.