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

  • Home
  • SEARCH
  • 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 6855565
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T01:46:28+00:00 2026-05-27T01:46:28+00:00

how to run a php when the current script finishes using curl ? cant

  • 0

how to run a php when the current script finishes using curl ?
cant use shell or set_time_limit to loop the script .

EDIT:
I want to be able to use curl to call the same script , but when i use curl_exec , i don’t want the script to wait till curl finishes , i just want it to call the page and keep moving on without waiting curl to finish .

EDIT:

using this code on the start of the script

ignore_user_abort(true);
header("Content-Length: 0");
header("Connection: close");
flush();

then using curl to make the script call it self works on windows , but on linux it doesn’t ! aka , i want curl to call a page and not wait for a response

Thanks

  • 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-05-27T01:46:29+00:00Added an answer on May 27, 2026 at 1:46 am

    Found it :

    adding this to the start of the script :

    ignore_user_abort(true);
    header("Content-Length: 256");
    header("Connection: close");
    echo(str_repeat(' ',256));
    @ob_flush();
    @flush();
    @ob_end_flush();
    

    then call this 1_script from another 2_script via curl allows the other 2_script to complete its process without waiting for 1_script to finish ! . it’s just that curl won’t read the “connection:close” header before 256 byes are recieved , so we send them via spaces 🙂

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

Sidebar

Related Questions

Can I run a PHP CGI script as a background process using exec() ?
I want to run a php script from the command line that is always
How can I get the current Windows time in a PHP script? Using time()
Using Apache 2.2 and PHP 5, what's the best way to run PHP without
I am writing a pre-commit hook. I want to run php -l against all
When you run a php script in the command line, does is execute with
How do I run a PHP web page in Eclipse? I am using PDT
I have a php script (qa.php) that my app points to on my current
Every ajax chat tutorial ends the same. You run a getChatMsg.php or some script
i need to run a really long php script (four and half, five hours).

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.