• Resolved sunnycoders

    (@sunnycoders)


    Error reading file: Protocol “file” not supported or disabled in libcurl

    I am trying to download the file from wordpress backend in chat gpt showing me errors

Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Author kognetiks

    (@kognetiks)

    Hello sunnycoders (@sunnycoders),

    Most modern web hosting environments come with libcurl pre-installed because it’s a common requirement for web applications to communicate with other servers or services over the Internet. However, if libcurl is not present or a specific version is required, it may need to be installed or updated by the server administrator.

    The file:// protocol can be specifically disabled in cURL using the CURLOPT_PROTOCOLS option, which allows you to specify which protocols cURL can use in your application. By setting this option, you can explicitly disable file:// while allowing other protocols like https:// or https://. Here’s how you might set this in PHP:

    curl_setopt($curl, CURLOPT_PROTOCOLS, CURLPROTO_HTTP | CURLPROTO_HTTPS);

    This line tells cURL to only allow HTTP and HTTPS protocols, effectively disabling file:// and others.

    Here’s how you might set this in PHP to allow file:// operations.

    curl_setopt($curl, CURLOPT_PROTOCOLS, CURLPROTO_FILE | CURLPROTO_HTTP | CURLPROTO_HTTPS);

    To check if file:// is specifically disabled in your cURL setup, you would look at your PHP and cURL configuration, possibly consulting your hosting provider or system administrator if you don’t have direct access to these configurations.

    I hope this helps.

    Stephen

    Thread Starter sunnycoders

    (@sunnycoders)

    I have hosting full access and I am facing the same issue. I have enabled the curl extension. but getting the same error. I have tested plugins in the 3-5 websites with different hosting providers.

    Plugin Author kognetiks

    (@kognetiks)

    Hello unnycoders (@sunnycoders),

    Have you checked the table and confirmed that there is data to export?

    Just asking, becuase if you haven’t enable conversation logging, maybe the table is empty and I need to handle an empty table.

    Just a thought. Let me know.

    Stephen

    Thread Starter sunnycoders

    (@sunnycoders)

    Yes in the table there is data available even the result file exists in the plugin folder. But not able to download the file. Getting the same error while clicking on the download button.

    Plugin Author kognetiks

    (@kognetiks)

    Hello sunnycoders (@sunnycoders)

    Were you able to confirm that CURLPROTO_FILE is enabled?

    curl_setopt($curl, CURLOPT_PROTOCOLS, CURLPROTO_FILE | CURLPROTO_HTTP | CURLPROTO_HTTPS);

    Stephen

    Thread Starter sunnycoders

    (@sunnycoders)

    Hi

    my server curl information
    cURL Version: 7.75.0
    cURL Host: x86_64-pc-linux-gnu
    cURL SSL Version: OpenSSL/1.0.2k-fips
    cURL Libz Version: 1.2.7

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘[NSFW] Error reading file: Protocol “file” not supported or disabled in libcurl’ is closed to new replies.