You can change this parameter through users PHP selector :cpanel>>select php version>>switch to php options
.
Also you can enable it using console. For example for version 7.1 and user testuser:
selectorctl --replace-options=allow_url_fopen:on --version=7.1 -u testuser
then you can check:
selectorctl --print-options --version=7.1 -u testuser| head -n5
More about selectorctl command you can find here:
https://docs.cloudlinux.com/selectorctl.html