Flash Sale:75% Off Hosting + Free DomainEnds in13h47m14sView Plans
Hostvento logoHostvento

Turn On allow_url_fopen in PHP

Let your PHP scripts open files from a web address by switching on one php.ini setting.

Web Hosting1 min read4 steps

What it does

The setting allow_url_fopen lets PHP functions such as file_get_contents() read a file from a URL, for example https://example.com/data.json. Some plugins and scripts need it.

Steps

  1. Open the php.ini file in the main folder of your website. If you have none, create a new text file and name it php.ini.
  2. Add this line:
allow_url_fopen = On
  1. Save the file.
  2. Reload your site. If nothing changes, wait a few minutes for the server to read the new setting.
Note: Some plans manage PHP settings in the control panel instead (for example PHP Selector or MultiPHP INI Editor in cPanel). If your change has no effect, use that tool, or ask Hostvento support.
Warning: The setting can be a security risk if your scripts open addresses that visitors type in. Turn it off again if you do not need it: allow_url_fopen = Off.

Quick recap

  • Add allow_url_fopen = On to php.ini.
  • Save, then test your script.