PHP脚本需要“anotherscript.php”运行太长时间?

Hi I have a php script below that runs too long due to long running requirement of require "anotherscript.php"

How do i dissociate/stop this current php file process once the remaining operation can be pass to anotherscript.php to run along with essential variables like $path, $picture or others?

However, doing this I also have another concern such that when anotherscript.php having not run finish, but since user has been notified 'uploaded_success' he would upload another picture thus, causing another issue. Is there a way to solve the above mentioned issues? Thank You

if(file_put_contents($path, base64_decode($picture)) != false){
        echo "uploaded_success";
        require "anotherscript.php";
    }
    else{
        echo "uploaded_failed";
    }