Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Allowing file() for just one website on a shared server

Status
Not open for further replies.

zzapper

Programmer
Oct 30, 2008
6
GB
Hi
I need to use the file() function to read information from a remote url. file() is however not allowed on that particular server. The Hosting company is quite willing allow it for my website but doesn't want to enable it server wide. What options are available? Are there add-ons , alternatives to file(), a .htaccess trick etec etc?

Server: Apache/1.3.41 (Unix) mod_ssl/2.8.31 OpenSSL/0.9.8g PHP/4.3.1 mod_throttle/3.1.2 mod_gzip/1.3.26.1a
 
it won't be file() that is being blocked, it will be most probably either open_basedir() or allow_url_fopen();

if you post the output of phpinfo() we can better advise you. there may be workarounds you can employ.
 
i can't believe that they would say
Enabling allow_url_fopen is a terrible idea that exposes your website, and the websites of others on your shared server, to unnecessary risk.

that's naive and extremist.

the easiest thing for you to try is to upload a php.ini file to your script directory which has the following in it
Code:
allow_url_fopen = on

if that does not work (and it may not), then i'd suggest to use cUrl instead.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top