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 8136785
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T10:52:10+00:00 2026-06-06T10:52:10+00:00

I am working on php script that may involve a long running task. The

  • 0

I am working on php script that may involve a long running task. The process goes like this, a user (in my case case using an iOS application) submits data to my web service. Part of the process requires my php script to contact a third party to verfity some of the submitted data. The client (on the iPad) has no need to wait for the response from the third party.

Pseudocode:

Pull values from _POST[]
some simple validation
if _POST[] values are good
    return success to client
    further process submitted data with thrd party
    update database
else
    return error code and message

How would it be possible to return a simple JSON object from my server only to act as receipt, and have my php script further process the submitted data. The third party I am using has been known to be slow to respond (makes several hops, and has been known to take several minutes for a response).

  • 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-06T10:52:12+00:00Added an answer on June 6, 2026 at 10:52 am

    While you can send the output buffer early and keep processing (see Continue processing after closing connection) it’s a hacky solution and not suited to PHPs request life-cycle.

    A better method is to create a processing queue. When the client hits your service, you return the success status and insert a processing request in the queue (for example, in a database table / key-value store, etc). A separate process (e.g. cron job running a CLI script) picks up the tasks and executes them first in first out. This allows long running scripts to execute out of band – perhaps even on a different server.

    As an aside, this also allows you to free up the web server for more requests even if the client needs to check on the result of the long running process. The client can poll the server to check if the job is complete, and get the full response when it’s ready.

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

Sidebar

Related Questions

I am working on a site that require a php script running on a
I'm working on a PHP script that compiles a JavaScript framework. Right now I'm
I'm working on a PHP script that runs a Python script on the server.
I have a script that generates images from text using PHP. It's working fine
We currently have a working php mail script, this works fine and as we
I am working on a PHP script that allows users to vote on certain
Running a PHP script that is doing a huge mysql query plus some crunching
I have a tested and working php script that pulls from a db and
I need help with my php script. I am working on a script that
I have the following PHP script with the working (according to JsonViewer ) JSON

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.