No problem in the local environment, the server reported an error

as shown in the figure, there is no problem in the local environment, and the server reports an error. The local environment is version 5. 4 on the PHP 5.4.45-nts + apache, server.
I would like to ask how to solve this problem, ideas or solutions that can be solved directly.

clipboard.png

clipboard.png

Php
Jun.25,2021

well, you can see the problem by looking up the words.
you var_dump click $this- > handle to find out.


report an error $this- > handle is a boolean value. Note that there is an error in the fopen call. Check the DIR_LOGS on the server. $filename whether this file exists.


public function __destory(){
    if(False !== $this->handle){
        fclose($this->handle);
    }
}

but this is a temporary cure, not a permanent cure. If you fail to open the fopen, you have to deal with it accordingly. You can throw an exception or something.

Menu