Month: September 2014

  • Magento not rebuilding image cache

    I changed a server for Magento sites. When I migrated the sites, they looked fine. However after I flushed Magento image cache, all sites stopped working. Web pages were not completed. The code stopped rendering after the first product image’s “src”. But there was no error message afterwards.

    At first I thought it was file permission problem. But it was not.

    Then I thought it was some rubbish left over after flushing cache. So I took the advice by removing the folder media/catalog/product/cache and clearing everything under var. But the problem was still there.

    Then I realised it was php not generating images for Magento. Magento requires php-gd to generate images. My new server did not have php-gd installed. If I was installing a Magento instance, I would not get through. But I migrated the sites. So they “looked” fine.

    After installed php-gd, product images came back.

    By the way, Magento requires some other PHP extensions to run. I took the chance to install them all.
    pdo_mysql
    simplexml
    mcrypt
    hash
    gd
    dom
    iconv
    curl
    soap

  • Ngnix 502 bad gateway error after a recent php-fpm update

    I recently updated php-fpm from 5.4.16 to 5.5.16. After the update, Nginx comes up with 502 bad gateway error. Googling the error pointed me to look into permission of php socket file.

    In php-fpm 5.4.16, if no value is given to listen.mode, php socket file is assumed to 0666.

    But in php-fpm 5.5.16, if no value is given to listen.mode, php socket file is assumed to 0660.

    That is why Nginx no longer has permission to php socket and occurs 502 error.

  • A simple multi-skills test

    Excellent Excel
    Excellent Excel
    考考各位看官的猜想、推理、数学、EXCEL能力:

    新建一份EXCEL表格(Google Spreadsheet 也行),在 A1:I9 的每个单元格内输入以下公式——

    =IF(COLUMN()>ROW(),"",VLOOKUP(COLUMN(),$L$1:$M$9,2)&VLOOKUP(ROW(),$L$1:$M$9,2)&IF(COLUMN()*ROW()<10,"得","")&IF(COLUMN()*ROW()<10,VLOOKUP(COLUMN()*ROW(),$L$1:$M$9,2),VLOOKUP(INT(COLUMN()*ROW()/10),$L$1:$M$9,2)&"十"&VLOOKUP(MOD(COLUMN()*ROW(),10),$L$1:$M$10,2,FALSE)))

    请问,应该在表格的什么地方填入什么预设值,才能让 A1:I9 的内容变得有意义?

    提示:有 20 个单元格需要预设值。

  • BT Infinity speed tests

    这两天专注于测试 BT Infinity 访问国内外的网速,有了一个总结性呈辞。

    我发现三个较好的测试网站是:

    1. http://myspeedmeter.net/:它是众多带宽测速网站中唯一能测到我的 BT Infinite 满速(下行 76Mbps,上行 19Mbps)的网站。但这个测试结果只能在连接它的伦敦服务器时能达到,连接它在世界各地其他区域的服务器时仍有较大差距,可能瓶颈在海底光缆上。

      BT Infinity speed test result on Myspeedmeter
      BT Infinity speed test result on Myspeedmeter
    2. http://openspeedtest.com/:它用的是纯 HTML5 做测试,没有用到 Flash 或 Java。在你的各种插件都已崩溃或临近崩溃的浏览器里(当然要足够新版),或在手机上不想安装 app 就直接测试,都是很好的选择。但如前所述,它无法测得我的满速,可能我的带宽比它服务器的带宽还强。

      BT Infinity speed test result on Openspeedtest
      BT Infinity speed test result on Openspeedtest
    3. http://sh.189.cn/support/netreport/:它是中国电信搞的网速测试。如果在中国,对连接国外速度没有信心,也可以先测测国内的速度吧。当然我亲测的话,也是不可能满速的。

      BT Infinity speed test result on China Telecom
      BT Infinity speed test result on China Telecom

    至于其他两个名气更响的英国宽带网速测试网站,在我这里不推荐。

    1. http://speedtest.btwholesale.com/:它是 BT 公司嫡出的测试工具,但在测试 BT Infinite 时却无法象 myspeedmeter 那样获得满速的结果。

      BT Infinity speed test result on BT Wholesale
      BT Infinity speed test result on BT Wholesale
    2. http://www.broadbandspeedchecker.co.uk/:它在 Google 搜索 broadband speed test 时排名第一,自己也号称 “THE UK’s No.1 Broadband Speed Test”,也是我在 ADSL 时代用得最多的测网速的工具,但它也是无法满速,在 VDSL 时代中没有与时俱进。

      BT Infinity speed test result on Broadbandspeedchecker
      BT Infinity speed test result on Broadbandspeedchecker