ERR_CONNECTION_RESET with PHP script

后端 未结 5 1974
悲哀的现实
悲哀的现实 2021-01-24 17:52

I have a PHP scripts that downloads and process some files. Sometimes the number of files is very large, so it takes some time.

But when there are a lot of files to proc

5条回答
  •  孤街浪徒
    2021-01-24 18:46

    I actually stumbled across this problem doing a very similair thing, my problem (in case it helps anyone) was that I was creating an Object every time I called my function, ie:

    function myFunction($param) {
        ...
        // Create an object
        $obj = new MyObject();
        ...
    }
    

    I simply changed it too:

    function myFunction($param, $obj) {
        ...
        //Do stuff with $obj
        ...
    }
    
    // Create an object
    $obj = new MyObject();
    // Call Function
    $myresult = myFunction($params, $obj);
    

    Noob I know but hope this helps someone else.

提交回复
热议问题