Enable allow_url_fopen for a single domain in a cPanel server
The method to be followed to enable allow_url_fopen on a phpsuexec and a non-phpsuexec server is different. For security reasons the option is mostly disabled server wide, however, you can enable for a single domain/account if it is required.
On a non phpsuexec server:
see if you have a “userdata” directory there? If not, create the “userdata/” directory and then the file allowurl.conf inside it. So the complete path should look like:
and add the following to the file
php_admin_value allow_url_include On
Now, edit the Apache configuration file and scroll down to the VirtualHost entry of the domain. Include the path of the above created file in it, as shown below:
Save the file and rebuild the apache configuration by
# /usr/local/cpanel/bin/build_apache_conf
# /scripts/restartsrv httpd
This will enable allow_url_fopen for that domain.
On a PHPSuExec Or SuPHP server:
On a SuPHP enabled server, turning ON allow_url_fopen in the VirtualHost entry won’t work since PHP is not working as an Apache Handler anymore.
In such a case, copy the global php.ini of the server under directory of the domain, say public_html (you need to copy php.ini to the directory, where your script with allow_url_fopen resides)
Edit the new php.ini file and enable allow_url_fopen in it
Save the file. That’s it.
please replace “” with the actual username of the domain wherever stated above.