<?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>AnySQL.net &#187; PHP</title>
	<atom:link href="http://www.anysql.net/tag/php/feed" rel="self" type="application/rss+xml" />
	<link>http://www.anysql.net</link>
	<description>SQLULDR2, DataCopy, DataSync, WebChart, OraMon, AUL/MyDUL, 性能优化及容量分析</description>
	<lastBuildDate>Wed, 14 Jul 2010 09:27:19 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>DreamHost升级PHP了</title>
		<link>http://www.anysql.net/weblog/lilina_php_505_error.html</link>
		<comments>http://www.anysql.net/weblog/lilina_php_505_error.html#comments</comments>
		<pubDate>Thu, 11 Sep 2008 04:49:38 +0000</pubDate>
		<dc:creator>anysql</dc:creator>
				<category><![CDATA[Weblog]]></category>
		<category><![CDATA[Blog]]></category>
		<category><![CDATA[Lilina]]></category>
		<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://www.anysql.net/wordpress/uncategorized/dreamhost%e5%8d%87%e7%ba%a7php%e4%ba%86.html</guid>
		<description><![CDATA[&#160; &#160; 今天早上访问基于Lilina的RSS时, 页面中报了如下错误. Only variables can be passed by reference &#8230; &#160; &#160; 在网上已证实这是PHP的一个Bug (33643), 当然不能要求DreamHost改PHP版本了, 只能更改rss_parse.inc文件来实现. // smart append &#8211; field and namespace aware function append($el, $text) { &#160; &#160; if (!$el) { &#160; &#160; &#160; &#160; return; &#160; &#160; } &#160; &#160; if ( $this-&#62;current_namespace ) &#160; &#160; { &#160; &#160; &#160; [...]]]></description>
			<content:encoded><![CDATA[<p>&nbsp; &nbsp; 今天早上访问<a href="http://www.anysql.net/rss/index.html">基于Lilina的RSS时</a>, 页面中报了如下错误. </p>
<blockquote class="prefont"><p>
Only variables can be passed by reference &#8230;
</p></blockquote>
<p>&nbsp; &nbsp; 在网上已证实这是PHP的一个Bug (33643), 当然不能要求DreamHost改PHP版本了, 只能更改rss_parse.inc文件来实现. </p>
<blockquote class="prefont"><p>
// smart append &#8211; field and namespace aware <br />
function append($el, $text) {<br />
&nbsp; &nbsp; if (!$el) {<br />
&nbsp; &nbsp; &nbsp; &nbsp; return;<br />
&nbsp; &nbsp; }<br />
&nbsp; &nbsp; if ( $this-&gt;current_namespace ) <br />
&nbsp; &nbsp; {<br />
<strong><br />
&nbsp; &nbsp; &nbsp; &nbsp; if ( $this-&gt;initem ) {<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $tmpvar = $this-&gt;current_item[ $this-&gt;current_namespace ][ $el ];<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $this-&gt;concat($tmpvar , $text);<br />
&nbsp; &nbsp; &nbsp; &nbsp; }<br />
&nbsp; &nbsp; &nbsp; &nbsp; elseif ($this-&gt;inchannel) {<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $tmpvar = $this-&gt;channel[ $this-&gt;current_namespace][ $el ];<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $this-&gt;concat($tmpvar,$text );<br />
&nbsp; &nbsp; &nbsp; &nbsp; }<br />
&nbsp; &nbsp; &nbsp; &nbsp; elseif ($this-&gt;intextinput) {<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $tmpvar = $this-&gt;textinput[ $this-&gt;current_namespace][ $el ];<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $this-&gt;concat($tmpvar , $text );<br />
&nbsp; &nbsp; &nbsp; &nbsp; }<br />
&nbsp; &nbsp; &nbsp; &nbsp; elseif ($this-&gt;inimage) {<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $tmpvar = $this-&gt;image[ $this-&gt;current_namespace ][ $el ];<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $this-&gt;concat($tmpvar , $text );<br />
&nbsp; &nbsp; &nbsp; &nbsp; }<br />
&nbsp; &nbsp; }<br />
</strong>
</p></blockquote>
<p>&nbsp; &nbsp; 上面粗体部份, 是改过的代码, 现在工作正常了. </p>
<h3  class="related_post_title">Relative Posts:</h3><ul class="related_post"><li>2006/11/29 -- <a href="http://www.anysql.net/weblog/lilina_dreamhost_icon.html" title="解决Lilina不能显示网站图标的问题">解决Lilina不能显示网站图标的问题</a> (3)</li><li>2006/09/13 -- <a href="http://www.anysql.net/weblog/lilina_php_cachetime.html" title="控制Lilina中缓存文件是否过时的机制">控制Lilina中缓存文件是否过时的机制</a> (1)</li><li>2006/11/30 -- <a href="http://www.anysql.net/weblog/lilina_anysql_061130.html" title="对Lilina作了很多更新, 新版已可下载.">对Lilina作了很多更新, 新版已可下载.</a> (13)</li><li>2006/10/17 -- <a href="http://www.anysql.net/weblog/lilina_v09_beta3.html" title="Lilina 0.9 Beta3发布, 对于中文有一个地方一定要改.">Lilina 0.9 Beta3发布, 对于中文有一个地方一定要改.</a> (2)</li><li>2006/09/12 -- <a href="http://www.anysql.net/weblog/lilina_rss_display.html" title="Lilina在显示RSS时的一个小问题, 修复了.">Lilina在显示RSS时的一个小问题, 修复了.</a> (1)</li><li>2006/09/07 -- <a href="http://www.anysql.net/weblog/ie7_strict_javascript.html" title="将网站升到IE7不容易, 一个JavaScript的问题">将网站升到IE7不容易, 一个JavaScript的问题</a> (7)</li><li>2006/09/05 -- <a href="http://www.anysql.net/weblog/lilina_cache_html.html" title="在Lilina中应用静态HTML缓冲来提升访问速度">在Lilina中应用静态HTML缓冲来提升访问速度</a> (0)</li><li>2009/06/22 -- <a href="http://www.anysql.net/weblog/movable-type-upgrade-failure.html" title="升级Movable Type失败">升级Movable Type失败</a> (2)</li><li>2009/06/03 -- <a href="http://www.anysql.net/tools/webchart-href-links.html" title="添加WebChart超文本链接">添加WebChart超文本链接</a> (3)</li><li>2009/05/14 -- <a href="http://www.anysql.net/weblog/buy_dbatools_text_links.html" title="有人要买英文站广告位">有人要买英文站广告位</a> (1)</li></ul>]]></content:encoded>
			<wfw:commentRss>http://www.anysql.net/weblog/lilina_php_505_error.html/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>解决Lilina不能显示网站图标的问题</title>
		<link>http://www.anysql.net/weblog/lilina_dreamhost_icon.html</link>
		<comments>http://www.anysql.net/weblog/lilina_dreamhost_icon.html#comments</comments>
		<pubDate>Wed, 29 Nov 2006 16:37:46 +0000</pubDate>
		<dc:creator>anysql</dc:creator>
				<category><![CDATA[Weblog]]></category>
		<category><![CDATA[Blog]]></category>
		<category><![CDATA[Lilina]]></category>
		<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://www.anysql.net/wordpress/uncategorized/%e8%a7%a3%e5%86%b3lilina%e4%b8%8d%e8%83%bd%e6%98%be%e7%a4%ba%e7%bd%91%e7%ab%99%e5%9b%be%e6%a0%87%e7%9a%84%e9%97%ae%e9%a2%98.html</guid>
		<description><![CDATA[&#160; &#160; 我的站点架在DreamHost上面, 发现基于Lilina的RSS页面中, 不能显示每个订阅的网站的favicon.ico图标, 昨晚研究了一会, 终于搞明白了什么问题, 并改了一下代码搞定这个问题. &#160; &#160; 问题应当是由DreamHost重新编译或升级了他们的PHP引起的, 在编译过程中他们指定了allow_url_fopen为false, 这样的话PHP函数get_file_contents函数就不能打开url来取得别人网站上的图标了, 通过改成用curl来实现抓取功能就可以了. &#160; &#160; 打开lib.php文件, 找到channelFavicon函数, 将下面的两行: if (!($data = @file_get_contents($ico_url))) &#160; &#160; &#160; &#160; $data=$empty_ico_data ; if (stristr($data,&#8217;html&#8217;)) $data=$empty_ico_data ; &#160; &#160; 替换为: $ch = curl_init($ico_url); curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); $data = curl_exec($ch); curl_close($ch); if (!$data) $data=$empty_ico_data ; if (stristr($data,&#8217;html&#8217;)) [...]]]></description>
			<content:encoded><![CDATA[<p>&nbsp; &nbsp; 我的站点架在DreamHost上面, 发现基于Lilina的RSS页面中, 不能显示每个订阅的网站的favicon.ico图标, 昨晚研究了一会, 终于搞明白了什么问题, 并改了一下代码搞定这个问题. </p>
<p>&nbsp; &nbsp; 问题应当是由DreamHost重新编译或升级了他们的PHP引起的, 在编译过程中他们指定了allow_url_fopen为false, 这样的话PHP函数get_file_contents函数就不能打开url来取得别人网站上的图标了, 通过改成用curl来实现抓取功能就可以了. </p>
<p>&nbsp; &nbsp; 打开lib.php文件, 找到channelFavicon函数, 将下面的两行: </p>
<blockquote class="prefont"><p>
if (!($data = @file_get_contents($ico_url))) <br />
&nbsp; &nbsp; &nbsp; &nbsp; $data=$empty_ico_data ;<br />
if (stristr($data,&#8217;html&#8217;)) $data=$empty_ico_data ;
</p></blockquote>
<p>&nbsp; &nbsp; 替换为: </p>
<blockquote class="prefont"><p>
$ch = curl_init($ico_url);<br />
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);<br />
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);<br />
$data = curl_exec($ch);<br />
curl_close($ch);<br />
if (!$data) $data=$empty_ico_data ;<br />
if (stristr($data,&#8217;html&#8217;)) $data=$empty_ico_data ;
</p></blockquote>
<p>&nbsp; &nbsp; DreamHost作此改变应当是为安全考虑吧! </p>
<h3  class="related_post_title">Relative Posts:</h3><ul class="related_post"><li>2008/09/10 -- <a href="http://www.anysql.net/weblog/lilina_php_505_error.html" title="DreamHost升级PHP了">DreamHost升级PHP了</a> (2)</li><li>2006/09/13 -- <a href="http://www.anysql.net/weblog/lilina_php_cachetime.html" title="控制Lilina中缓存文件是否过时的机制">控制Lilina中缓存文件是否过时的机制</a> (1)</li><li>2006/11/30 -- <a href="http://www.anysql.net/weblog/lilina_anysql_061130.html" title="对Lilina作了很多更新, 新版已可下载.">对Lilina作了很多更新, 新版已可下载.</a> (13)</li><li>2006/10/17 -- <a href="http://www.anysql.net/weblog/lilina_v09_beta3.html" title="Lilina 0.9 Beta3发布, 对于中文有一个地方一定要改.">Lilina 0.9 Beta3发布, 对于中文有一个地方一定要改.</a> (2)</li><li>2006/09/12 -- <a href="http://www.anysql.net/weblog/lilina_rss_display.html" title="Lilina在显示RSS时的一个小问题, 修复了.">Lilina在显示RSS时的一个小问题, 修复了.</a> (1)</li><li>2006/09/07 -- <a href="http://www.anysql.net/weblog/ie7_strict_javascript.html" title="将网站升到IE7不容易, 一个JavaScript的问题">将网站升到IE7不容易, 一个JavaScript的问题</a> (7)</li><li>2006/09/05 -- <a href="http://www.anysql.net/weblog/lilina_cache_html.html" title="在Lilina中应用静态HTML缓冲来提升访问速度">在Lilina中应用静态HTML缓冲来提升访问速度</a> (0)</li><li>2009/06/22 -- <a href="http://www.anysql.net/weblog/movable-type-upgrade-failure.html" title="升级Movable Type失败">升级Movable Type失败</a> (2)</li><li>2009/06/03 -- <a href="http://www.anysql.net/tools/webchart-href-links.html" title="添加WebChart超文本链接">添加WebChart超文本链接</a> (3)</li><li>2009/05/14 -- <a href="http://www.anysql.net/weblog/buy_dbatools_text_links.html" title="有人要买英文站广告位">有人要买英文站广告位</a> (1)</li></ul>]]></content:encoded>
			<wfw:commentRss>http://www.anysql.net/weblog/lilina_dreamhost_icon.html/feed</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>控制Lilina中缓存文件是否过时的机制</title>
		<link>http://www.anysql.net/weblog/lilina_php_cachetime.html</link>
		<comments>http://www.anysql.net/weblog/lilina_php_cachetime.html#comments</comments>
		<pubDate>Thu, 14 Sep 2006 00:19:34 +0000</pubDate>
		<dc:creator>anysql</dc:creator>
				<category><![CDATA[Weblog]]></category>
		<category><![CDATA[Blog]]></category>
		<category><![CDATA[Lilina]]></category>
		<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://www.anysql.net/wordpress/uncategorized/%e6%8e%a7%e5%88%b6lilina%e4%b8%ad%e7%bc%93%e5%ad%98%e6%96%87%e4%bb%b6%e6%98%af%e5%90%a6%e8%bf%87%e6%97%b6%e7%9a%84%e6%9c%ba%e5%88%b6.html</guid>
		<description><![CDATA[&#160; &#160; 这个问题的关键是在PHP取得文件的最后修改时间, 其实很简单: function mtime($filename) { &#160; &#160; &#160; &#160; $fd = fopen($filename, &#8220;r&#8221;); &#160; &#160; &#160; &#160; $fstat = fstat($fd); &#160; &#160; &#160; &#160; fclose($fd); &#160; &#160; &#160; &#160; return $fstat['mtime']; } &#160; &#160; 取得当前时间, 返回自从Unix纪元(格林威治时间1970年1月1日 00:00:00)到当前时间的秒数: &#160; $curtime = time(); &#160; echo &#8220;Current Date:&#8221;.date(&#8216;Y-m-d&#8217;, $curtime).&#8221;\n&#8221;; &#160; &#160; 两个时间相减得到的结果是秒数. 可以用如下方法确定缓存文件是否过时: if ( (time() [...]]]></description>
			<content:encoded><![CDATA[<p>&nbsp; &nbsp; 这个问题的关键是在PHP取得文件的最后修改时间, 其实很简单:</p>
<blockquote class="prefont"><p>
function mtime($filename)<br />
{<br />
&nbsp; &nbsp; &nbsp; &nbsp; $fd = fopen($filename, &#8220;r&#8221;);<br />
&nbsp; &nbsp; &nbsp; &nbsp; $fstat = fstat($fd);<br />
&nbsp; &nbsp; &nbsp; &nbsp; fclose($fd);<br />
&nbsp; &nbsp; &nbsp; &nbsp; return $fstat['mtime'];<br />
}
</p></blockquote>
<p>&nbsp; &nbsp; 取得当前时间, 返回自从Unix纪元(格林威治时间1970年1月1日 00:00:00)到当前时间的秒数:</p>
<blockquote class="prefont"><p>
&nbsp; $curtime = time();<br />
&nbsp; echo &#8220;Current Date:&#8221;.date(&#8216;Y-m-d&#8217;, $curtime).&#8221;\n&#8221;;
</p></blockquote>
<p>&nbsp; &nbsp; 两个时间相减得到的结果是秒数. 可以用如下方法确定缓存文件是否过时:</p>
<blockquote class="prefont"><p>
if ( (time() &#8211; mtime($filename)) &gt; $CACHE_FILE_TIMEOUT) then<br />
{<br />
&nbsp;  &#8230;<br />
}
</p></blockquote>
<p>&nbsp; &nbsp; 以上是我在改动Lilina的缓存机制时学到的. </p>
<h3  class="related_post_title">Relative Posts:</h3><ul class="related_post"><li>2008/09/10 -- <a href="http://www.anysql.net/weblog/lilina_php_505_error.html" title="DreamHost升级PHP了">DreamHost升级PHP了</a> (2)</li><li>2006/11/29 -- <a href="http://www.anysql.net/weblog/lilina_dreamhost_icon.html" title="解决Lilina不能显示网站图标的问题">解决Lilina不能显示网站图标的问题</a> (3)</li><li>2006/11/30 -- <a href="http://www.anysql.net/weblog/lilina_anysql_061130.html" title="对Lilina作了很多更新, 新版已可下载.">对Lilina作了很多更新, 新版已可下载.</a> (13)</li><li>2006/10/17 -- <a href="http://www.anysql.net/weblog/lilina_v09_beta3.html" title="Lilina 0.9 Beta3发布, 对于中文有一个地方一定要改.">Lilina 0.9 Beta3发布, 对于中文有一个地方一定要改.</a> (2)</li><li>2006/09/12 -- <a href="http://www.anysql.net/weblog/lilina_rss_display.html" title="Lilina在显示RSS时的一个小问题, 修复了.">Lilina在显示RSS时的一个小问题, 修复了.</a> (1)</li><li>2006/09/07 -- <a href="http://www.anysql.net/weblog/ie7_strict_javascript.html" title="将网站升到IE7不容易, 一个JavaScript的问题">将网站升到IE7不容易, 一个JavaScript的问题</a> (7)</li><li>2006/09/05 -- <a href="http://www.anysql.net/weblog/lilina_cache_html.html" title="在Lilina中应用静态HTML缓冲来提升访问速度">在Lilina中应用静态HTML缓冲来提升访问速度</a> (0)</li><li>2009/06/22 -- <a href="http://www.anysql.net/weblog/movable-type-upgrade-failure.html" title="升级Movable Type失败">升级Movable Type失败</a> (2)</li><li>2009/06/03 -- <a href="http://www.anysql.net/tools/webchart-href-links.html" title="添加WebChart超文本链接">添加WebChart超文本链接</a> (3)</li><li>2009/05/14 -- <a href="http://www.anysql.net/weblog/buy_dbatools_text_links.html" title="有人要买英文站广告位">有人要买英文站广告位</a> (1)</li></ul>]]></content:encoded>
			<wfw:commentRss>http://www.anysql.net/weblog/lilina_php_cachetime.html/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>
