ikhsan3adi / absensi-sekolah-qr-code

Sistem absensi siswa dan guru berbasis QR Code menggunakan CodeIgniter 4 🔥
https://youtube.com/watch?v=E1ho6wRBIUs
GNU General Public License v3.0
236 stars 85 forks source link

500 error di console, tidak bisa generate qr code , di lokal bisa di hosting tidak bisa. #16

Closed cakudin88 closed 1 year ago

cakudin88 commented 1 year ago

500 error di console dan tidak tanpak response tidak bisa generate qr code , di lokal bisa di hosting tidak bisa.

ikhsan3adi commented 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

cakudin88 commented 1 year ago

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.

ikhsan3adi commented 1 year ago

coba enviroment ganti ke development trus lihat consolenya saat generate

ikhsan3adi commented 1 year ago

https://github.com/ikhsan3adi/absensi-sekolah-qr-code/issues/15#issuecomment-1711033465

Kasusnya sama

cakudin88 commented 1 year ago

image muncul kayak gitu kak.

ikhsan3adi commented 1 year ago

Pesan errrornya terpotong. Salin errornya coba

cakudin88 commented 1 year ago
"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": "->"
    }
]

}

cakudin88 commented 1 year ago

diatas kak ya

ikhsan3adi commented 1 year ago

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);
cakudin88 commented 1 year ago

betul mas memang saya cari2 g ada . memang solusinya menghilangkan logo sekolah mas dan akhirnya generate berjalan.

scardbypass commented 1 year ago

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

AdhaTito commented 7 months ago

saya udh coba hapus logo seperti di comment atas dan ganti tanda kutip di ' jadi ` code12 ttp error nya masih sama seperti ini image

AdhaTito commented 7 months ago

ekstension php mysql jg udh diaktifkan jg intl dan gd

ikhsan3adi commented 7 months ago

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

AdhaTito commented 7 months ago

ekstension php mysql jg udh diaktifkan jg intl dan gd

Supaya pesan error terlihat #15 (comment)

No response image

ikhsan3adi commented 7 months ago

Pake mode development

Di file .env

AdhaTito commented 7 months ago

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