Warning: get_headers() This function may only be used against URLs in

PoseLab picture PoseLab · Apr 28, 2013 · Viewed 7.6k times · Source

I want to check if an external url exists and I've tried using different functions. Most functions use get_headers() function and this always shows me the warning "Warning: get_headers () [function.get-headers]: This function May only be used against URLs in / myhosting/..." . What could be the cause that this does not work? Localhost, Mac with MAMP

Answer

Frédéric Clausset picture Frédéric Clausset · Apr 28, 2013

Check the following setting in your php.ini file. It should be On.

allow_url_fopen = On; (the php doc : allow_url_fopen)

You can look at this question on how to edit your php.ini