Hosting Knowledge Base

Home » Knowledge Base » Control Panel » Website Manager » Hosting Settings » Restrictions on the PHP functions file() and fopen()

Knowledge Base

Restrictions on the PHP functions file() and fopen()

When using the PHP functions files() and fopen() you need to specify the local path to the file instead of being a link.
For example, if you use fopen("http://yoursite.com/index.htm","r");, your fopen() function might not work properly, because your account will not be able to access the file.
To resolve this problem you have two options:
1. If you use a paid hosting plan by enabling the outgoing HTTP connections for your account using the “How to establish a connection to remote scripts/servers, RSS feeds?
2. You need to replace the path to the file from http://yoursite.com/index.htm to index.htm, thus making your function look like this: fopen("index.htm","r");