dongtai419309
2012-01-03 14:33
浏览 74
已采纳

PHP版本如何编号?

I am looking to upgrade WordPress on my server. WordPress 3.2 requires PHP 5.2.4 or greater. My server is running PHP 5.2.17. Looking at the release history on php.net, I see that:

  1. 5.2.4 was released 30 August 2007
  2. There is no listing for 5.2.17
  3. 5.2.16 was released 16 December 2010
  4. Release order with a few versions goes: 5.2.13, 5.3.2, 5.2.14, 5.3.3, 5.2.15

Two questions:

  • What is the logic of this numbering system?
  • Is PHP 5.2.17 "greater" than 5.2.4?

图片转代码服务由CSDN问答提供 功能建议

我希望在我的服务器上升级WordPress。 WordPress 3.2 需要PHP 5.2.4或更高版本。 我的服务器运行PHP 5.2.17。 看一下在php.net上发布历史,我看到了: \ n

  1. 5.2.4于2007年8月30日发布
  2. 5.2.17没有列表
  3. 5.2.16于12月16日发布 2010
  4. 发布订单有几个版本:5.2.13,5.3.2,5.2.14,5.3.3,5.2.15 \ n

    两个问题:

    • 这个编号系统的逻辑是什么?
    • PHP 5.2.17“比”更大“ 5.2.4?
  • 点赞
  • 写回答
  • 关注问题
  • 收藏
  • 邀请回答

3条回答 默认 最新

  • dongzhitao4839 2012-01-03 14:35
    已采纳

    In short,

    • 5.3.x > 5.2.y
    • 5.2.(z+1) > 5.2.(z)

    You can also expect periodical maintenance releases on both 5.2 and 5.3. This is why you can see 5.2.x releases appearing after 5.3.y releases.

    Hope that helps,

    点赞 评论
  • douxieshang5577 2012-01-03 14:36

    The last number in the version string (so 4, 16, etc) is for minor releases such as bugfixes or quick security patches. The middle number is for more significant releases containing a lot of new functionality, fixed bugs, security patches and the like. The remaining 5 is for massive releases that may have been the result of an entire rewrite (unlikely), or something of that magnitude.

    You are correct in saying PHP 5.2.17 is newer than 5.2.4; common sense dictates that 17 is greater than 4. You'll be fine if you install Wordpress on a 5.2.17 installation.

    点赞 评论
  • dongshijiao6890 2012-01-03 14:44

    The most recent versions in the 5.2 and 5.3 branches are listed on http://www.php.net/downloads.php That's where your 5.2.17 is listed. PHP uses the common "change significance" system: [major].[minor].[maintenance]. More specifically, PHP has its own version comparison function: version_compare()

    It works like this:

    The function first replaces _, - and + with a dot . in the version strings and also inserts dots . before and after any non number so that for example '4.3.2RC1' becomes '4.3.2.RC.1'. Then it splits the results like if you were using explode('.', $ver). Then it compares the parts starting from left to right. If a part contains special version strings these are handled in the following order: any string not found in this list < dev < alpha = a < beta = b < RC = rc < # < pl = p. This way not only versions with different levels like '4.1' and '4.1.2' can be compared but also any PHP specific version containing development state.

    点赞 评论

相关推荐 更多相似问题