[服務架設][系統][PHP] Fatal error: Call to undefined function exif_read_data()

[服務架設][系統][PHP] Fatal error: Call to undefined function exif_read_data()

If you got a ‘Fatal error: Call to undefined function exif_read_data(): …..’ error during executing your PHP program, you may:

case1: (Using PHP in Microsoft Windows environment)

Edit your php.ini and move the ‘extension=php_mbstring.dll’ prior to ‘extension=php_exif.dll’. Re-start your web-server (apache).

case2: (Linux)

Re-compile and re-install your PHP with configuration parameters –enable-exif and –enable-mbstring (compiling both exif and mbstring statically, don’t use mbstring compiled as a DSO module).

Reference:
[1] http://uk2.php.net/exif_read_data

PHP中如何對輸出的資源檔案使用 Last-Modified 或 ETag

說明:
網頁頁面本身和頁面中的圖片、外部 CSS 檔案、外部 JavaScript 檔案等資源檔案最好在輸出給 client 端 (一般是指瀏覽器) 時明確地在 HTTP 回應的標頭中寫明 Last-Modified 或 ETag 這類快取驗證資訊,讓 client 端可以明確地知道手邊的快取檔案是否已經過期、是否已經改變而需要重新抓取。不需要抓取者則直接使用快取資料以加速網頁的呈現速度。 Last-Modified 和 ETag 是從 HTTP 1.0 到 HTTP 1.1 後才有的新 HTTP 標頭欄位。
這一篇文章是要說明在 PHP 語言中如何對輸出的資源檔案使用 Last-Modified 或 ETag。 Continue reading “PHP中如何對輸出的資源檔案使用 Last-Modified 或 ETag”

新版 PHP 預設啟用 APC 模組後造成 class 找不到的錯誤

假設環境:
PHP 5.3.20
Apache/2.2.23 (Unix)

aaa.php 檔案裡面有 AAA class,bbb.php 檔案裡面有 BBB class,bbb.php 中 include aaa.php。BBB class 的 b_func() 函式裡面用到 AAA class (即:$oA = new AAA())。

說明:
APC (Alternative PHP Cache) 是 PHP 的一個延伸模組套件,是 PHP 的另一種快取 (cache) 機制,可以直接拿既有的 OPCODE 執行、免去每次都直譯 php 程式產生 OPCODE 來跑,進而加快 php 程式的執行速度,號稱可以提昇 20% 到 30% 的速度。
筆者將手邊的 PHP 程式轉移到新版 PHP 環境下執行時,PHP 卻拋出「class 找不到」的錯誤訊息,類似以下 log 訊息:

[Tue Jan 29 04:04:46 2013] [error] [client 123.234.171.235] PHP Fatal error: Class ‘AAA’ not found in /sites/prj1/bbb.php on line 32

Continue reading “新版 PHP 預設啟用 APC 模組後造成 class 找不到的錯誤”

評估不同語系的相近內容頁面是否使用 canonical

說明:
網站的一些(產品)列表及各別(產品)細節頁面在不同語系頁面都會產生內容相近的頁面,這可能不利於 SEO,要評估一下是否在 <head> 區段中使用 canonical 來指定哪一個是 「標準網頁」。 Continue reading “評估不同語系的相近內容頁面是否使用 canonical”

[Apache][MySQL] error_log: [crit] (70023)This function has not been implemented on this platform: DBD: driver for [DBDriver unset] not available

在 apache web server 的 …/apache/logs/error_log 檔案如果很大,並且一直重複看到以下錯誤訊息:

[crit] (70023)This function has not been implemented on this platform: DBD: driver for [DBDriver unset] not available
Continue reading “[Apache][MySQL] error_log: [crit] (70023)This function has not been implemented on this platform: DBD: driver for [DBDriver unset] not available”

[MySQL] 解決MySQL server has gone away問題

下 SQL 語法對 MySQL server 做存取時 (縱使只是使用 use database1; 這樣的指令, 不一定要用到 SELECT 指令) 可能會遇到以下這個錯誤訊提示:

MySQL server has gone away

可以從以下幾個方向去看看是哪一類問題: Continue reading “[MySQL] 解決MySQL server has gone away問題”