How to run the PHP code asynchronous

前端 未结 5 1423
小蘑菇
小蘑菇 2020-11-27 06:55

How can I run PHP code asynchronously without waiting? I have a long run (almost infinite) that should run while server starts and should process asynchronously without wait

5条回答
  •  野性不改
    2020-11-27 07:47

    Definitely sounds like a job for a cron task. You can set up a php script to do your task once and have the cron run as often as you like. Here's a good writeup on how to have a php script run as a cron task; it's very easy to do.

提交回复
热议问题