WordPress shows error related to allow_url_fopen

I’m assuming WP is installed locally, did you make sure to edit your hosts file. Example:

127.0.0.1 dev.foobar