> ## Documentation Index
> Fetch the complete documentation index at: https://kb.hosting.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Setting the allow_url_fopen PHP directive

> Learn to configure the allow_URL_fopen PHP directive on a VPS or Flex Dedicated Server with this comprehensive guide, featuring related links.

This article discusses configuring the **allow\_url\_fopen** PHP directive on a managed VPS or Dedicated Server.

<Warning>
  **Important**

  The information in this article only applies to certain types of hosting accounts. To determine whether or not the information below applies to your account, please see [this article](/docs/changing-php-settings-and-versions).
</Warning>

## Configuring the allow\_url\_fopen directive

<Warning>
  **️ Warning**

  You should be aware of the security implications of enabling and disabling the **allow\_url\_fopen** directive. PHP scripts that can access remote files are potentially vulnerable to arbitrary code injection.
</Warning>

When the **allow\_url\_fopen** directive is enabled, you can write scripts that open remote files as if they are local files. Some applications may require that the **allow\_url\_fopen** directive is enabled on your system.

However, PHP does not allow you to set the **allow\_url\_fopen** directive in an *.htaccess* file. Instead, to enable this functionality, please open a support ticket at [https://my.hosting.com](https://my.hosting.com).

## More information

* To view a complete list of PHP directives, please visit [http://www.php.net/manual/en/ini.list.php](http://www.php.net/manual/en/ini.list.php).

* For more information about the **allow\_url\_fopen** directive, please visit [http://www.php.net/manual/en/filesystem.configuration.php#ini.allow-url-fopen](http://www.php.net/manual/en/filesystem.configuration.php#ini.allow-url-fopen).

## Related articles

* [Custom .htaccess files for PHP settings](/docs/custom-htaccess-files-for-php-settings)

* [Using PHP directives in custom .htaccess files](/docs/using-php-directives-in-custom-htaccess-files)
