Tag Archive error

Byphunsanit

PHP: 8.3 บน Ubuntu 23.10.1 แล้ว Error

ลง PHP 8.3 ตัวใหม่น่าสุด ลงบนอูบุนตู 23.10 ตัวใหม่เหมือนกันแต่กลับเจอเอ้อเร้อ php8.3-intl : Depends: libicu70 (>= 70.1-1~) but it is not installable

  1. เข้าไปที่ terminal
  2. ไปแก้ sources.list โดยใช้คำสั่ง
    sudo nano /etc/apt/sources.list
    แล้วเพิ่มไปอีก 1 บรรทัด
    deb http://archive.ubuntu.com/ubuntu/ jammy-proposed main
    แล้ว save โดน CTRL+X และ Y
  3. update package index โดย
    sudo apt-get update
  4. ติดตั้ง libicu70 โดย
    sudo apt-get install libicu70
  5. ทดสอบลง PHP 8.3 โดยใช้ extension ตามที่ WordPress แนะนำ เช่น
    sudo apt-get install php8.3-{bcmath,cgi,cli,common,curl,fpm,gd,gettext,imagick,intl,mbstring,mysql,opcache,soap,xml,xmlrpc,xsl,zip}
  6. enable ให้ใช้บน Apache ได้โดยคำสั่ง
    sudo a2enmod php8.3

อ่านเพิ่มเติม

Byphunsanit

Flutter: One or more plugins require a higher Android SDK version error occurs when i run the project

เจอกับ error แบบนี้ One or more plugins require a higher Android SDK version. Fix this issue by adding the following to C:\Users\…\app\build.gradle: android { compileSdkVersion 33 … }

แก้โดยเปิดไฟล์ตาม path ที่เห็นแล้วก็แก้ compileSdkVersion เป็น version ที่เห็นดูก็ใช้ได้

Cr. One or more plugins require a higher Android SDK version error occurs when i run the project

Byphunsanit

Flutter: error unable to find git in your path

ถ้า run flutter doctor -v หรือ flutter pub get แล้วขึ้น error unable to find git in your path แก้ได้โดย

  1. เปิด Windows PowerShell โดยใช้สิทธิ์ administrator
  2. cd ไป folder ที่เก็บงาน เช่น C:\UsersGit\app_develop
  3. git config –global –add safe.directory “C:\UsersGit\app_develop”

จากนั้นทดสอบโดยใช้ flutter doctor -v ได้ตามปกติ

cr: How to solve “Unable to find git in your PATH” on Flutter?

Byphunsanit

Node.js: cannot be loaded because running scripts is disabled on this system

ถ้า PowerShell run TypeScript, Node.js หรือ run tsc –version แล้วมี error ประมาณ
tsc : File C:\Users\pitt\AppData\Roaming\npm\tsc.ps1 cannot be loaded because running scripts is disabled on this system. For more information,
see about_Execution_Policies at https:/go.microsoft.com/fwlink/?LinkID=135170.

แก้ได้โดยใช้ command โดยสิทธิ์ Administrator

Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope LocalMachine

โดยสามารดูคำสั่งเพิ่มเติมได้จาก about_Execution_Policies

cr: PowerShell bug “execution of scripts is disabled on this system.”

Byphunsanit

Linux: reinstall Ubuntu

อยู่ ๆ อูบุนตูมันเป็นตู่อะไรก็ไม่รู้ รวน ๆ แปลกอยากจะลงใหม่แต่ว่าไม่อยากที่จะทำอะไรมาก ขี้เกียจจะลงอะไรใหม่ ไปเจอวิธีที่ซ่อมให้กลับมาใช้ได้

  1. sudo apt-get clean
  2. สร้างไฟล์ reinstall_all.sh เช่น nano reinstall_all.sh แล้วใส่เนื้อหา
    #!/bin/bash
    for pkg in dpkg --get-selections | awk '{print $1}' | egrep -v '(dpkg|apt|mysql|mythtv)' ; do apt-get -y –force-yes install –reinstall $pkg ; done
  3. sudo chown root:root reinstall_all.sh
  4. sudo chmod 755 reinstall_all.sh
  5. sudo ./reinstall_all.sh
  6. รอตอบคำถามบางอย่าง

ดูจากเวลาแล้วใช้เวลาเยอะอยู่เหมือน แต่ก็ดีกว่ามาไล่เซ็ตหลาย ๆ อย่างใหม่ตั้งแต่ต้น ขอบคุณ
Force reinstall of all Ubuntu packages