Skip to content
HoganHost blog

How to Enable allow_url_fopen through php.ini

 

This article describes how to enable and disable the allow_url_fopen directive in a custom php.ini file from your cpanel end

Using the allow_url_fopen directive

The allow_url_fopen directive is disabled by default. You should be aware of the security implications of enabling the allow_url_fopen directive. PHP scripts that can access remote files are potentially vulnerable to arbitrary code injection.

When the allow_url_fopen directive is enabled, you can write scripts that open remote files as if they are local files. For example, you can use the file_get_contents function to retrieve the contents of a web page.

To enable this functionality, use a text editor to modify the allow_url_fopen directive in the php.ini file as follows:

allow_url_fopen = on

To disable this functionality, modify the allow_url_fopen directive in the php.ini file as follows:

allow_url_fopen = off
To verify the current value of the allow_url_fopen directive and other directives, you can use the phpinfo() function.
Do need cheap and reliable offshore hosting, kindly check hoganhost.com.ng

Share this article
Written by

Join the conversation.

Your email address will not be published. Required fields are marked *

Your next chapter starts here

Put your next big idea online.

The right hosting. A name of your own. A real team in your corner.

Explore Hosting