6/22/2021

phpmyadmin PHP Warning: Unsupported declare 'strict_types'

 phpmyadmin PHP Warning: Unsupported declare 'strict_types'

Unsupported declare 'strict_types' in /usr/share/php/PhpMyAdmin/MoTranslator/Loader.php on line 23



Linuxmint 20.1
php 5.6

วิธีแก้
1. Install phpmyadmin ตามปกติ
2. โหลด phpMyAdmin 4.9.7
https://www.phpmyadmin.net/downloads/
3. ลบ Folder /usr/share/phpmyadmin ออก
4. แตกไฟล์ ข้อ 2 เปลี่ยนชื่อเป็น phpmyadmin
5. ย้ายไปไว้ Folder /usr/share/

ก็จะสามารถใช้ php5.6 ร่วมกับ phpmyadmin 4.9 ได้ แต่ Version ที่สูงกว่าไม่รองรับ ต้องลง php ตัวใหม่เท่านั้น เนื่องจากโปรแกรม php เก่าไม่รองรับ คำสั่งใหม่ใน phpmyadmin


มี Error

The configuration file now needs a secret passphrase (blowfish_secret).
แก้
  1. cp /usr/share/phpmyadmin/config.sample.inc.php /usr/share/phpmyadmin/config.inc.php
  2. $cfg['blowfish_secret'] = 'qtdRoGmbc9{8IZr323xYcSN]0s)r$9b_JUnb{~Xz';


The $cfg['TempDir'] (./tmp/) is not accessible. phpMyAdmin is not able to cache templates and will be slow because of this.

แก้
  1. cd /usr/share/phpmyadmin/
  2. mkdir tmp
  3. chmod 777 tmp
  4. nano config.inc.php

เพิ่มไว้ในไฟล์ล่างสุด
  1. $cfg ['TempDir'] = 'tmp';

6/12/2021

Bug Lightsquid Stop Working in 2021

Bug Lightsquid Stop Working in 2021
ที่ไฟล์ lightparser.pl มีการ Fix ปี 2020 ไว้

  1. /usr/local/lightsquid/lightparser.pl

เปิดไฟล์
  1. nano /usr/local/lightsquid/lightparser.pl

พบ
my $filterdatestop =timelocal(59,59,23,31,12-1,2020-1900)+1000;

ทดลองเปลี่ยนเป็น 2021
my $filterdatestop =timelocal(59,59,23,31,12-1,2021-1900)+1000;

แล้ว Run
/usr/local/lightsquid/lightparser.pl

เกิดข้อมูล Reports วันปัจจุบัน

หาข้อมูลจาก Internet พบเป็น Bug ของ Program สร้าง Reports
https://finisky.github.io/2021/01/03/lightsquidhardcodeyear.en/

จึงแก้ตาม Web
my $filterdatestop =timelocal(59,59,23,31,11,2100)+1000;

ข้อมูล Reports ปี 2021 เหลือ 3 วันเนื่องจาก access.log ถูกเคลีย์