php

解決Laravel連接MySQL8驗證失敗錯誤

之前一直用MariaDB沒感覺,這次因為需求變動改用最新的MySQL 8 後, Laravel 就無法連接上資料庫了,囧。 對資料庫進行任何操作都出現了 The server requested authentication method unknown to the client 錯誤: Illuminate\Database\QueryException : SQLSTATE[HY000] [2054] The server requested authentication method unknown to the client

PHP:Imagecreatefrompng合成透明背景圖片

Imagecreatefrompng的使用方法參見PHP手冊「PHP: imagecreatefrompng [https://www.php.net/manual/en/function.imagecreatefrompng.php]」,本文只作一個範例( 語句順序是有意義的,最好不要隨意調換,如順序變更產生非預期效果請多嘗試): 描述 將狐狸圖片(含透明度的png圖片)與玫瑰圖片(含透明度的png圖片)合成一張圖。 * 狐狸圖片: * 玫瑰圖片: * 最終合成圖片: 步驟 * 創建一個寬328像素、高482像素真彩色圖像並輸出圖像$tmp_img. $tmp_img_width