Python vs. PHP

Posted on 30th March 2005 by Nio in 程序人生

PHP Everywhere 贴出一篇《Python never had a chance against PHP》的文章,这并不是在对 Python 进行挑衅,而是较为客观地对 PHPPython 进行分析,认为在 Web 应用方面,Python 比不上 PHP:

  • Python is not a template language, in the sense that you cannot mix code and html easily. PHP is a wonderfully flexible in this respect.
  • Python is a so-so string processing language. One reason being it treats strings as immutable. PHP has much better string processing facilities: embedded "$var in strings", mutable strings, auto-conversion of other data types to strings, output buffering, etc.
  • PHP's documentation is cleaner and much easier to understand than Python's. Probably because PHP is a much simpler language.
  • PHP has tighter integration of a lot of web related stuff. For example, HTTP and SERVER variables.
  • 对于各种语言,我的观点从来都是:存在即是合理的,每个语言都有其应用的空间。就对于 Python 而言,在 Web 方面不如 PHP,但其在通用编程方面功能却要比 PHP 强大得多。而现在流行 Web 编程,所以 PHP 这方面的优势也就决定了增长势头要比 Python 猛得多。

    (more…)

South Korean Gov’t. Advocates Linux

Posted on 29th March 2005 by Nio in 程序人生

via Slashdot: South Korean Gov't. Advocates Linux[i]Posted by timothy on Tuesday March 29, @05:21AM
from the alternatives-are-worse dept.[/i]

Anonymous Coward writes "Korea has now taken the plunge on the Linux operating system, and is now starting to advocate Linux for use in government and public sector applications. South Korea's Ministry of Information and Communications announced the move today, which will result in decreased Microsoft market share in the region." According to the article, Korea's Ministry of Information and Communication "will provide a total of 3 billion won (US$2.95 million) for government agencies which want to use the Linux and other open-source computer programs this year."韩国政府已经开始大力支持 Linux 及开源了,不知道中国什么时候才会有这种远见卓识……去年年末还因为北京政府采购失意事件闹得沸沸扬扬,虽然政府这方面支持力度不够,但国产软件也要争气才行呀,总之,各打五十大板!!要想发展,肯定不能让 M$ 牵着鼻子走,不管当前国产软件现状如何,政府还是需要加大支持力度的。

PHP :: 您的 *.inc 文件安全吗?

Posted on 25th March 2005 by Nio in 程序人生

通过 Google 的搜索 http://www.google.com/search?q=inurl%3Adb.inc,可以找到很多网站的 db.inc 文件,而且点击浏览这些链接,竟然都可以看到源代码,狂汗!!下边列出了一些找到的结果:[url]http://www.behavioralhearthealth.org/calendar/db.inc[/url]
[url]http://www.tecra.net/squizlib/db/db.inc[/url]
[url]http://www.pupesoft.com/2k/db.inc[/url]

通过如下几种方式中的任何一种均可避免出现这种安全漏洞:

* 最好的方法是将你所使用的库文件放到发布目录之外。
* 修改 Apache 设置,使其将 .inc 作为 PHP 代码解析:
    AddType application/x-httpd-php .php .php3 .phtml .inc
* 为 *.inc 加上扩展名 .php,如 db.inc.php,这样默认作为 PHP 解析,也不会显示出源代码。
* 修改 Apache 设置,加上如下代码:
    <Files ~ "\.inc$">
        Order allow,deny
        Deny from all
    </Files>

黄河日落

Posted on 25th March 2005 by Nio in 日常生活

崔岩老兄昨天在风凌渡拍了黄河日落,这组照片真的很不错,比我拍的强多了,贴两张比较喜欢的上来分享 :)

image

image

关注 PHP 安全

Posted on 23rd March 2005 by Nio in 程序人生

PHP 入门是较为简单的,但是想要写出安全的 PHP 程序却不是那么容易的事。PHP 的安全非常重要, 一个缺乏安全考虑的 PHP 程序随时都可能成为服务器的入侵口。PHP Security Consortium 是我经常访问的站点,它专注于 PHP 安全的讨论,里边有很多文章都写得非常好,另外,它还开通了 mailing list,从 2005.4.1 开始每个月会发布一些与 PHP 安全相关的新文章、项目更新等等消息,对 PHP 安全感兴趣的均可前往订阅。