<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>某人的栖息地 &#187; php5</title>
	<atom:link href="http://www.ooso.net/tag/php5/feed" rel="self" type="application/rss+xml" />
	<link>http://www.ooso.net</link>
	<description>Linux + Apache + Mysql + Php + Flash</description>
	<lastBuildDate>Thu, 19 Jan 2012 01:21:44 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>用php5的simplexml解析各种feed</title>
		<link>http://www.ooso.net/archives/384</link>
		<comments>http://www.ooso.net/archives/384#comments</comments>
		<pubDate>Tue, 01 Apr 2008 07:41:13 +0000</pubDate>
		<dc:creator>Volcano</dc:creator>
				<category><![CDATA[php]]></category>
		<category><![CDATA[atom]]></category>
		<category><![CDATA[php5]]></category>
		<category><![CDATA[rss]]></category>
		<category><![CDATA[simplexml]]></category>

		<guid isPermaLink="false">http://www.ooso.net/index.php/archives/384</guid>
		<description><![CDATA[最近使用simplexml来解析各种feed源，碰到了一些小问题。
用simplexml处理atom数据
很多博客使用atom来输出数据，但是atom使用了名称空间(namespace)，所以现在请求被命名的元素和本地名称时必须指定名称空间统一资源标识符（URI），还有一点就是simplexml的xpath方法无法直接query这个xml tree。
从 PHP 5.1 版开始，SimpleXML 可以直接对带名称空间的文档使用 XPath 查询。和通常一样，XPath 位置路径必须使用名称空间前缀，即使搜索的文档使用默认名称空间也仍然如此。registerXPathNamespace() 函数把前缀和后续查询中使用的名称空间 URL 联系在一起。

				<span class="readmore"><a href="http://www.ooso.net/archives/384" title="用php5的simplexml解析各种feed">阅读全文（2134字）</a></span>]]></description>
			<content:encoded><![CDATA[<p>最近使用simplexml来解析各种feed源，碰到了一些小问题。</p>
<h3>用simplexml处理atom数据</h3>
<p>很多博客使用atom来输出数据，但是<a href="/?tag=atom">atom</a>使用了名称空间(namespace)，所以现在请求被命名的元素和本地名称时必须指定名称空间统一资源标识符（URI），还有一点就是simplexml的xpath方法无法直接query这个xml tree。</p>
<blockquote><p>从 PHP 5.1 版开始，SimpleXML 可以直接对带名称空间的文档使用 XPath 查询。和通常一样，XPath 位置路径必须使用名称空间前缀，即使搜索的文档使用默认名称空间也仍然如此。registerXPathNamespace() 函数把前缀和后续查询中使用的名称空间 URL 联系在一起。</p></blockquote>
<p>下面是使用xpath查询atom文档title元素的例子：</p>
<pre><code>$atom =  simplexml_load_file('http://www.ooso.net/index.php/feed/atom');
$atom-&gt;registerXPathNamespace('atom', 'http://www.w3.org/2005/Atom');
$titles = $atom-&gt;xpath('//atom:title');
foreach ($titles as $title)
  echo "&lt;h2&gt;" . $title . "&lt;/h2&gt;";</code></pre>
<h3>用simplexml处理<a href="/?tag=rss">rss</a>数据</h3>
<p>wordpress可以输出rss2的数据源，这里面也有一些不同的namespace，比如dc。一个使用simplexml解析rss2的例子：</p>
<p><span id="more-384"></span></p>
<pre><code>$ns = array (
        'content' =&gt; 'http://purl.org/rss/1.0/modules/content/',
        'wfw' =&gt; 'http://wellformedweb.org/CommentAPI/',
        'dc' =&gt; 'http://purl.org/dc/elements/1.1/'
);

$articles = array();

// step 1: 获得feed
$blogUrl = 'http://www.ooso.net/index.php/feed/rss2';
$xml = simplexml_load_url($blogUrl);

// step 2: 获得channel metadata
$channel = array();
$channel['title']       = $xml-&gt;channel-&gt;title;
$channel['link']        = $xml-&gt;channel-&gt;link;
$channel['description'] = $xml-&gt;channel-&gt;description;
$channel['pubDate']     = $xml-&gt;pubDate;
$channel['timestamp']   = strtotime($xml-&gt;pubDate);
$channel['generator']   = $xml-&gt;generator;
$channel['language']    = $xml-&gt;language;

// step 3: 获得articles
foreach ($xml-&gt;channel-&gt;item as $item) {
        $article = array();
        $article['channel'] = $blog;
        $article['title'] = $item-&gt;title;
        $article['link'] = $item-&gt;link;
        $article['comments'] = $item-&gt;comments;
        $article['pubDate'] = $item-&gt;pubDate;
        $article['timestamp'] = strtotime($item-&gt;pubDate);
        $article['description'] = (string) trim($item-&gt;description);
        $article['isPermaLink'] = $item-&gt;guid['isPermaLink'];

        // get data held in namespaces
        $content = $item-&gt;children($ns['content']);
        $dc      = $item-&gt;children($ns['dc']);
        $wfw     = $item-&gt;children($ns['wfw']);

        $article['creator'] = (string) $dc-&gt;creator;
        foreach ($dc-&gt;subject as $subject)
                $article['subject'][] = (string)$subject;

        $article['content'] = (string)trim($content-&gt;encoded);
        $article['commentRss'] = $wfw-&gt;commentRss;

        // add this article to the list
        $articles[$article['timestamp']] = $article;
}</code></pre>
<p>这个例子中，使用children方法来获得名称空间中的数据：</p>
<pre><code>$dc      = $item-&gt;children($ns['dc']);</code></pre>
<h3>参考文档</h3>
<ul>
<li><a href="http://www.ibm.com/developerworks/cn/xml/x-simplexml.html">PHP 中的 SimpleXML 处理</a></li>
<li><a href="http://blog.stuartherbert.com/php/2007/01/07/using-simplexml-to-parse-rss-feeds/">Using SimpleXML To Parse RSS Feeds</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.ooso.net/archives/384/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>php5中的date函数</title>
		<link>http://www.ooso.net/archives/376</link>
		<comments>http://www.ooso.net/archives/376#comments</comments>
		<pubDate>Mon, 22 Oct 2007 13:10:46 +0000</pubDate>
		<dc:creator>Volcano</dc:creator>
				<category><![CDATA[php]]></category>
		<category><![CDATA[php5]]></category>

		<guid isPermaLink="false">http://www.ooso.net/index.php/archives/376</guid>
		<description><![CDATA[php5.1.1以后，date函数新增了以下常量。
自 PHP 5.1.1 起定义有以下常量来提供标准日期表达方法，可以用于日期格式函数（例如 date()）。 
DATE_ATOM（string）
原子钟格式（如：2005-08-15T15:52:01+00:00） 

				<span class="readmore"><a href="http://www.ooso.net/archives/376" title="php5中的date函数">阅读全文（687字）</a></span>]]></description>
			<content:encoded><![CDATA[<p>php5.1.1以后，date函数新增了以下常量。</p>
<blockquote><p>自 PHP 5.1.1 起定义有以下常量来提供标准日期表达方法，可以用于日期格式函数（例如 date()）。 </p>
<p>DATE_ATOM（string）<br />
原子钟格式（如：2005-08-15T15:52:01+00:00） </p>
<p>DATE_COOKIE（string）<br />
HTTP Cookies 格式（如：Mon, 15 Aug 2005 15:52:01 UTC） </p>
<p>DATE_ISO8601（string）<br />
ISO-8601（如：2005-08-15T15:52:01+0000） </p>
<p>DATE_RFC822（string）<br />
RFC 822（如：Mon, 15 Aug 2005 15:52:01 UTC） </p>
<p>DATE_RFC850（string）<br />
RFC 850（如：Monday, 15-Aug-05 15:52:01 UTC） </p>
<p>DATE_RFC1036（string）<br />
RFC 1036（如：Monday, 15-Aug-05 15:52:01 UTC） </p>
<p>DATE_RFC1123（string）<br />
RFC 1123（如：Mon, 15 Aug 2005 15:52:01 UTC） </p>
<p>DATE_RFC2822（string）<br />
RFC 2822（如：Mon, 15 Aug 2005 15:52:01 +0000） </p>
<p>DATE_RSS（string）<br />
RSS（如：Mon, 15 Aug 2005 15:52:01 UTC） </p>
<p>DATE_W3C（string）<br />
World Wide Web Consortium（如：2005-08-15T15:52:01+00:00）</p></blockquote>
<p>比如，要输出一个RSS需要的日期格式，就可以用下面的代码简单实现：</p>
<pre><code>echo date(DATE_RSS);</code></pre>
]]></content:encoded>
			<wfw:commentRss>http://www.ooso.net/archives/376/feed</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
		<item>
		<title>[php5]将xml转换成json最简单的办法</title>
		<link>http://www.ooso.net/archives/361</link>
		<comments>http://www.ooso.net/archives/361#comments</comments>
		<pubDate>Tue, 24 Jul 2007 00:18:58 +0000</pubDate>
		<dc:creator>Volcano</dc:creator>
				<category><![CDATA[php]]></category>
		<category><![CDATA[json]]></category>
		<category><![CDATA[php5]]></category>
		<category><![CDATA[simplexml]]></category>
		<category><![CDATA[xml]]></category>

		<guid isPermaLink="false">http://www.ooso.net/index.php/archives/361</guid>
		<description><![CDATA[在php5下，将xml转换成json最简单的办法，就是利用simplexml和json扩展。
废话不多说，贴代码:
&#60;?php
$xml = &#60;&#60;&#60;EOF

				<span class="readmore"><a href="http://www.ooso.net/archives/361" title="[php5]将xml转换成json最简单的办法">阅读全文（114字）</a></span>]]></description>
			<content:encoded><![CDATA[<p>在php5下，将xml转换成json最简单的办法，就是利用simplexml和<a href="/index.php?tag=json">json</a>扩展。</p>
<p>废话不多说，贴代码:</p>
<pre><code>&lt;?php
$xml = &lt;&lt;&lt;EOF
&lt;?xml version="1.0" encoding="UTF-8"?&gt;
&lt;books&gt;
    &lt;book id="1"&gt;
        &lt;title&gt;Code Generation in Action&lt;/title&gt;
        &lt;author&gt;&lt;first&gt;Jack&lt;/first&gt;&lt;last&gt;Herrington&lt;/last&gt;&lt;/author&gt;
        &lt;publisher&gt;Manning&lt;/publisher&gt;
    &lt;/book&gt;

    &lt;book id="2"&gt;
        &lt;title&gt;PHP Hacks&lt;/title&gt;
        &lt;author&gt;&lt;first&gt;Jack&lt;/first&gt;&lt;last&gt;Herrington&lt;/last&gt;&lt;/author&gt;
        &lt;publisher&gt;O'Reilly&lt;/publisher&gt;
    &lt;/book&gt;

    &lt;book id="3"&gt;
        &lt;title&gt;Podcasting Hacks&lt;/title&gt;
        &lt;author&gt;&lt;first&gt;Jack&lt;/first&gt;&lt;last&gt;Herrington&lt;/last&gt;&lt;/author&gt;
        &lt;publisher&gt;O'Reilly&lt;/publisher&gt;
    &lt;/book&gt;
&lt;/books&gt;
EOF;

echo $json = json_encode(simplexml_load_string($xml));
?&gt;</code></pre>
<p>整个过程就是一行，灰墙之ez.</p>
<p>另：可以跟以前写的“<a href="http://www.ooso.net/index.php/archives/184">用php将rss转化为json格式</a>”比较一下.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.ooso.net/archives/361/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>PHP4的历史任务完成</title>
		<link>http://www.ooso.net/archives/321</link>
		<comments>http://www.ooso.net/archives/321#comments</comments>
		<pubDate>Sat, 14 Jul 2007 01:01:55 +0000</pubDate>
		<dc:creator>Volcano</dc:creator>
				<category><![CDATA[php]]></category>
		<category><![CDATA[php5]]></category>

		<guid isPermaLink="false">http://www.ooso.net/index.php/archives/321</guid>
		<description><![CDATA[PHP.net宣布，他们将在今年年底停止php4的开发，安全方面的更新也会于2008年8月结束。
PHP4发布于2000年五月，这一年我刚刚学会拨号上网，申请email帐号收发邮件。在2004年，php家族的老五出世， 而这个时候，支持php4的主机以及开源软件已经四处开花。3年后，php4仍然在各大主机上占据绝对份额的优势，尤其是在国内。因为大量的开源代码仍然是php 4 only的，你不知道客户会在hosting上跑什么样的程序。还有一大批的php程序员在维护前人留下的php 4代码，或者在这个基础上接着开发，比如俺&#8230; 这对主机商或开发人员来说都不是一件好事情，客户不在乎你用的是php 4还是php 5，这无关紧要，只要代码能跑，功能实现就皆大欢喜了。

				<span class="readmore"><a href="http://www.ooso.net/archives/321" title="PHP4的历史任务完成">阅读全文（480字）</a></span>]]></description>
			<content:encoded><![CDATA[<p>PHP.net宣布，他们将在今年年底停止php4的开发，安全方面的更新也会于2008年8月结束。</p>
<p>PHP4发布于2000年五月，这一年我刚刚学会拨号上网，申请email帐号收发邮件。在2004年，<a href="index.php?tag=php">php</a>家族的老五出世， 而这个时候，支持php4的主机以及开源软件已经四处开花。3年后，php4仍然在各大主机上占据绝对份额的优势，尤其是在国内。因为大量的开源代码仍然是php 4 only的，你不知道客户会在hosting上跑什么样的程序。还有一大批的php程序员在维护前人留下的php 4代码，或者在这个基础上接着开发，比如俺&#8230; 这对主机商或开发人员来说都不是一件好事情，客户不在乎你用的是php 4还是php 5，这无关紧要，只要代码能跑，功能实现就皆大欢喜了。</p>
<p>前不久的<a href="http://www.ooso.net/index.php/archives/348">GoPHP5</a>活动，是php开源世界开发人员对现状的一种回应，也是在php核心开发人员推动下的结果。只有得到目前广泛的php开发人员的支持，PHP.net才有底气说2007年底停止php4的开发。</p>
<p>php4能够在如此之久的时间里长盛不衰，证明php 4是成功的。它的历史任务，完成了！</p>
<p><a href="http://www.ooso.net/du/index.php?tag=php5">php5的一些参考资料</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.ooso.net/archives/321/feed</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Go PHP5!</title>
		<link>http://www.ooso.net/archives/348</link>
		<comments>http://www.ooso.net/archives/348#comments</comments>
		<pubDate>Wed, 11 Jul 2007 10:34:50 +0000</pubDate>
		<dc:creator>Volcano</dc:creator>
				<category><![CDATA[php]]></category>
		<category><![CDATA[php5]]></category>

		<guid isPermaLink="false">http://www.ooso.net/index.php/archives/348</guid>
		<description><![CDATA[PHP5是在3年前发布的，在这期间，PHP4仍然在为我们提供服务，大量主机hosting上还是永远的php4，关于使用率可以参考php在2007五月的使用统计。之所以造成这种情况，有着多方面的原因。
首先PHP开发者还没摸透在没有php4的情况下，用php5来跑从前的应用会不会有潜在的问题。大量主机上仍然安装的是php4，这会使用户避免选择php5 only的web应用程序。也是因为这个原因，大量主机商还不能马上升级到php5，因为他们不知道用户将要跑php4或是php5的web应用。这样一来，php的开发者越发不能摆脱php4，他们为了适应环境，写出来的代码可能都是php4/php5兼容的。

				<span class="readmore"><a href="http://www.ooso.net/archives/348" title="Go PHP5!">阅读全文（2746字）</a></span>]]></description>
			<content:encoded><![CDATA[<p>PHP5是在3年前发布的，在这期间，PHP4仍然在为我们提供服务，大量主机hosting上还是永远的php4，关于使用率可以参考<a href="http://www.ooso.net/index.php/archives/308">php在2007五月的使用统计</a>。之所以造成这种情况，有着多方面的原因。</p>
<p>首先PHP开发者还没摸透在没有php4的情况下，用php5来跑从前的应用会不会有潜在的问题。大量主机上仍然安装的是php4，这会使用户避免选择php5 only的web应用程序。也是因为这个原因，大量主机商还不能马上升级到php5，因为他们不知道用户将要跑php4或是php5的web应用。这样一来，php的开发者越发不能摆脱php4，他们为了适应环境，写出来的代码可能都是php4/php5兼容的。</p>
<p>这对php开发者来说，是如同梦魇一般的一个死循环。一些open source的php开发团体为了摆脱这个困境，终于决定做出一些动作来打破僵局了！！他们在2008年2月份以后发布程序将仅仅官方的支持php 5.2.0以后的版本(官方的支持意味着某些程序还是能保持php4的兼容性的，但是不承诺)！！这个活动被称之为GoPHP5！！这些php开发团体已知的名单如下：</p>
<blockquote><p>Drupal<br />
Joomla<br />
CakePHP<br />
Symfony(这个已经是php5 only了)<br />
Gallery<br />
WordPress</p></blockquote>
<p>对于用户来说，使用php4或者php5无关紧要，他需要的仅仅是他的程序可以run。那么列表中拥有大量用户基础的php程序的转向，将会是驱动主机商升级到php5的极大动力。    </p>
<p><span id="more-348"></span><br />
下面是一些原文：</p>
<blockquote><p>PHP 4 has served the web developer community for seven years now, and served<br />
    it well. However, it also shows its age. Most of PHP 4&#8242;s shortcomings have<br />
    been addressed by PHP 5, released three years ago, but the transition from<br />
    PHP 4 to PHP 5 has been slow for a number of reasons.</p>
<p>    PHP developers cannot leverage PHP 5&#8242;s full potential without dropping support<br />
    for PHP 4, but PHP 4 is still installed on a majority of shared web hosts and<br />
    users would then be forced to switch to a different application. Web hosts<br />
    cannot upgrade their servers to PHP 5 without making it impossible for their<br />
    users to run PHP 4-targeted web apps, and have no incentive to go to the<br />
    effort of testing and deploying PHP 5 while most web apps are still<br />
    compatible with PHP 4 and the PHP development team still provides maintenance<br />
    support for PHP 4. The PHP development team, of course, can&#8217;t drop<br />
    maintenance support for PHP 4 while most web hosts still run PHP 4.</p>
<p>    It is a dangerous cycle, and one that needs to be broken. The open source PHP<br />
    developer community has decided that it is indeed now time to move forward,<br />
    together. Therefore, the listed open source PHP projects have all agreed<br />
    that effective 5 February 2008, any new feature release will have a minimum<br />
    required PHP version no older than PHP 5.2.0. It is our believe that this<br />
    will allow web hosts a reason to upgrade and the PHP development team the<br />
    ability to retire PHP 4 and focus efforts on PHP 5 and the forthcoming PHP 6,<br />
    all without penalizing any existing project for being &#8220;first out of the<br />
    gate&#8221;.</p></blockquote>
<blockquote><p> Brion:<br />
    Some of my friends in the open-source CMS community have created a<br />
    movement called &#8220;GoPHP5&#8243; which will eventually reside at GoPHP5.org.<br />
    We&#8217;re trying to encourage projects to &#8212; as of February 2008 &#8212; drop<br />
    support for versions of PHP prior to 5.2. This would not mean older<br />
    versions that support PHP 4 would be abandoned, just that new releases<br />
    would only officially support PHP >= 5.2.</p>
<p>    This is an effort to have web hosts support modern PHP versions. Right<br />
    now, there is little incentive for web hosts to upgrade because so many<br />
    web applications support PHP 4 and old versions of PHP 5.</p>
<p>    We&#8217;d like to get MediaWiki on-board. Because the current version of<br />
    MediaWiki already requires PHP 5 and runs on PHP 5.2 without problems,<br />
    this would not be as jarring to MediaWiki as it would be to projects<br />
    that still release new PHP 4-compatible versions. Currently, we&#8217;re in<br />
    talks with Drupal, Joomla, CakePHP, Symfony (already in), Symfony&#8217;s<br />
    partner projects, Gallery, and WordPress.</p>
<p>    Thanks,<br />
    David </p></blockquote>
<p>以及邮件组中的链接: <a href="http://lists.drupal.org/archives/development/2007-06/msg00171.html">Go PHP 5, Go!  </a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.ooso.net/archives/348/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>用simplexml解析rss出错</title>
		<link>http://www.ooso.net/archives/291</link>
		<comments>http://www.ooso.net/archives/291#comments</comments>
		<pubDate>Sun, 13 May 2007 01:42:41 +0000</pubDate>
		<dc:creator>Volcano</dc:creator>
				<category><![CDATA[php]]></category>
		<category><![CDATA[php5]]></category>
		<category><![CDATA[rss]]></category>

		<guid isPermaLink="false">http://www.ooso.net/index.php/archives/291</guid>
		<description><![CDATA[尝试用simplexml解析一个rss数据源，碰到了一个不小的麻烦。每次解析会碰到一个报错：
Warning: SimpleXMLElement::__construct() [function.SimpleXMLElement---construct]: Entity: line 161: parser error : Entity &#8216;Acirc&#8217; not defined in D:\xampp\htdocs\rss.php on line 11
这是解析rss的php代码片段：

				<span class="readmore"><a href="http://www.ooso.net/archives/291" title="用simplexml解析rss出错">阅读全文（471字）</a></span>]]></description>
			<content:encoded><![CDATA[<p>尝试用<a href="http://www.ooso.net/?s=simplexml">simplexml</a>解析一个rss数据源，碰到了一个不小的麻烦。每次解析会碰到一个报错：</p>
<blockquote><p>Warning: SimpleXMLElement::__construct() [function.SimpleXMLElement---construct]: Entity: line 161: parser error : Entity &#8216;Acirc&#8217; not defined in D:\xampp\htdocs\rss.php on line 11</p></blockquote>
<p>这是解析rss的php代码片段：</p>
<pre><code>try {
	$xml = new SimpleXMLElement($rss);
	var_dump($xml);
} catch(Exception $e) {
	echo $e-&gt;getMessage();
}</code></pre>
<p>查看rss数据源，发现里面有一些乱字符，尝试过滤掉乱字符。</p>
<p>用下面的xmlSafe函数过滤字符，问题解决。</p>
<pre><code>function xmlSafe(&#038;$xml_str) {
	$xml_str =preg_replace("/[\\x00-\\x08\\x0b-\\x0c\\x0e-\\x1f]/",'',$xml_str);
}</code></pre>
]]></content:encoded>
			<wfw:commentRss>http://www.ooso.net/archives/291/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>ubuntu下安装php5 + pdo</title>
		<link>http://www.ooso.net/archives/272</link>
		<comments>http://www.ooso.net/archives/272#comments</comments>
		<pubDate>Tue, 16 Jan 2007 23:11:16 +0000</pubDate>
		<dc:creator>Volcano</dc:creator>
				<category><![CDATA[php]]></category>
		<category><![CDATA[apache]]></category>
		<category><![CDATA[pdo]]></category>
		<category><![CDATA[php5]]></category>
		<category><![CDATA[ubuntu]]></category>

		<guid isPermaLink="false">http://www.ooso.net/index.php/archives/272</guid>
		<description><![CDATA[这几天尝试把工作机迁到ubuntu上来做开发,系统安装好之后的首要任务是安装php+mysql的开发环境. 我打算直接安装php5, pdo_mysql, 下面是安装过程的记录
首先我直接用apt-get安装了apache2,php5,pear以及mysql5, 为了方便后续的安装,还加上了make和libmysqlclient

sudo apt-get install apache2-mpm-prefork

				<span class="readmore"><a href="http://www.ooso.net/archives/272" title="ubuntu下安装php5 + pdo">阅读全文（912字）</a></span>]]></description>
			<content:encoded><![CDATA[<p>这几天尝试把工作机迁到ubuntu上来做开发,系统安装好之后的首要任务是安装php+<a href="http://www.ooso.net/index.php/archives/category/mysql/">mysql</a>的开发环境. 我打算直接安装<a href="http://www.ooso.net/?tag=php5">php5</a>, pdo_mysql, 下面是安装过程的记录</p>
<p>首先我直接用apt-get安装了<a href="http://www.ooso.net/?tag=apache">apache2</a>,php5,pear以及mysql5, 为了方便后续的安装,还加上了make和libmysqlclient</p>
<ul>
<li>sudo apt-get install apache2-mpm-prefork</li>
<li>sudo apt-get install php5</li>
<li>sudo apt-get install php5-dev</li>
<li>sudo apt-get install php5-pear</li>
<li>sudo apt-get install mysql-server-5.0</li>
<li>sudo apt-get install make</li>
<li>sudo apt-get install libmysqlclient15-dev</li>
</ul>
<p>pdo在ubuntu的apt里头似乎还找不到安装源,所以通过pecl来安装这个扩展,非常简单 &#8212;- 如果海底光纤能连通的话:</p>
<blockquote><p>pecl install pdo</p></blockquote>
<p>增加一行:</p>
<blockquote><p>extension=pdo.so</p></blockquote>
<p>到文件:</p>
<blockquote><p>/etc/php/apache2/php.ini<br />
/etc/php/cli/php.ini</p></blockquote>
<p>接下来安装pdo_mysql碰到一些问题, 直接跑pecl install pecl_mysql会出现一些错误,搜索了一下发现是pecl本身的问题,下面是个比较简单的解决办法:</p>
<blockquote><p>
wget http://pecl.php.net/get/PDO_MYSQL-1.0.2.tgz<br />
tar xzvf PDO_MYSQL-1.0.2.tgz<br />
cd PDO_MYSQL-1.0.2</p></blockquote>
<p>注释掉configure里头判断是否已经安装pdo扩展的代码片段,继续跑:</p>
<blockquote><p>
phpize<br />
./configure<br />
make<br />
make install</p></blockquote>
<p>然后再次添加下面一行到前面提到的两个php.ini</p>
<blockquote><p>extension=pdo_mysql.so</p></blockquote>
<p>重启apache之后,  php5 + pdo_mysql就在ubuntu上安装好了, documentroot是/var/www</p>
<h3>后记</h3>
<p>更简单的解决办法是运行:</p>
<blockquote><p>PHP_PDO_SHARED=1 pecl install pdo_mysql</p></blockquote>
]]></content:encoded>
			<wfw:commentRss>http://www.ooso.net/archives/272/feed</wfw:commentRss>
		<slash:comments>9</slash:comments>
		</item>
		<item>
		<title>Pear的PHP_Compat包</title>
		<link>http://www.ooso.net/archives/267</link>
		<comments>http://www.ooso.net/archives/267#comments</comments>
		<pubDate>Wed, 22 Nov 2006 23:42:14 +0000</pubDate>
		<dc:creator>Volcano</dc:creator>
				<category><![CDATA[pear]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[php5]]></category>

		<guid isPermaLink="false">http://www.ooso.net/index.php/archives/267</guid>
		<description><![CDATA[Pear的PHP_Compat是个比较有趣的包,它提供了一些php4下也能使用的php5专有函数,比如file_put_contents,array_combine,str_split&#8230;&#8230;&#8230;.这样即使是在php4的主机上,也能提前享受一点php5函数的便利.
用法
&#60;?php
require_once 'PHP/Compat.php';

				<span class="readmore"><a href="http://www.ooso.net/archives/267" title="Pear的PHP_Compat包">阅读全文（459字）</a></span>]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.ooso.net/index.php/archives/category/pear/">Pear</a>的PHP_Compat是个比较有趣的包,它提供了一些php4下也能使用的<a href="http://www.ooso.net/?tag=php5">php5</a>专有函数,比如file_put_contents,array_combine,str_split&#8230;&#8230;&#8230;.这样即使是在php4的主机上,也能提前享受一点php5函数的便利.</p>
<h3>用法</h3>
<pre><code>&lt;?php
require_once 'PHP/Compat.php';

// load file_put_contents
PHP_Compat::loadFunction('file_put_contents');

// load str_split, array_chunk and file_get_contents
PHP_Compat::loadFunction(array('str_split', 'array_chunk', 'file_get_contents'));
?&gt;</code></pre>
<p>上面的例子说明,可以一次载入n个php5特有函数</p>
<h3>Package Information: PHP_Compat</h3>
<p><a href="http://pear.php.net/package/PHP_Compat">http://pear.php.net/package/PHP_Compat</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.ooso.net/archives/267/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Embeder &#8211; 把php脚本编译成可执行文件</title>
		<link>http://www.ooso.net/archives/261</link>
		<comments>http://www.ooso.net/archives/261#comments</comments>
		<pubDate>Tue, 24 Oct 2006 23:35:08 +0000</pubDate>
		<dc:creator>Volcano</dc:creator>
				<category><![CDATA[php]]></category>
		<category><![CDATA[php-gtk]]></category>
		<category><![CDATA[php5]]></category>

		<guid isPermaLink="false">http://www.ooso.net/index.php/archives/261</guid>
		<description><![CDATA[Embeder是一个命令行工具，可以将php脚本编译成windows下的可执行文件。从介绍上来看，它目前支持php5，所以也可以用来编译php-gtk2的程序文件。
使用前提

把下面列出来的脚本全部复制一遍，并放在同一个目录

				<span class="readmore"><a href="http://www.ooso.net/archives/261" title="Embeder &#8211; 把php脚本编译成可执行文件">阅读全文（324字）</a></span>]]></description>
			<content:encoded><![CDATA[<p>Embeder是一个命令行工具，可以将<a href="http://www.ooso.net/index.php/archives/category/php/">php</a>脚本编译成windows下的可执行文件。从介绍上来看，它目前支持<a href="http://www.ooso.net/?tag=php5">php5</a>，所以也可以用来编译<a href="http://www.ooso.net/?tag=php-gtk">php-gtk2</a>的程序文件。</p>
<h3>使用前提</h3>
<ul>
<li>把下面列出来的脚本全部复制一遍，并放在同一个目录</li>
<li>php5ts.dll必须在path下，或者在当前目录</li>
<li>php_win32std.dll必须安装在php的extension目录下（见php-embed.ini的配置）</li>
<li>embeder.exe也需要和上述文件在同一目录</li>
</ul>
<h3>测试文件</h3>
<li><strong>make.bat</strong>
<pre><code>@echo off
embeder.exe new myapp
embeder.exe main myapp main.php
embeder.exe add myapp include.inc</code></pre>
</li>
<li><strong>include.inc</strong>
<pre><code>&lt;? function hello() { echo "Hello people !"; } ?&gt;</code></pre>
</li>
<li><strong>main.php</strong>
<pre><code>&lt;?
function _f($file) { return defined('EMBEDED')?'res:///PHP/'.md5($file):$file; }

include _f('include.inc');
hello();
?&gt;</code></pre>
</li>
<p>其实解压后就可以运行test目录下的make.bat做一个编译试验，上面所列文件已经存在。</p>
<li>参考文档</li>
<p><a href="http://wildphp.free.fr/wiki/doku.php?id=win32std:embeder">http://wildphp.free.fr/wiki/doku.php?id=win32std:embeder</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.ooso.net/archives/261/feed</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>PHP5的Simplexml</title>
		<link>http://www.ooso.net/archives/258</link>
		<comments>http://www.ooso.net/archives/258#comments</comments>
		<pubDate>Wed, 11 Oct 2006 23:37:19 +0000</pubDate>
		<dc:creator>Volcano</dc:creator>
				<category><![CDATA[php]]></category>
		<category><![CDATA[php5]]></category>
		<category><![CDATA[xml]]></category>

		<guid isPermaLink="false">http://www.ooso.net/index.php/archives/258</guid>
		<description><![CDATA[php5新增了Simplexml extension,我们可以借助它来解析,修改XML。在IBM的知识库里找到一篇文章对此做了专门的介绍，而且比较详细，感兴趣的话可以看看最后的参考文档。
一个RSS Feed
下面是一个RSS的例子，我们准备用simplexml来解析它。
[xml]

				<span class="readmore"><a href="http://www.ooso.net/archives/258" title="PHP5的Simplexml">阅读全文（1664字）</a></span>]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.ooso.net/?tag=php5">php5</a>新增了Simplexml extension,我们可以借助它来解析,修改XML。在IBM的知识库里找到一篇文章对此做了专门的介绍，而且比较详细，感兴趣的话可以看看最后的参考文档。</p>
<h3>一个RSS Feed</h3>
<p>下面是一个RSS的例子，我们准备用simplexml来解析它。<br />
[xml]<?xml version="1.0" encoding="UTF-8"?><br />
<rss version="0.92"><br />
<channel></p>
<link>http://www.elharo.com/blog</link>
  <language>en</language><br />
  <item></p>
<p>    <description><br />
     The old Penn Station in New York was torn down before I was born.<br />
     Looking at these pictures, that feels like a mistake.  The current site is<br />
     functional, but no more; really just some office towers and underground<br />
     corridors of no particular interest or beauty. The new Madison Square&#8230;<br />
    </description></p>
<link>http://www.elharo.com/blog/new-york/2006/07/31/penn-station</link>
  </item><br />
  <item></p>
<p>    <description>Some people use very obnoxious spam filters that require you<br />
     to type some random string in your subject such as E37T to get through.<br />
     Needless to say neither I nor most other people bother to communicate with<br />
     these paranoids. They are grossly overreacting to the spam problem.<br />
     Personally I won&#8217;t &#8230;</description></p>
<link>http://www.elharo.com/blog/tech/2006/07/28/personal-for-elliotte-harold/</link>
  </item><br />
</channel><br />
</rss>[/xml]</p>
<h3>解析XML</h3>
<p>首先载入一个<a href="http://www.ooso.net/?tag=xml">xml</a></p>
<pre><code>$rss =  simplexml_load_file('http://www.ooso.net/index.php/feed/');</code></pre>
<p><span id="more-258"></span></p>
<p>这里使用的是simplexml_load_file函数，能够马上解析指定url的xml文件，因为是simplexml，所以simple。下面就可以象读取php数组一样来使用解析后xml的内容了，比如读取RSS的标题：</p>
<pre><code>$title =  $rss-&gt;channel-&gt;title;
&lt;title&gt;&lt;?php echo $title; ?&gt;&lt;/title&gt;</code></pre>
<p>或者是循环显示rss的各个ITEM节点</p>
<pre><code>$rss-&gt;channel-&gt;item //这个是item</code></pre>
<pre><code>foreach ($rss-&gt;channel-&gt;item as $item) {
  echo "&lt;h2&gt;" . $item-&gt;title . "&lt;/h2&gt;";
  echo "&lt;p&gt;" . $item-&gt;description . "&lt;/p&gt;";
}</code></pre>
<h3>一个简单但完整的RSS Reader</h3>
<p>把上面的代码整合在一起，就是一个五脏俱全的麻雀牌RSS Reader了。</p>
<pre><code>&lt;?php
// 载入并解析XML
$rss =  simplexml_load_file('http://partners.userland.com/nytRss/nytHomepage.xml');
$title =  $rss-&gt;channel-&gt;title;
?&gt;
&lt;html xml:lang="en" lang="en"&gt;
&lt;head&gt;
  &lt;title&gt;&lt;?php echo $title; ?&gt;&lt;/title&gt;
&lt;/head&gt;
&lt;body&gt;

&lt;h1&gt;&lt;?php echo $title; ?&gt;&lt;/h1&gt;

&lt;?php
// 循环输出ITEM节点的说明
foreach ($rss-&gt;channel-&gt;item as $item) {
  echo "&lt;h2&gt;&lt;a href='" . $item-&gt;link . "'&gt;" . $item-&gt;title . "&lt;/a&gt;&lt;/h2&gt;";
  echo "&lt;p&gt;" . $item-&gt;description . "&lt;/p&gt;";
}
?&gt;

&lt;/body&gt;
&lt;/html&gt;</code></pre>
<p>Simplexml,真的很simple,不信可以拿去和<a href="http://www.ooso.net/index.php/archives/category/php/">php</a>的DOM function做下比较:)</p>
<h3>参考</h3>
<p><a href="http://www-128.ibm.com/developerworks/xml/library/x-simplexml.html">http://www-128.ibm.com/developerworks/xml/library/x-simplexml.html</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.ooso.net/archives/258/feed</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>ppform简体中文patch</title>
		<link>http://www.ooso.net/archives/256</link>
		<comments>http://www.ooso.net/archives/256#comments</comments>
		<pubDate>Mon, 09 Oct 2006 23:21:58 +0000</pubDate>
		<dc:creator>Volcano</dc:creator>
				<category><![CDATA[php]]></category>
		<category><![CDATA[php5]]></category>
		<category><![CDATA[ppform]]></category>

		<guid isPermaLink="false">http://www.ooso.net/index.php/archives/256</guid>
		<description><![CDATA[上次拿到了最新的PPFORM，安装好之后会出现主窗体白屏的情况，到ppform.com一看，已经有简体中文操作系统的修正版出来。
站长的说明：
由於開發環境在繁體的作業系統，較缺少簡體平台的測試，因此對於簡體環境產生較多的問題，目前正設法裝設簡體作業系統的測試環境。請使用簡體的朋友予以見諒。
目前就已知的問題，提供修正檔下載，請簡體的朋友不吝指教！

				<span class="readmore"><a href="http://www.ooso.net/archives/256" title="ppform简体中文patch">阅读全文（216字）</a></span>]]></description>
			<content:encoded><![CDATA[<p>上次拿到了最新的<a href="http://www.ooso.net/index.php/archives/253">PPFORM</a>，安装好之后会出现主窗体白屏的情况，到<a href="http://www.ppform.com">ppform.com</a>一看，已经有<a href="http://ppform.com/xoops/modules/mydownloads/">简体中文操作系统的修正版</a>出来。</p>
<p>站长的说明：</p>
<blockquote><p>由於開發環境在繁體的作業系統，較缺少簡體平台的測試，因此對於簡體環境產生較多的問題，目前正設法裝設簡體作業系統的測試環境。請使用簡體的朋友予以見諒。</p>
<p>目前就已知的問題，提供修正檔下載，請簡體的朋友不吝指教！</p></blockquote>
<p>把这个补丁打上以后，在我的WIN XP上的确能够正常运行，而且也能够正确编译成exe文件。</p>
]]></content:encoded>
			<wfw:commentRss>http://www.ooso.net/archives/256/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>PPForm Ver 1.704b发布</title>
		<link>http://www.ooso.net/archives/253</link>
		<comments>http://www.ooso.net/archives/253#comments</comments>
		<pubDate>Wed, 27 Sep 2006 23:52:56 +0000</pubDate>
		<dc:creator>Volcano</dc:creator>
				<category><![CDATA[php]]></category>
		<category><![CDATA[php5]]></category>
		<category><![CDATA[ppform]]></category>

		<guid isPermaLink="false">http://www.ooso.net/index.php/archives/253</guid>
		<description><![CDATA[PPForm Ver 1.704b发布,主要更新:
1. VCL addons 模組
VCL 有許多的實用的模組, 有了 addon 功能, PPForm 自此以後,將有取之不盡的模組可供使用.
2. PHP engine 衝突問題

				<span class="readmore"><a href="http://www.ooso.net/archives/253" title="PPForm Ver 1.704b发布">阅读全文（506字）</a></span>]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.ppform.com">PPForm</a> Ver 1.704b发布,主要更新:</p>
<blockquote><p>1. VCL addons 模組<br />
VCL 有許多的實用的模組, 有了 addon 功能, PPForm 自此以後,將有取之不盡的模組可供使用.</p>
<p>2. PHP engine 衝突問題<br />
php5ts.dll 在很多的軟體都會出現, 各版本並不相容, 為解決這個問題, 將 php5ts.dll 更改成 php50417ts.dll.</p>
<p>3. 移除自動產生 .ini 功能</p>
<p>4. 語系問題<br />
解決非繁體語系在執行時, 發生錯誤的問題</p></blockquote>
<p>另外站长peter还提供了<a href="http://ppform.com/xoops/modules/news/article.php?storyid=9">PPForm Runtime 安裝程式</a></p>
<h3>下载</h3>
<p><a href="http://ppform.com/xoops/modules/mydownloads/">http://ppform.com/xoops/modules/mydownloads/</a></p>
<p><a href="http://www.ooso.net/?tag=ppform">什么是PPFORM</a></p>
<p>BTW:如果安装后白屏，请看下面提示：</p>
<blockquote><p>不好意思, </p>
<p>這個問題應是安裝程式新舊版本的問題, 前版的安裝程式會將 path 加入 C:\Program Files\PPForm\rt50417 的路徑, 而新的安裝程式則是加入 %PP_HOME%\bin, 因此新版的程式讀取到舊版的 lib, 造成這個問題.</p>
<p>解決方式, 請將前版本的 PPForm 環境移除乾淨. 包含 PPForm, PATH, 與 PP_HOME 環境變數. 再重新安裝即可.</p>
<p>以後的更新, 應該可以避免這個問題了.</p></blockquote>
]]></content:encoded>
			<wfw:commentRss>http://www.ooso.net/archives/253/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>租到bluehost主机空间一个</title>
		<link>http://www.ooso.net/archives/245</link>
		<comments>http://www.ooso.net/archives/245#comments</comments>
		<pubDate>Sat, 16 Sep 2006 01:43:29 +0000</pubDate>
		<dc:creator>Volcano</dc:creator>
				<category><![CDATA[common]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[dreamhost]]></category>
		<category><![CDATA[php5]]></category>

		<guid isPermaLink="false">http://www.ooso.net/index.php/archives/245</guid>
		<description><![CDATA[和朋友合租了一个BLUEHOST的主机空间,空间包含如下服务:

30 Gigabyte Hosting Space (NEW!)
Host 6 Domains on 1 Account!!!

				<span class="readmore"><a href="http://www.ooso.net/archives/245" title="租到bluehost主机空间一个">阅读全文（593字）</a></span>]]></description>
			<content:encoded><![CDATA[<p>和朋友合租了一个<a href="http://www.bluehost.com">BLUEHOST</a>的主机空间,空间包含如下服务:</p>
<ul>
<li>30 Gigabyte Hosting Space (NEW!)</li>
<li>Host 6 Domains on 1 Account!!!</li>
<li>2,500 POP/Imap Email Accounts</li>
<li>750 GIGS of Transfer (NEW!)</li>
<li>SSH (Secure Shell), SSL, FTP, Stats</li>
<li>CGI, Ruby (RoR), Perl, PHP, MySQL</li>
<li>2000/2002/2003 Front Page Extensions</li>
<li>Free Domain Forever!</li>
<li>Free Site Builder (NEW)</li>
<li>24/7 Superb/Responsive Sales/Support</li>
</ul>
<p><a href="http://www.bluehost.com/tell_me_more.html">更详细的的说明</a></p>
<p>与<a href="http://www.dreamhost.com">dreamhost</a>比较的话,大概有这些不同:</p>
<ul>
<li>空间不会按月增长</li>
<li>初始空间比dreamhost大</li>
<li>绑定域名的数目有限制,只能是6个</li>
<li>速度&#8230;&#8230;略有些慢,但还能接受,ftp上传稳定在10k左右,再观察几天</li>
</ul>
<p>空间默认支持</p>
<ul>
<li>php 4.4.4</li>
<li>apache 1.3.27</li>
<li>mysql 4.1.xx</li>
</ul>
<p>突然想起这主机能够支持<a href="http://www.ooso.net/?tag=php5">php5</a>,于是发了个邮件给support,在确认了一些信息后,经过48小时后成功迁移到另外一个服务器,php版本是5.1.6,<a href="http://www.ooso.net/index.php/archives/category/mysql/">mysql</a>也升到了5.0.xx,很新潮的样子.</p>
<h3>费用</h3>
<p>只租一年的话 7.95$/月,一次租两年 6.95$/月,似乎比dreamhost要贵</p>
<p><strong>浏览速度仍然是主要的缺陷.</strong></p>
]]></content:encoded>
			<wfw:commentRss>http://www.ooso.net/archives/245/feed</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
		<item>
		<title>php 5.1.6发布</title>
		<link>http://www.ooso.net/archives/235</link>
		<comments>http://www.ooso.net/archives/235#comments</comments>
		<pubDate>Fri, 25 Aug 2006 00:11:29 +0000</pubDate>
		<dc:creator>Volcano</dc:creator>
				<category><![CDATA[php]]></category>
		<category><![CDATA[php5]]></category>

		<guid isPermaLink="false">http://www.ooso.net/index.php/archives/235</guid>
		<description><![CDATA[php 5.1.6发布，此时距php 4.4.4/5.1.5发布时间正好一周。更新如下：

Fixed memory_limit on 64bit systems. (Stefan E.)
Fixed bug #38488(Access to &#8220;php://stdin&#8221; and family crashes PHP on win32). (Dmitry)

				<span class="readmore"><a href="http://www.ooso.net/archives/235" title="php 5.1.6发布">阅读全文（296字）</a></span>]]></description>
			<content:encoded><![CDATA[<p>php 5.1.6发布，此时距php 4.4.4/5.1.5发布时间正好一周。更新如下：</p>
<ul>
<li>Fixed memory_limit on 64bit systems. (Stefan E.)</li>
<li>Fixed bug #38488(Access to &#8220;php://stdin&#8221; and family crashes PHP on win32). (Dmitry)</li>
</ul>
<p>记得刚刚看到上个php5版本出来时，在论坛上看到不少人持观望态度，说php5大更新的后面必定会跟着一个小量的安全更新，真是不幸言中。打开<a href="http://www.php.net/ChangeLog-5.php">PHP 5 ChangeLog</a>，它的版本更新说明果然是疏密有致，有些规律可循，从这点上面来看，许多<a href="http://www.ooso.net/index.php/archives/category/php/">php</a>用户还是很能总结经验的。</p>
<h3>下载</h3>
<p><a href="http://www.php.net/downloads.php#v5">php 5.1.6</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.ooso.net/archives/235/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>用php5来赚大钱</title>
		<link>http://www.ooso.net/archives/210</link>
		<comments>http://www.ooso.net/archives/210#comments</comments>
		<pubDate>Thu, 03 Aug 2006 00:33:48 +0000</pubDate>
		<dc:creator>Volcano</dc:creator>
				<category><![CDATA[ajax]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[php5]]></category>
		<category><![CDATA[优化]]></category>

		<guid isPermaLink="false">http://www.ooso.net/index.php/archives/210</guid>
		<description><![CDATA[写这个标题一定会被打死。
可能这个幻灯跟赚钱没关系－－Getting Rich with PHP 5(IE之外的浏览器可看)。但是个人认为它所介绍的程序优化和分析的方法比较有意思，广大php爱好者如能掌握，说不定真的就解决了温饱问题进而赚了大钱。
幻灯的大义：
首先你准备建一个大流量的网站

				<span class="readmore"><a href="http://www.ooso.net/archives/210" title="用php5来赚大钱">阅读全文（397字）</a></span>]]></description>
			<content:encoded><![CDATA[<h2>写这个标题一定会被打死。</h2>
<p>可能这个幻灯跟赚钱没关系－－<a href="http://talks.php.net/show/oscon06">Getting Rich with PHP 5</a>(IE之外的浏览器可看)。但是个人认为它所介绍的程序优化和分析的方法比较有意思，广大php爱好者如能掌握，说不定真的就解决了温饱问题进而赚了大钱。</p>
<p>幻灯的大义：</p>
<h3>首先你准备建一个大流量的网站</h3>
<p>这个网站真的很大，可能会有这些特点：</p>
<ul>
<li>web 2.0的亲戚</li>
<li>有tag系统</li>
<li>ajax用的港港的，溜的很</li>
<li>有500000活跃用户</li>
<li>等等。。。</li>
</ul>
<p>初步估计这个流量大概是：<br />
平均:578次访问/秒<br />
峰值:578 x 3 = 1700次访问/秒</p>
<p>而且这个网站是用Linux+Apache+<a href="http://www.ooso.net/index.php/archives/category/php/">PHP</a>做的，怎么样？头大了吧。<br />
怎么样用尽可能少的资源，服务更多的人群呢？这就是这个幻灯的最终效果，省下了服务器，也就是赚了钱，对吧？至于您的50万流量的网站有没有转下去并因此赚了钱，那是另外一回事。</p>
<h3>用到的关键词</h3>
<p>Postgresql,<a href="http://www.ooso.net/index.php/archives/category/mysql/">Mysql</a>,APC,Callgrind</p>
]]></content:encoded>
			<wfw:commentRss>http://www.ooso.net/archives/210/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>PHP 5.2.0 RC1发布</title>
		<link>http://www.ooso.net/archives/202</link>
		<comments>http://www.ooso.net/archives/202#comments</comments>
		<pubDate>Wed, 26 Jul 2006 22:51:56 +0000</pubDate>
		<dc:creator>Volcano</dc:creator>
				<category><![CDATA[pear]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[php5]]></category>

		<guid isPermaLink="false">http://www.ooso.net/index.php/archives/202</guid>
		<description><![CDATA[PHP 5.2.0 RC1发布，目前应该只是个样品，适合下载回来测试新功能。主要更新是新增了三个extensions:

filter
json 

				<span class="readmore"><a href="http://www.ooso.net/archives/202" title="PHP 5.2.0 RC1发布">阅读全文（726字）</a></span>]]></description>
			<content:encoded><![CDATA[<p><a href="http://ilia.ws/archives/119-PHP-5.2.0-RC1-Released!.html">PHP 5.2.0 RC1</a>发布，目前应该只是个样品，适合下载回来测试新功能。主要更新是新增了三个extensions:</p>
<ul>
<li><a href="http://cn.php.net/manual/en/ref.filter.php">filter</a></li>
<li><a href="http://www.ooso.net/?tag=json">json </a></li>
<li>zip</li>
</ul>
<p>其中filter extension由Rasmus Lerdorf提供，帮助php开发者过滤用户提交的内容。原来是在<a href="http://pecl.php.net">pecl.php.net</a>，更详细的内容可以看这里：<a href="http://oss.backendmedia.com/PeclFilter">http://oss.backendmedia.com/PeclFilter</a>，如能广泛使用，目前php开发的安全性将提升一个台阶！之前还听说对pdo extension有些调整，比如新增了<a href="http://cn.php.net/manual/en/function.pdostatement-setfetchmode.php">setFetchMode</a>方法，经常使用<a href="http://www.ooso.net/index.php/archives/category/pear/">Pear</a>:DB的同学一定不会陌生。</p>
<blockquote><p>Given that it took a few months to reach this point and addition of new features was allowed the changelog already looks extremely impressive. Some of the key changes include things like 3 new extensions (filter, json and zip), the date extension had the rest of its functionality enabled, much work was done in terms of getting PHP 5.2 to run faster and more efficiently (in terms on memory usage). There have also been nearly 80 bug fixes made to existing functionality, which hopefully translates to a more stable release.</p></blockquote>
<h3>下载</h3>
<ul>
<li><a href="http://downloads.php.net/ilia/php-5.2.0RC1.tar.bz2">bz包</a></li>
<li><a href="http://downloads.php.net/ilia/php-5.2.0RC1.tar.gz">gzip包</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.ooso.net/archives/202/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>PRADO 3.0.2 is released</title>
		<link>http://www.ooso.net/archives/189</link>
		<comments>http://www.ooso.net/archives/189#comments</comments>
		<pubDate>Mon, 03 Jul 2006 01:12:55 +0000</pubDate>
		<dc:creator>Volcano</dc:creator>
				<category><![CDATA[php]]></category>
		<category><![CDATA[framework]]></category>
		<category><![CDATA[php5]]></category>

		<guid isPermaLink="false">http://www.ooso.net/index.php/archives/189</guid>
		<description><![CDATA[prado 3.02发布
We are pleased to announce that PRADO version 3.0.2 is formally released! Version 3.0.2 is a maintenance release of PRADO 3.0, which mainly contains bug fixes and minor enhancements and features.
The most significant feature introduced in this release is the paging capability which is made inherently available to all data-bound controls, such as TRepeater, TDataList, TCheckBoxList, etc. A new TPager control is also introduced which can be used together with the data-bound controls to achieve paging of contents rapidly and easily.

				<span class="readmore"><a href="http://www.ooso.net/archives/189" title="PRADO 3.0.2 is released">阅读全文（1055字）</a></span>]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.xisc.com">prado</a> 3.02发布</p>
<blockquote><p>We are pleased to announce that PRADO version 3.0.2 is formally released! Version 3.0.2 is a maintenance release of PRADO 3.0, which mainly contains bug fixes and minor enhancements and features.</p>
<p>The most significant feature introduced in this release is the paging capability which is made inherently available to all data-bound controls, such as TRepeater, TDataList, TCheckBoxList, etc. A new TPager control is also introduced which can be used together with the data-bound controls to achieve paging of contents rapidly and easily.</p>
<p>Starting from this release, we provide a Macromedia Dreamweaver extension (thanks to Stanislav). The extension installs a PRADO tag library which allows auto-completion of component tags when using Dreamweaver to create PRADO templates. We also provide a script named prado-cli.php which can create a skeleton PRADO application.</p>
<p>PRADO v3.0.2 may be downloaded at http://www.pradosoft.com/download/.</p>
<p>To unsubscribe from these announcements, login to the forum and uncheck &#8220;Receive forum announcements and important notifications by email.&#8221; in your profile.</p>
<p>You can view the full announcement by following this link:</p>
<p>http://www.pradosoft.com/forum/index.php?topic=5013.0</p></blockquote>
<p><a href="http://www.ooso.net/index.php/archives/74">什么是prado</a> </p>
]]></content:encoded>
			<wfw:commentRss>http://www.ooso.net/archives/189/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>fedora 4下面安装apache+php5无法启动</title>
		<link>http://www.ooso.net/archives/133</link>
		<comments>http://www.ooso.net/archives/133#comments</comments>
		<pubDate>Thu, 24 Nov 2005 03:56:54 +0000</pubDate>
		<dc:creator>Volcano</dc:creator>
				<category><![CDATA[php]]></category>
		<category><![CDATA[apache]]></category>
		<category><![CDATA[php5]]></category>

		<guid isPermaLink="false">http://www.ooso.net/index.php/archives/133</guid>
		<description><![CDATA[今天在fedora 4下面安装按常规步骤安装apache+php5，无法启动。
输入apacheclt start后显示：
modules/libphp5.so: cannot restore segment prot after reloc: Permission denied
google之，找到了原因：

				<span class="readmore"><a href="http://www.ooso.net/archives/133" title="fedora 4下面安装apache+php5无法启动">阅读全文（485字）</a></span>]]></description>
			<content:encoded><![CDATA[<p>今天在fedora 4下面安装按<a href="http://www.ooso.net/article/html/install.htm">常规步骤</a>安装apache+php5，无法启动。</p>
<p>输入apacheclt start后显示：</p>
<blockquote><p>modules/libphp5.so: cannot restore segment prot after reloc: Permission denied</p></blockquote>
<p>google之，找到了原因：<br />
<a href="https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=153146">https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=153146</a></p>
<blockquote><p>That error is from selinux which was apparently supposed to be fixed to complain<br />
like that (rh#147806#). Though the real problem is that libicudata is supposed<br />
to be compiled with -fpic, which was also supposed to be fixed. I see now that<br />
the upsteam patch is b0rked.
</p></blockquote>
<p>原来是selinux安装包惹的祸，升级后apache正常启动:<br />
<em><strong>yum update selinux-policy-targeted</strong></em></p>
]]></content:encoded>
			<wfw:commentRss>http://www.ooso.net/archives/133/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>PRADO v2.0RC发布</title>
		<link>http://www.ooso.net/archives/98</link>
		<comments>http://www.ooso.net/archives/98#comments</comments>
		<pubDate>Sat, 03 Aug 2002 08:33:48 +0000</pubDate>
		<dc:creator>Volcano</dc:creator>
				<category><![CDATA[php]]></category>
		<category><![CDATA[framework]]></category>
		<category><![CDATA[php5]]></category>

		<guid isPermaLink="false">/?p=98</guid>
		<description><![CDATA[PRADO v2.0RC发布,还不是稳定版本,但是可以尝试一下.更新如下:
[@more@]



				<span class="readmore"><a href="http://www.ooso.net/archives/98" title="PRADO v2.0RC发布">阅读全文（1316字）</a></span>]]></description>
			<content:encoded><![CDATA[<p><a href="http://xisc.com">PRADO</a> v2.0RC发布,还不是稳定版本,但是可以尝试一下.更新如下:</p>
<p>[@more@]<br />
<table style="100%" cellspacing="1" cellpadding="1" border="1">
<tbody>
<tr>
<td>- Added I18N, L10N support (with several relevant components) <br />- Added TDataGrid, TTable, TDataList, TWizard, TRequiredListValidator controls <br />- Implemented viewstate manager handler <br />- Implemented enumerable property type <br />- Changed the way of including a parameter file within another one <br />- Added EncodeText property to controls with Text property <br />- The parameter of TComponent::removeChild() is changed to component from ID <br />- Control state synchronization is done in addBody() now (instead of addChild()) <br />- Control viewstate maintenance is now based on container-containee relationship <br />- TComponent::addParsedObject() is now invoked when parsing an object <br />- List control now renders values instead of indexes <br />- Implemented TCollection class, Bodies property of TControl <br />is now of type TCollection that allows insertion <br />- Added Datalist, Datagrid and I18N examples <br />- Implemented feature 1093392: Better package layout <br />- Implemented feature 1094956: display spaces <br />- Implemented feature 1102525: Module spec file <br />- Fixed bug 1093843: TRepeater::getItemCount() returns wrong value <br />- Fixed bug 1094219: TDateFormat patterns missing <br />- Fixed bug 1093018: Translation table cache and php open tag <br />- Fixed bug 1091966: Error handler doesn&#8217;t make allowances for @ operator <br />- Fixed bug 1100512: Controls losing viewstate <br />- Fixed bug 1103937: TListControl fatal error within TDataList <br />- Fixed bug 1099808: TTextBox: Slashes won&#8217;t be stripped <br />- Fixed visibility bug related with selection controls </td>
</tr>
</tbody>
</table>
]]></content:encoded>
			<wfw:commentRss>http://www.ooso.net/archives/98/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>PRADO v1.7发布</title>
		<link>http://www.ooso.net/archives/74</link>
		<comments>http://www.ooso.net/archives/74#comments</comments>
		<pubDate>Sat, 03 Aug 2002 08:33:48 +0000</pubDate>
		<dc:creator>Volcano</dc:creator>
				<category><![CDATA[php]]></category>
		<category><![CDATA[framework]]></category>
		<category><![CDATA[php5]]></category>

		<guid isPermaLink="false">/?p=74</guid>
		<description><![CDATA[PRADO v1.7发布。PRADO是什么?
PRADO是在PHP5环境下的一个基于事件驱动和基于组件的WEB应用开发框架。使用PRADO开发WEB应用，你主要需要做的工作就是使用已有的组件（原文是&#34;实例化已经定义好的组件&#34;，熟悉面向对象编程的开发者可能比较容易理解这句话），设置组件的属性，为控件组件的各种事件编写对应的处理函数，然后把这些组织成一个个的页面。这里是prodo 1.6的中文教程
更新如下：


				<span class="readmore"><a href="http://www.ooso.net/archives/74" title="PRADO v1.7发布">阅读全文（1152字）</a></span>]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.xisc.com/">PRADO</a> v1.7发布。PRADO是什么?</p>
<p>PRADO是在PHP5环境下的一个基于事件驱动和基于组件的WEB应用开发框架。使用PRADO开发WEB应用，你主要需要做的工作就是使用已有的组件（原文是&quot;实例化已经定义好的组件&quot;，熟悉面向对象编程的开发者可能比较容易理解这句话），设置组件的属性，为控件组件的各种事件编写对应的处理函数，然后把这些组织成一个个的页面。这里是<a href="http://www.xisc.com/documentation/tutorial-cn.html">prodo 1.6的中文教程</a></p>
<p>更新如下：<br />
<table cellspacing="1" cellpadding="1" border="1">
<tbody>
<tr>
<td>Changes since v1.6 <br />============= <br />- solved the incompatibility problem of Javascript used in validators <br />- enhanced event handler binding (allow binding indirect child component events in template) <br />- introduced parent-child relationship, the old one renamed to container-containee relationship <br />- expression, statement tags with context being themselves <br />- replaced TApplication::getInstance() with pradoGetApplication() <br />- implemented handler concept in TApplication <br />- added handler classes: TResourceParser, TResourceLocator, TRequest, TCacheManager, and TErrorHandler <br />- defined new exception classes <br />- TComponent added many properties <br />- introduced module concept and implemented TModule <br />- implemented application state handling <br />- added AutoTrim to TTextBox <br />- removed the application-level data encoding <br />- instantiateTemplate will init properties <br />- addChild will also load view state and synchronize life cycle of the new component <br />- added blog example <br />- added new components including TFormLabel, TValidatorGroup, TFileUpload, TCheckListBox, TListControl <br />- added a tutorial for using validators </td>
</tr>
</tbody>
</table>
<p></font><font size="2"></font></p>
]]></content:encoded>
			<wfw:commentRss>http://www.ooso.net/archives/74/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>升级到php5的日记 一</title>
		<link>http://www.ooso.net/archives/90</link>
		<comments>http://www.ooso.net/archives/90#comments</comments>
		<pubDate>Sat, 03 Aug 2002 08:33:48 +0000</pubDate>
		<dc:creator>Volcano</dc:creator>
				<category><![CDATA[pear]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[php5]]></category>

		<guid isPermaLink="false">/?p=90</guid>
		<description><![CDATA[终于要从php4升级到php5了,是的,俺费尽了口舌,说服了boss使用php5和mysqli开发新项目.
首先俺细细的阅读了官方站点上介绍php5的有关章节,以及网络上的一些关于php5的文章.基本开发环境定为linux+apache2+php5+mysql4.1,很经典的搭配.为了提高开发效率,俺决定继续使用pear的类库和prado,因此现状是php4,php5的代码将并存.第一周俺们就遇到了麻烦:
1.mysqli和zend1的兼容性php.ini里面有一个选项,可以开启对zend1的兼容性,如果你在打开这个开关的同时还想使用mysqli的话,很快就会失望.它会无情的告诉你:unable clone a uncloneable object&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;

				<span class="readmore"><a href="http://www.ooso.net/archives/90" title="升级到php5的日记 一">阅读全文（504字）</a></span>]]></description>
			<content:encoded><![CDATA[<p>终于要从php4升级到php5了,是的,俺费尽了口舌,说服了boss使用php5和mysqli开发新项目.</p>
<p>首先俺细细的阅读了官方站点上介绍php5的有关章节,以及网络上的一些关于php5的文章.基本开发环境定为linux+apache2+php5+mysql4.1,很经典的搭配.为了提高开发效率,俺决定继续使用<a href="http://pear.php.net/">pear</a>的类库和<a href="http://www.xisc.com/">prado</a>,因此现状是php4,php5的代码将并存.第一周俺们就遇到了麻烦:</p>
<p>1.mysqli和zend1的兼容性<br />php.ini里面有一个选项,可以开启对zend1的兼容性,如果你在打开这个开关的同时还想使用mysqli的话,很快就会失望.它会无情的告诉你:<br />unable clone a uncloneable object&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;</p>
<p>2.使用prado和php5的一些问题<br />prado程序包prado.php的有段代码如下:<br />set_error_handler( &#8230;&#8230;.. );<br />php5的配置默认是不提示E_STRICT级别的错误,要命的是,这行代码对任何错误都会die(&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;..),pear的代码完全没办法工作,只好咔嚓之</p>
]]></content:encoded>
			<wfw:commentRss>http://www.ooso.net/archives/90/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

