Allow allow_url_fopen on cPanel server

Sometimes, you might want to enable allow_url_fopen from your account for some purpose.

To enable the allow_url_fopen, you may need to understand if you are using a suPHP server.

With non phpsuexec or suphp server,
1. Go to /usr/local/apache/conf/ path,
cd /usr/local/apache/conf/
2. Open the file named /usr/local/apache/conf/httpd.conf and find if you got the line with “Include “/usr/local/apache/conf/…”
3. Remove the # symbol if it is there.
4. Create the file in userdata according to step 2 where the username should replace with your cPanel username.
vi /usr/local/apache/conf/userdata/<number>/<username>/allowurl.conf
5. Add the following command and save it.
<IfModule mod_php5.c>
php_admin_value allow_url_fopen On
php_admin_value allow_url_include On
</IfModule>
6. Run the following command,
/usr/local/cpanel/bin/apache_conf_distiller –update
/usr/local/cpanel/bin/build_apache_conf
service httpd restart

With suPHP server,
1. Copy the default php.ini to your user folder where username is your cPanel username.
cp /usr/local/lib/php.ini /home/<username>/public_html/
2. Change the value as,
allow_url_fopen = On

Was this answer helpful?

 Print this Article

Also Read

How to log into cPanel

Please note that you only get one login per cPanel. If you create addon, parked and subdomains,...

How can I change my control panel username?

How can I change my control panel username?     Shared Unfortunately, you may not...

CGI center

The CGI Scripts are NO LONGER available to use on your account. We apologize for the...

How to upload a file using the File Manager

You may want to upload your files directly through cPanel. You can do this through the File...

How to use GZip

We support sending gzip files, or gunziping/gzipping files on the shared server. This is not the...