Could you use curl instead of allow_url_fopen?
-
Can’t activate the plugin as my shared hosting provider won’t allow allow_url_fopen to be enabled.
It is not possible to use file_get_contents – or any fopen functions, with a URL due to the fact that allow_url_fopen is disabled on Shared Hosting.
I should note that it is disabled with good reason as it presents a security risk for Shared Hosting systems, and as such if you require the ability to call URLs in this manner with fopen functions you would have to host the website on a Cloud VM (and allow the option).
That being said the accepted work around in the community, and how all code should be written/structured for retrieving/calling remote data, is to use curl instead. Obviously the code would have to be adapted to work this way, and there is no reason why it cannot be adapted, and it would work in a similar way to as if you went to the URL in the browser; while I am simplifying things, the request is made via curl and it then returns the response from the target.
Have you considered this before / would that be an option?
- The topic ‘Could you use curl instead of allow_url_fopen?’ is closed to new replies.