Closed cakudin88 closed 1 year ago
Kemungkinan karena konfigurasi di lokal dan di tempat hostingnya beda.
Coba cek versi php minimal versi 8.1+ Cek extension php Cek permission untuk menulis file di server
sudah semua kak sudah saya coba 8.1 dan 8.2 tapi masi tetap. untuk extensi sudah saya aktifkan intl dan gd permision sudah buat 777 kak. tapi belum bisa generate qr code kak.
coba enviroment ganti ke development trus lihat consolenya saat generate
muncul kayak gitu kak.
Pesan errrornya terpotong. Salin errornya coba
"title": "Exception",
"type": "Exception",
"code": 500,
"message": "Content type could not be determined for logo URL \"https://.sch.id/public/assets/img/logo_sekolah.jpg\"",
"file": "/home/smpb7497/public_html/.sch.id/vendor/endroid/qr-code/src/ImageData/LogoImageData.php",
"line": 114,
"trace": [
{
"file": "/home/smpb7497/public_html/.sch.id/vendor/endroid/qr-code/src/ImageData/LogoImageData.php",
"line": 30,
"function": "detectMimeTypeFromUrl",
"class": "Endroid\\QrCode\\ImageData\\LogoImageData",
"type": "::"
},
{
"file": "/home/smpb7497/public_html/.sch.id/vendor/endroid/qr-code/src/Writer/AbstractGdWriter.php",
"line": 125,
"function": "createForLogo",
"class": "Endroid\\QrCode\\ImageData\\LogoImageData",
"type": "::"
},
{
"file": "/home/smpb7497/public_html/.sch.id/vendor/endroid/qr-code/src/Writer/AbstractGdWriter.php",
"line": 113,
"function": "addLogo",
"class": "Endroid\\QrCode\\Writer\\AbstractGdWriter",
"type": "->"
},
{
"file": "/home/smpb7497/public_html/.sch.id/vendor/endroid/qr-code/src/Writer/PngWriter.php",
"line": 25,
"function": "write",
"class": "Endroid\\QrCode\\Writer\\AbstractGdWriter",
"type": "->"
},
{
"file": "/home/smpb7497/public_html/.sch.id/app/Controllers/Admin/QRGenerator.php",
"line": 115,
"function": "write",
"class": "Endroid\\QrCode\\Writer\\PngWriter",
"type": "->"
},
{
"file": "/home/smpb7497/public_html/.sch.id/app/Controllers/Admin/QRGenerator.php",
"line": 78,
"function": "generate",
"class": "App\\Controllers\\Admin\\QRGenerator",
"type": "->"
},
{
"file": "/home/smpb7497/public_html/.sch.id/vendor/codeigniter4/framework/system/CodeIgniter.php",
"line": 934,
"function": "generateQrSiswa",
"class": "App\\Controllers\\Admin\\QRGenerator",
"type": "->"
},
{
"file": "/home/smpb7497/public_html/.sch.id/vendor/codeigniter4/framework/system/CodeIgniter.php",
"line": 499,
"function": "runController",
"class": "CodeIgniter\\CodeIgniter",
"type": "->"
},
{
"file": "/home/smpb7497/public_html/.sch.id/vendor/codeigniter4/framework/system/CodeIgniter.php",
"line": 368,
"function": "handleRequest",
"class": "CodeIgniter\\CodeIgniter",
"type": "->"
},
{
"file": "/home/smpb7497/public_html/.sch.id/index.php",
"line": 67,
"function": "run",
"class": "CodeIgniter\\CodeIgniter",
"type": "->"
}
]
}
diatas kak ya
Kalo error itu saya kurang tau sih. Mungkin solusinya bisa dihilangkan saja logo di qr codenya
// Create logo $this->logo = Logo::create(base_url('public/assets/img/logo_sekolah.jpg'))->setResizeToWidth(75); // hapus ini // Save it to a file $this->writer ->write(qrCode: $this->qrCode, logo: $this->logo, label: $this->label) ->saveToFile(path: $this->relativePath . $this->qrCodeFilePath . $filename);
jadi:
// Save it to a file $this->writer ->write(qrCode: $this->qrCode, label: $this->label) ->saveToFile(path: $this->relativePath . $this->qrCodeFilePath . $filename);
betul mas memang saya cari2 g ada . memang solusinya menghilangkan logo sekolah mas dan akhirnya generate berjalan.
Kalo error itu saya kurang tau sih. Mungkin solusinya bisa dihilangkan saja logo di qr codenya
// Create logo $this->logo = Logo::create(base_url('public/assets/img/logo_sekolah.jpg'))->setResizeToWidth(75); // hapus ini // Save it to a file $this->writer ->write(qrCode: $this->qrCode, logo: $this->logo, label: $this->label) ->saveToFile(path: $this->relativePath . $this->qrCodeFilePath . $filename);
jadi:
// Save it to a file $this->writer ->write(qrCode: $this->qrCode, label: $this->label) ->saveToFile(path: $this->relativePath . $this->qrCodeFilePath . $filename);
Ini posisi nya di dalam folder apa ya kak
saya udh coba hapus logo seperti di comment atas dan ganti tanda kutip di ' jadi ` ttp error nya masih sama seperti ini
ekstension php mysql jg udh diaktifkan jg intl dan gd
ekstension php mysql jg udh diaktifkan jg intl dan gd
Supaya pesan error terlihat https://github.com/ikhsan3adi/absensi-sekolah-qr-code/issues/15#issuecomment-1711033465
ekstension php mysql jg udh diaktifkan jg intl dan gd
Supaya pesan error terlihat #15 (comment)
No response
Pake mode development
Di file .env
Pake mode development
Di file
.env
sudah berhasil kak :), ternyata pake localhost:8080 gk bisa ya load websitenya jdi lama dan tdi saya balikin lgi logo di barcode nya jdi bisa, klo dihapus malah error
500 error di console dan tidak tanpak response tidak bisa generate qr code , di lokal bisa di hosting tidak bisa.