How can restrictions on OPcache functions and API access be implemented in PHP-FPM pools to enhance security in a shared-hosting setup?

To enhance security in a shared-hosting setup, restrictions on OPcache functions and API access can be implemented in PHP-FPM pools by configuring the php.ini file to disable certain OPcache functions and setting restrictions on API access using directives like "opcache.enable" and "opcache.restrict_api".

; Disable OPcache functions
opcache.enable=0

; Restrict access to OPcache API
opcache.restrict_api="/path/to/allowed/script.php"