Debian Linux 系統升級 PHP 需要注意的事項 - 2020

Debian Linux 由 jessie 一路升級到 buster,PHP 也由 7.1、7.2 升級到 7.3,有哪些要注意的事項呢?

  • 註:此篇還是採用 mod-php 的方式,不過 PHP 升級該注意的事項都是一樣的

閱讀全文〈Debian Linux 系統升級 PHP 需要注意的事項 - 2020〉

Apache2 LogFormat Log 加上毫秒紀錄

Apache 的 Access log 一般都是以秒為單位,開啟詳細的 Log 格式為下述:

  • LogFormat "%h %l %u %t \"%r\" %>s %O \"%{Referer}i\" \"%{User-Agent}i\"" combined

官方說明:Log Files - Apache HTTP Server Version 2.4

  • %t 的格式:[day/month/year:hour:minute:second zone], e.g: [01/Oct/2020:13:55:36 +0800]
[10/Oct/2000:13:55:36 -0700] (%t) The time that the request was received. The format is:

[day/month/year:hour:minute:second zone]
  day = 2digit
  month = 3letter
  year = 4digit
  hour = 2digit
  minute = 2digit
  second = 2digit
  zone = (`+' | `-') 4digit

想要將精確度到毫秒、微秒等級,要怎麼做呢?

  • 註:Debian、Ubuntu Linux 設定檔:/etc/apache2/apache2.conf

閱讀全文〈Apache2 LogFormat Log 加上毫秒紀錄〉

PHP PECL 升級遇到 unsupported protocol 修復

PHP PECL 升級時,遇到下述錯誤訊息:

  • $ sudo pecl upgrade

    pear.php.net is using a unsupported protocol - This should never happen.
    upgrade failed

要如何修復呢?

閱讀全文〈PHP PECL 升級遇到 unsupported protocol 修復〉

PHP PECL 升級遇到 Command.php、XML 的錯誤修正

PHP 升級 PECL 遇到下述訊息:

$ sudo pecl upgrade

Warning: Invalid argument supplied for foreach() in Command.php on line 249
PHP Warning: Invalid argument supplied for foreach() in /usr/share/php/PEAR/Command.php on line 249

Warning: Invalid argument supplied for foreach() in Command.php on line 249
PHP Warning: Invalid argument supplied for foreach() in /usr/share/php/PEAR/Command.php on line 249

Warning: Invalid argument supplied for foreach() in PEAR/Command.php on line 249
PHP Warning: Invalid argument supplied for foreach() in /usr/share/php/PEAR/Command.php on line 249

Warning: Invalid argument supplied for foreach() in PEAR/Command.php on line 249
PHP Warning: Invalid argument supplied for foreach() in /usr/share/php/PEAR/Command.php on line 249

XML Extension not found

要如何修復呢?

閱讀全文〈PHP PECL 升級遇到 Command.php、XML 的錯誤修正〉

Amazon 使用AI 追蹤撿貨員工的工作效率

亞馬遜(Amazon)在 2019年被曝光內部建構一套 AI 的系統,主要用來追蹤物流倉儲部門員工(揀貨工人)的工作效率,統計每位員工的「摸魚」時間(TOT: Time Off Task),甚至會發出警告或決定終止勞動協議(解僱)

未來一般作業員不只被機器取代,現在已經間接在被 AI 管理了...

電腦AI 管理是直接看數字說話,完全不留情面的~

閱讀全文〈Amazon 使用AI 追蹤撿貨員工的工作效率〉

全球 43億 IPv4 於 2019年11月正式耗盡

歐洲網路協辦中心 (RIPE NCC) 宣布,最後的 IPv4 位址於 2019年11月25日 11:35 (UTC+1) 分配完畢,43億 IPv4 的地址完全耗盡,再來就只能往 IPv6 走囉~

閱讀全文〈全球 43億 IPv4 於 2019年11月正式耗盡〉

PHP Cookie SameSite 的設定方式

Chrome 80 之後的版本,預設的 Cookie 設定將會無法跨站存取 Cookie 值,若想要允許 Cookie 跨網站存取的話(SameSite = None),需要使用 HTTPS 才可以。

  • 註:SameSite 用來阻止瀏覽器將 Cookies 跨網站發送 (prevents the browser from sending this cookie along with cross-site requests)

閱讀全文〈PHP Cookie SameSite 的設定方式〉