PHP5 and file_get_contents(url)

PHP5 and file_get_contents(url)

Posted by: GuruMeditation
Posted on: 2005-07-21 03:29:00

Hi,

I'm currently making an application that loads an XML file from a remote site and then converts that data as needed. However I get an error when loading it :

Warning: file_get_contents() [function.file-get-contents]: URL file-access is disabled in the server configuration in /xxxx/.xxxx/xxxx/index.php on line 3

Is it planned to enable URL file-access in the near future?

Re: PHP5 and file_get_contents(url)

Posted by: decswxaqz
Posted on: 2005-07-21 03:56:00

About URL file access
How to remedy it

Re: PHP5 and file_get_contents(url)

Posted by: manic
Posted on: 2005-07-21 08:42:00

If you dont want to use curl you can compile php yourself and enable it.

Re: PHP5 and file_get_contents(url)

Posted by: bfaber
Posted on: 2005-07-21 09:12:00

Or alternatively.. just post your login & password on your website and make it easy for hackers.

;)

btf

Re: PHP5 and file_get_contents(url)

Posted by: GuruMeditation
Posted on: 2005-07-21 11:05:00

Going to look into that cURL thing. I suppose I could offer that and FTPing of the XML file for those who don't have cURL on their server.

Thanks for the comments :)

Edited by GuruMeditation on 07/21/05 11:06 AM (server time).

Re: PHP5 and file_get_contents(url)

Posted by: kchrist
Posted on: 2005-07-21 11:45:00

I don't know the details of what you're doing, so this may not apply, but my preferred approach is to retreive external data (mostly RSS) perodically via a cron job. This means my pages only parse local files instead of retreiving remote ones and so my site isn't affected by outages or slowness of the remote servers.


Re: PHP5 and file_get_contents(url)

Posted by: GuruMeditation
Posted on: 2005-07-21 14:23:00

It could definitly apply :) One of the future expansions of the script will be tracking the time of last update, and if that goes over a certain amount of time then running an update.

The more I can keep in the PHP code the better.

As for what it is ... well the project is still very young :) Until it's grown up a bit and has a bit more "everyone can understand" functionality (instead of the current quick fixes so the wife can use it on her page) I'll just work on it and maybe post here when it's done :)

Tags: file accessurlxml fileserver configurationphp5loadingphpline 3index