1. 程式人生 > >php 在linux 同時上傳多個檔案時報錯 SplFileObject::__construct(/tmp/phpvfQPvQ):

php 在linux 同時上傳多個檔案時報錯 SplFileObject::__construct(/tmp/phpvfQPvQ):

分析:這個不是上傳檔案的最大值的問題,而是由於linux系統自動清除臨時檔案的願意造成的

 

thinkphp\library\think\File.php 的建構函式加個判斷
if(file_exists($filename))
簡單解決報錯可以讓你用起來
不知道有沒有其他其他不良影響

 

public function __construct($filename, $mode = 'r')
    {    
    
        if(file_exists($filename)){


            parent::__construct($filename, $mode);
        $this->filename = $this->getRealPath();
        }
        
    }