I'm simply attempting to execute remote PHP code locally.
To put it simply, I have an external script hosted on xxx.com/code.txt - and then want to have my internal system load that code in PHP. I tried using file_get_contents() but I don't think this is the right method of doing so.
I also tried using include(), but it seems that most PHP configurations have the http wrapper disabled. So in that case, how can I, using PHP check to see if the server has allow_url_include enabled or not because my script relies on loading the external code, or at least having a if function to check if allow_url_include is enabled or not.
include($url)is equivalent toeval(file_get_contents($url)), assuming you have at leastallow_url_fopenenabled. It's also a really bad idea, and you should restructure your code to transmit data rather than PHP code if you have even half a chance.allow_url_fopenand I don't want to do this actually. Is there anything else that can be handy for this? I mean validating the code with signatures on the client side before execution.