Allow_url_fopen

Hello,

I am currently hosted on your platform with the account [if0_35949895l], and I am experiencing an issue related to retrieving data from external URLs using file_get_contents(). After checking the PHP configuration, it appears that the allow_url_fopen option is disabled on your server, which is preventing me from fetching data from external APIs (e.g., Discord API for authentication).

In order to proceed with developing my site, I would like to know if it would be possible to enable this option for my account or if you could provide an alternative method for making HTTP requests using file_get_contents().

Thank you in advance for your assistance and understanding.

Best regards,
zac]

The allow_url_fopen function is enabled. The problem is the Discord API, which is blocked.

Also, you should be making HTTP requests with a library like cURL, not the functions you mentioned.

7 Likes

Hey there, like @Greenreader9 mentioned, you can use cURL to make request to that api.

$url = "https://discord.com/api/endpoint"; 
$intr = curl_init($url);

curl_setopt($intr, CURLOPT_RETURNTRANSFER, true);
$response = curl_exec($intr);

No you can’t. Because:

6 Likes

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.