# Warning: file_get_contents(): http:// wrapper is disabled in the server configuration by allow_url_fopen=0

**Code:** `allow_url_fopen` · **Category:** PHP · **Seen on:** PHP

The server forbids PHP from opening URLs with file functions.

## Meaning

Hosts disable `allow_url_fopen` for security. `file_get_contents('https://…')` and `fopen` on URLs then fail.

## Common causes

- `allow_url_fopen=Off` in php.ini
- Shared host policy
- `allow_url_include` confusion

## Quick fix

1. Use cURL instead of `file_get_contents` for URLs
2. Enable `allow_url_fopen` where allowed
3. Use Guzzle or Symfony HttpClient

## Detailed fix by platform

### PHP

1. `$ch = curl_init($url); curl_setopt_array($ch, [CURLOPT_RETURNTRANSFER => true, CURLOPT_TIMEOUT => 10]); $body = curl_exec($ch);`

## How to diagnose

1. **ini** — php -i | grep allow_url?
2. **Host** — Shared hosting policy?
3. **Alternative** — cURL available?

---
Source: [WhatIsMyError](https://whatismyerror.com/errors/php/php-allow-url-fopen-disabled)
