Posts

Showing posts from 2014

php: symbol lookup error: php: undefined symbol: rl_on_new_l

由於開發上的需求需要多版本的 php 網路上有提供不少的方式 我想用看看 c9s 的 phpbrew 看看 CentOS7 指令上改了不少 這次都是用 yum 安裝套件 原本一開始執行 phpbrew 都正常 後來重開執行 phpbrew 就會出現 php: symbol lookup error: php: undefined symbol: rl_on_new_l 後來發現只要執行 php 就會出現上面的錯誤(網頁執行正常,只有 console cli 有問題) 看到 CentOS 官方論壇 也有人有類似的問題 後來在幾次的回答中終於解決了! 請先確認你的 libedit 版本是否為 el7 我系統原本是安裝 20090923-3.0_1.el5.rf 請注意後面顯示 el5 移除後在重新安裝 libedit 就可以正常 work 了 提供給各位參考看看~

Drupal7 : How to add _blank to hyper link in views ?

如果在 Drupal7 裡面想要在系統產生出來的超連結上加入 _blank 另開視窗的標籤 該怎麼做呢? 一般都會用他內建的 rewrite 功能把 但你會發現某些東西例如檔案路徑不知道怎麼生出來 可能要裝某些 Token 才有辦法知道路徑 感覺很簡單的功能確距離好遙遠阿… 不過既然 Drupal7 是 OpenSource 就自然有熱心的朋友把這功能實做出來囉! 使用的方式也很簡單 這個 case 是當你的檔案是 pdf 或 txt 時 系統會自動在 hyper link 那加上 target="_blank" 的標籤 function THEMENAME_file_link($variables) {   $file = $variables['file'];   $icon_directory = $variables['icon_directory'];   $url = file_create_url($file->uri);   $icon = theme('file_icon', array('file' => $file, 'icon_directory' => $icon_directory));   // Set options as per anchor format described at   // http://microformats.org/wiki/file-format-examples   $options = array(     'attributes' => array(       'type' => $file->filemime . '; length=' . $file->filesize,     ),   );   // Use the description as the link text if available.   if (empty($file->description)) {     $link_text = $file->filename;

Drupal 7 : How to remove viewpoint meta data ?

這問題的需求在於客戶網站不要支援 RWD (Responsive Web Resign) 由於我用 Drupal7 + Bootstrap 3.x Bootstrap 3.x 似乎內建就把這些 RWD 給設定好了 沒辦法透過後台 admin 設定 網路上看到人家說要改掉 meta tag 最多的方式都是用 html_header_alter() 但根本沒用阿… 原因在於 viewpoint 這個 meta 不是經由 html_header_alter() 產生的 後來找到用 javascript 的方式解決了 由於我是手機才需要加入這段 js 去 override 掉原本的 meta 所以我使用 mobiledetect 這個 lib 來達到我要的效果 將 viewpoint 的 content 改成 width = 1024 (px) 至於要設定多少就看你的畫面是設計給怎樣解析度看的 code 如下: function your_module_init() {   // call Mobile_Detect lib   require_once libraries_get_path('Mobile_Detect').'/Mobile_Detect.php';   $detect = new Mobile_Detect;   if ($detect->isMobile()) {     drupal_add_js("     viewport = document.querySelector(\"meta[name=viewport]\");     viewport.setAttribute('content', 'width=1024');     ", 'inline');   } } Reference Can I change the viewport meta tag in mobile safari on the fly?

'.\mysql-bin.000078' not found (Errcode: 2 - No such file or directory)

如果你的 mysql 有開啟 log-bin 那麼在 data 資料夾下就會有一堆的 mysql-bin.00001 等依序產生的檔案 這個檔案超過 1G 或是重開就會繼續產生下一個 (在 production mode 這些是很重要的) 但在測試的環境下還蠻占空間的 上次無意識的把他刪除了 今天要開啟 mysql 才發現無法啟動 會出現下面錯誤訊息: 2014-01-26 19:47:57 8844 [Note] Plugin 'FEDERATED' is disabled. 2014-01-26 19:47:57 8844 [Note] InnoDB: The InnoDB memory heap is disabled 2014-01-26 19:47:57 8844 [Note] InnoDB: Mutexes and rw_locks use Windows interlocked functions 2014-01-26 19:47:57 8844 [Note] InnoDB: Compressed tables use zlib 1.2.3 2014-01-26 19:47:57 8844 [Note] InnoDB: Not using CPU crc32 instructions 2014-01-26 19:47:57 8844 [Note] InnoDB: Initializing buffer pool, size = 128.0M 2014-01-26 19:47:57 8844 [Note] InnoDB: Completed initialization of buffer pool 2014-01-26 19:47:57 8844 [Note] InnoDB: Highest supported file format is Barracuda. 2014-01-26 19:47:57 8844 [Note] InnoDB: 128 rollback segment(s) are active. 2014-01-26 19:47:58 8844 [Note] InnoDB: Waiting for purge to start 2014-01-26 19:47:58 8844 [Note] InnoD