解決 laradock pathinfo PATHINFO_BASENAME 不支持中文開頭的檔名

  • 先透過 locale -a 查詢作業系統支援那些語系編碼
  • 若未安裝額外語系編碼,則至 laradock .env 設置
    • PHP_FPM_INSTALL_ADDITIONAL_LOCALES=true
    • PHP_FPM_ADDITIONAL_LOCALES=”zh_TW.UTF-8″
  • 重新編譯 PHP-FPM:docker-compose build php-fpm
  • setlocale(LC_ALL,’zh_TW.utf8′);

暫時性排除 laravel 在 php7.2 上產生的 count() 錯誤

Disable warning in error_reporting and edit handleError function to not throw error.

vendor/laravel/framework/src/Illuminate/Foundation/Bootstrap/HandleExceptions.php:56

public function handleError($level, $message, $file = '', $line = 0, $context = [])
{
    if (error_reporting() & $level) {
        if (strpos($message, 'Parameter must be an array or an object that implements Countable') !== false)
        {
            return;
        }
        throw new ErrorException($message, 0, $level, $file, $line);
    }
}