Technologies Ignited

Technologies Ignited

file_get_contents returns false on a new server

leave a comment »

If you’re using

$variable = file_get_contents($page);

and you are sure, that the $page page is available and the server has connectivity you can try using:

var_dump(file_get_contents($page));

If the result is

bool(false)

The function returns the read data or FALSE on failure.

You can check your php.ini if allow_url_fopen is as follows:

allow_url_fopen = On

Written by wyand

24 April 2012 at 10:39

Posted in Other

Tagged with ,

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: