phpcurlphp-safe-mode

PHP/cURL script requesting another PHP script and exiting before response


I'd like a browser-initiated PHP script A on Server A to send a cURL request for a PHP resource B located on Server B, but not wait for a reply (it's only supposed to start script B and die). Will script B abort if it notices that the requesting script A has exited? If so, can this be overcome simply by including

ignore_user_abort(true);

in script B, just like for browser requests? What needs to be done to ensure script B goes to completion? Assume safe mode is enabled: no forking, daemons, etc, that's why I'm taking two separate servers.


Solution

  • Yes, if ignore_user_abort() is set to true on script B, then script B will continue to run, regardless of what A did. However, it is still at the mercy of the *max_execution_time* setting