File_get_contents PHP function stopped to work

Hi there,
It’s my fist post here. If I do any mistakes please pardon me.

I have a PHP Laravel based application.
I had to use php function, file_get_contents within my application.
After tied with cloud flare it’s stooped to work and creates major blockage to run my regular functionality of the application.
Could you please suggest, how do I run or keep the “php function, file_get_contents” while using cloud flare as well.

1 Like

Check your Firewall Events Log in the Cloudflare Dashboard to see if it is triggering a block. file_get_contents can be risky to use and Cloudflare’s WAF might be blocking suspicious requests.

1 Like

I have moved the site form cloud flare. Once I’m confirm that I could disable this block then I will back to Cloud flare.
Could you help me to show a screenshot of this setting that

Hello masidur17,

Here is a screen cap of the “Managed Ruleset” sdayman
In the Firewall settings:
Managed Rules [tab]

Cloudflare Managed Ruleset [heading]

below this heading is a group of toggle
buttons on/off.

Some are CMS specific, others are intended to deal with bots, XSS attacks
and other pest. Meaning you might need to test a combo of rules that
helps fix your issue.

A red arrow points to PHP toggle.

1 Like

Thanks, it is really helpful.
I have free account and I’m not getting the option you have shown.


Have a look at ‘Managed Rules’

Hello. Recently I tried to move a wordpress site to cloudflare and I’m using a theme named Avada. The theme makes some requests to itself using file get contents and it seems cloudflare is blocking it.

I tried to follow the same steps as this guide, but the managed rules do not appear as this for me:

What rule should be disabled to allow file_get_contents?

1 do a request to that URL that does file_get_contents
2. look in your firewall event log to see what rules are triggering

For example (this is not the exact rule you need to disable, by the way):


or simply disable it for that URL - you’d only be hurting yourself if that URL becomes vulnerable to some exploit, which is a risk you’d have to weigh.

2 posts were merged into an existing topic: Urgent Assistance Needed: Resolving file_get_contents Issue for Chat Integrations