Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8925663
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T07:45:35+00:00 2026-06-15T07:45:35+00:00

So, I try to get xml-file with curl from url. Thing is, file is

  • 0

So, I try to get xml-file with curl from url. Thing is, file is generated on demand via script, which takes up to 80-100 seconds and so my curl is falling off with timeout error.

url looks something like this:

https://domain/mancgi/report?params&out=xml

I tried to set CURLOPT_TIMEOUT and CURLOPT_CONNECTTIMEOUT, and also set_time_limit() for script itself(which works fine), but nothing’s changed – still timeout.

Curl code looks like this:

set_time_limit(1000);
$curl = curl_init($url);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, FALSE); 
curl_setopt($curl, CURLOPT_CONNECTTIMEOUT, 0); 
curl_setopt($curl, CURLOPT_TIMEOUT, 300); 
$xml = curl_exec($curl);

Anyone has any ideas?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-15T07:45:36+00:00Added an answer on June 15, 2026 at 7:45 am

    I believe you may be hitting the default_socket_timeout in the php.ini which is 60 seconds by default.

    Try changing and see if it works. If not, try this instead.

    $xml = file_get_contents($url);
    

    Doing this will use wrappers which you can read about here: http://php.net/manual/en/wrappers.php

    And you will need to also ensure that the required wrappers for use by file_get_contents are enabled in php.ini (which are usually enable so you should be ok, but just check to make sure).

    Using that may bypass the timeout you are experiencing if the timeout is enforced by CURL and remember to adjust the default_socket_timeout in php.ini FROM 60 SECONDS to something else which i believe may be your problem

    The INI Settings To Check

    http://php.net/manual/en/filesystem.configuration.php

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

am trying to get the XML file from a URL but am getting no
I try get xml file with this code: HttpWebRequest webReq = (HttpWebRequest)WebRequest.Create(url); HttpWebResponse response
in my app i am trying to get an xml file from an URL.
When I try to get an XML file (RSS feed) from a site I
I try to get rows from an XML file with grep , but I'm
I am trying to get xml file from url link . This code for
I'm trying to read xml file from vbs script. Xml is encoded in utf-8
Friends, I am able to get XML file by sing bytes, perhaps which is
I am trying to get the images in xml file from the imgur website.
I have been using curl to get an xml response from a payment gateway

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.