安裝 PHP 時出現error: Cannot find MySQL header files under yes的錯誤訊息

[服務架設][系統]安裝 PHP 時出現error: Cannot find MySQL header files under yes的錯誤訊息

安裝 PHP 時,剛執行 ./configure –with-apxs2=/usr/local/Apache2/bin/apxs –with-mysql
就出現以下錯誤訊息:

…..
checking for mSQL support… no
checking for MSSQL support via FreeTDS… no
checking for MySQL support… yes
checking for specified location of the MySQL UNIX socket… no
checking for MySQL UNIX socket location… /tmp/mysql.sock
configure: error: Cannot find MySQL header files under yes.
Note that the MySQL client library is not bundled anymore.

解法:

o 如果不知道 header file 在哪,用 「find / -name mysql.h」命令找出其位置;
o 如果是自己也有手動安裝 MySQL 套件的話,直接指定該位置。

在 ./configure 下參數指定 header file 的位置,如下:

./configure –with-apxs2=/usr/local/Apache2/bin/apxs –with-mysql=/usr/local/mysql –with-mysqli=/usr/local/mysql/bin/mysql_config

這篇文章的關鍵字:
PHP install (PHP安裝), MySQL header files

將MySQL升級成4.1版遇到 ‘Warning: mysql_connect() [function.mysql-connect]: Client does not support authentication protocol requested by server; consider upgrading MySQL client in …..’ 錯誤訊息要如何解?

[服務架設][系統]將MySQL升級成4.1版遇到 ‘Warning: mysql_connect() [function.mysql-connect]: Client does not support authentication protocol requested by server; consider upgrading MySQL client in …..’ 錯誤訊息要如何解?

錯誤發生的原因是 4.1 版以後的密碼採用新的密碼驗證機制,如果用 myPhpAdmin 去新增出來的使用者,會採用新的機制給予密碼,舊的 mysql client 連進來要驗證密碼時就會出現上述錯誤。

解法:

將該要給舊 mysql client 用的帳號改成舊有的密碼機制,例如用新的 mysql 做以下動作:

$ mysql -h new_server_host -u root -p
mysql> SET PASSWORD FOR ‘some_user‘@’some_host‘ = OLD_PASSWORD(‘new_password‘);
mysql> FLUSH PRIVILEGES;

紅色標示的部分依照自身情況給值。

詳情請看這裡

[LINUX]安裝 PHP 時出現undefined reference to `libiconv_open’ 之類的錯誤訊息

[服務架設][系統][LINUX]安裝 PHP 時出現undefined reference to `libiconv_open’ 之類的錯誤訊息

安裝環境: Linux Fedora Core 3 上安裝 php-5.2.0

在安裝 PHP 到系統中時要是發生「undefined reference to `libiconv_open’」之類的錯誤訊息,那表示在「./configure 」沒抓好一些環境變數值。錯誤發生點在建立「-o sapi/cli/php」時出錯,沒給到要 link 的 iconv 函式庫參數。

快速的解法是: Continue reading “[LINUX]安裝 PHP 時出現undefined reference to `libiconv_open’ 之類的錯誤訊息”

postfix 中只開 localhost 網路介面或跑 Virtual Host 時, 碰到 loops back to myself 錯誤要如何解決?

[服務架設][系統] postfix 中只開 localhost 網路介面或跑 Virtual Host 時, 碰到 loops back to myself 錯誤要如何解決?

在某些需求下,系統管理者可能只想跑起 postfix mail server (SMTP server) 去服務 localhost 網路介面來的要求,以幫本機系統上的一些服務代送信件(Relay Mail) (註一);又或著在跑 Virtual Host 時,當碰到『loops back to myself』錯誤訊息要如何解決?請看以下說明。 Continue reading “postfix 中只開 localhost 網路介面或跑 Virtual Host 時, 碰到 loops back to myself 錯誤要如何解決?”

[SEO][架站] 使用 Apache 的 ReWrite 設定讓 URL 變短(short URL)、變成靜態樣式

使用 Apache web server 的ReWrite 設定,很方便地可將原本是『postshow.php?PoId=178』樣式的動態產生頁面,變成『postshow_178.html』形式的 ‘靜態頁面’。

使用 ReWrite 的好處一方面可以讓 URL 看起來比較短,不帶參數的 ‘靜態頁面’ 形式對使用者來說比較習慣;另一方面是,一般認為有利於 SEO,搜尋引擎比較好抓。

在這僅舉個簡單例子:『postshow.php?PoId=178』樣式改成『postshow_178.html』形式的 ‘靜態頁面’。 Continue reading “[SEO][架站] 使用 Apache 的 ReWrite 設定讓 URL 變短(short URL)、變成靜態樣式”

[WEB][PHP][SEO] 轉導、轉向(Redirect)網址的方法.

[WEB][PHP][SEO] 轉導、轉向(Redirect)網址的方法

在將網站更換成新網址的情況下,可能會在舊網址上使用到一些『轉導網址』的方法,以便將原本的使用者及其流量引導到新的網址去。

以下整理、討論到幾種轉導(Redirect)網址的技術方法,並且探討該方法對 SEO 的影響: Continue reading “[WEB][PHP][SEO] 轉導、轉向(Redirect)網址的方法.”

[Joomla][教學] 如何改變Joomla前台icon (change Joomla Favicon)

o Joomla 1.5 前台 favicon.ico

如果想要改變 Joomla 1.5 前台頁面所呈現的 favicon icon, 請將你的 icon 格式的檔案取名為favicon.ico, 然後上傳並放到樣板資料夾(template folder, 或稱佈景主題資料夾, 模板資料夾)(將原本檔案覆蓋), 也就是:

…/Joomla/templates/[樣板資料夾目錄名稱]/favicon.ico,

例如: …/Joomla/templates/rhuk_milkyway/favicon.ico, 即可.

o Joomla 1.0 前台 favicon.ico

如果是 Joomla 1.0 的話, 請將 favicon icon 上傳並放到:

…/Joomla/images/favicon.ico

o Joomla 1.5 後台 favicon.ico

請將你的 icon 格式的檔案取名為favicon.ico, 然後上傳並放到 administrator 的樣板資料夾, 也就是:

…/Joomla/administrator/templates/[樣板資料夾目錄名稱]/favicon.ico,

例如: …/Joomla/administrator/templates/khepri/favicon.ico, 即可.

注意:

  1. 可以先直接存取 http://你的.網站.名稱/templates/rhuk_milkyway/favicon.ico 之類的路徑先確認檔案已經放對地方了.
  2. 將 Joomla 後台的全站設定中的快取設定關閉. (如果你有開啟的話)
  3. 記得清掉瀏覽器的 cacahe 以後, 並重新載入頁面(Ctrl+F5, reload/refresh); 再不行的話清掉瀏覽器的 cache 以後, 關閉瀏覽器並重新開啟之. 這樣你應該就可以看到你的 favoicon 已經改變了.

[Joomla] SEO設定 (Making Joomla SEO Friendly)

o Making Joomla SEO Friendly

1. 將 …/Joomla/htaccess.txt 改名成 …/Joomla/.htaccess (即, 命令: mv htaccess.txt .htaccess)

2. 編輯 .htaccess, 將其中的以下這行註解拿掉

# RewriteBase /
變成
RewriteBase /

3. 在 Joomala 的後台全站設定裡, 將
SEO設定: 友善搜尋引擎網址使用 Apache mod_rewrite 這兩項設定成 ““.

(也可以直接在 …/apache/conf/httpd.conf  中設定上述規則, 用這種設定方法的話要記得重跑 web server)