The way to enable allow_url_fopen on a phpsuexec and a non-phpsuexec server is different. To enable allow_url_fopen server wide is a security risk, however, you can turn it ON for a single domain incase it is required.

Here how it needs to be done.

On a non phpsuexec server:

Goto the /usr/local/apache/conf/ directory,

PHP Code:
# cd /usr/local/apache/conf/userdata 
create a ‘userdata’ directory if not there and then create a directory with the accounts username inside it. Finally, you have to create a file allowurl.conf in the newly created directory.

The complete path should look like:

PHP Code:
# pico /usr/local/apache/conf/userdata/<username>/allowurl.conf 
and add the following to the file
PHP Code:
    <IfModule mod_php5.c>  

    
php_admin_value allow_url_fopen On 

    php_admin_value allow_url_include On 

    
</IfModule
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:

PHP Code:
Include "/usr/local/apache/conf/userdata/<username>/allowurl.conf" 
Save the file and rebuild the apache configuration

PHP Code:
# /usr/local/cpanel/bin/apache_conf_distiller --update 
PHP Code:
# /usr/local/cpanel/bin/build_apache_conf 
PHP Code:
# /scripts/restartsrv httpd 
This will enable allow_url_fopen for that domain.

PHP Code:
On a PhpSuExec Or SuPHP server
To enable allow_url_fopen on a SuPHP/PHPSuExec enabled server, copy the server side php.ini OR create a new one under the public_html directory of the domain (OR in the directory where you want to enable allow_url_fopen) i.e.

PHP Code:
# cp /usr/local/lib/php.ini /home/<username>/public_html/ 
and edit the new php.ini to enable allow_url_fopen directive:

PHP Code:
allow_url_fopen On 
Save the file and this is it.

BTW, replace “<username>” with the actual username of the domain wherever stated above.