Categories

Sunday, July 26, 2009

Schindler's List

今晚刚刚看完,挺不错.打算接着看Casablanca, Love Story, 嘿嘿

Successfully done installing nginx and php on windows

Environment:
  • July 26, 2009
  • Windows 7 7100 RC
  • nginx 0.8.6 for windows
  • php 5.3.0 no thread safe vc6 version
Steps:
  • unzip nginx packageto folder nginx-0.8.6
  • unzip php package to folder nginx-0.8.6\php-5.3.0-nts-vc6
  • edit file nginx-0.8.6\conf\nginx.conf, search and update following blocks:
location ~ \.php$ {
root html;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}

where html is the web root folder of nginx server locating at nginx-0.8.6\html,
and
$document_root and $fastcgi_script_name are two global variables defined in nginx-0.8.6\conf\fastcgi_params.

  • make a copy of nginx-0.8.6\php5.3.0-nts-vc6\php.ini-production and rename it to php.ini. Open it and edit the following blocks to be:
extension_dir = "ext"
  • open command promote and navigate to (yourpath)\nginx-0.8.6, run the command below:
php-5.3.0-nts-vc6\php-cgi.exe -b 127.0.0.1:9000

no echo should appear and the window stays idle.
  • open another command promote and navigate to (yourpath)\nginx-0.8.6, run the command below:
nginx.exe

again, no echo should appear and the window stays idle.
  • open a browser window and navigate to:
http://localhost:7777/(yourphpfile).php

=end of the tutorial=
================================
the following part is not for googlers, but some personal thoughts and feelings about the installation.

前段时间有听说过nginx,据说又小又强,但是一直没有时间研究一下.前天(周五)晚上刚好无事可做,于是决定在windows下试试,说不定可以取代Apache.后来果然发现有一个叫fast-cgi的东东,然后还有nginx+fast-cgi+php的组合,迁移到windows 之后再加上mysql,就成了一个WEMP,可以取代WAMP.这样一来不禁心潮澎湃,打完电话后开始研究.
一开始还是挺顺利的,但是PHP一直不行.弄到刚才才发现可能是php-cgi的路径问题,后来改变了extensions的位置,果然就可以了.
在没有连接的状态下,nginx默认开了两个process,php-cgi是一个,占用的资源加起来不到5M,感觉相当的不错.

Saturday, July 25, 2009

传世古文

本文系未经作者同意进行的恶意转载,如有疑问,请质询小强.

《小强列传》——小强,字蟑螂,穴于屋,昼寝夜行。其须晃,其肢八,其腹恶。人尝扛一水,意置于筒,忽视小强于角落,遂自慌,立于外,目视其隐。人觉其以去,遂放松,掷纸于地,微响,仰首,竞视小强回而首露于柜头,面面相觑,慌于心,少顷,复静。一人一纸一水一小强而已。

Friday, July 10, 2009

美化啊美化

我也来web 2.0一把

其实是想找个地方把写程序过程中的一些东西记下来以免以后忘掉,找来找去还是觉得blogger最好啦。虽然好,可是长得丑啊。于是找了个模板来放,它说是free的,于是就先用啦。

Wednesday, July 8, 2009

Just start working

前天接到任务开始干活,做的事情蛮简单的,但是一开始就遇到很大麻烦:一个web应用总是出错。看Sun的文档,越看越讨厌这个公司,唉。
那个应用是04年之前完成的,使用的软件包都已经相当古老,可能是这个缘故,出现的问题很是奇怪,于是决定重新找到那些作古的东东,穿越到那一年,重新配置一下。