<?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>blog.haraldkraft.de &#187; php</title>
	<atom:link href="http://blog.haraldkraft.de/tag/php/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.haraldkraft.de</link>
	<description>Blog Project of Harald Kraft</description>
	<lastBuildDate>Thu, 08 Jul 2010 20:32:33 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=abc</generator>
		<item>
		<title>WebCalendar is not working with Lightning or Sunbird</title>
		<link>http://blog.haraldkraft.de/2009/09/webcalendar-is-not-working-with-lightning-or-sunbird/</link>
		<comments>http://blog.haraldkraft.de/2009/09/webcalendar-is-not-working-with-lightning-or-sunbird/#comments</comments>
		<pubDate>Fri, 18 Sep 2009 20:19:38 +0000</pubDate>
		<dc:creator>Harald Kraft</dc:creator>
				<category><![CDATA[Technical]]></category>
		<category><![CDATA[encoding]]></category>
		<category><![CDATA[lightning]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[sunbird]]></category>
		<category><![CDATA[thunderbird]]></category>
		<category><![CDATA[webcalendar]]></category>

		<guid isPermaLink="false">http://blog.haraldkraft.de/?p=71</guid>
		<description><![CDATA[After using WebCalendar for quite I while, I finally got to the bottom of the problem, why it wasn&#8217;t working as a remote calendar in Mozilla Sunbird or in the Thunderbird extension Lightning. Following the official description how to subscribe to a remote calendar did add the calendar successfully, but showed a yellow warning sign [...]]]></description>
			<content:encoded><![CDATA[<p>After using <a href="http://blog.haraldkraft.de/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL3d3dy5rNW4udXMvd2ViY2FsZW5kYXIucGhw">WebCalendar</a> for quite I while, I finally got to the bottom of the problem, why it wasn&#8217;t working as a remote calendar in Mozilla Sunbird or in the Thunderbird extension Lightning.</p>
<p>Following the <a href="http://blog.haraldkraft.de/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL3d3dy5rNW4udXMvd2lraS9pbmRleC5waHA/dGl0bGU9UmVtb3RlX1B1Ymxpc2hpbmdfd2l0aF9TdW5iaXJk">official description</a> how to subscribe to a remote calendar did add the calendar successfully, but showed a yellow warning sign with the caption </p>
<blockquote><p>The calendar foobar is momentarily not available</p></blockquote>
<p><span id="more-71"></span>This message actually points to a connection problem, network wise or maybe concerning the webserver. Even though I had done everything according to the description, it didn&#8217;t help.<br />
For a long time, this was the status quo &#8211; surprisingly the calendar worked from time to time, without any explanation.</p>
<p>However, trying to open an exported .ics file with Lightning/Sunbird pointed me into another direction, because it <em>still</em> claimed to be momentarily not available, even though no network or other connection was involved.<br />
Honestly, I should have tried it before, but this was the first time I opened Thunderbird&#8217;s <em>Error Console</em> to see a more descriptive warning message:</p>
<blockquote><p>Warning: There has been an error reading data for calendar: foobar. Error code: CAL_UTF8_DECODING_FAILED. Description: An error occurred while decoding an iCalendar (ics) file as UTF-8. Check that the file, including symbols and accented letters, is encoded using the UTF-8 character encoding.</p></blockquote>
<p>and if any Germans have this problem:</p>
<blockquote><p>Warnung: Fehler beim Lesen von Daten für Kalender: foobar. Fehlercode: CAL_UTF8_DECODING_FAILED. Beschreibung: Ein Fehler ist beim Dekodieren einer iCalendar(ics)-Datei als UTF-8 aufgetreten. Überprüfen Sie, dass die Datei, inklusive Symbolen und akzentierten Buchstaben, mit dem UTF-8-Zeichensatz kodiert ist.</p></blockquote>
<p>So, obviously it was an encoding problem. I tried to save the exported ICS file in several encodings and could open it with Sunbird/Lightning if it was properly encoded in UTF-8.<br />
The message in Thunderbird&#8217;s error console finally made it easy to google the problem (as opposed to the warning caption telling me that the calendar was momentarily not available). People seemed to have this very problem when they used special characters in their WebCalendar. And in fact, as I removed the special characters I was using in some event descriptions, loading the calendar in Lightning worked just fine.</p>
<p>One solution for the problem is not to use any special characters, the other one is just a workaround until they fix this issue (which is still commented as a <em>TODO</em> in the code btw <img src='http://blog.haraldkraft.de/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' />  ): <a href="http://blog.haraldkraft.de/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL3NvdXJjZWZvcmdlLm5ldC90cmFja2VyL2luZGV4LnBocD9mdW5jPWRldGFpbCYjMDM4O2FpZD0yMTM2MjMyJiMwMzg7Z3JvdXBfaWQ9Mzg3MCYjMDM4O2F0aWQ9MTAzODcw">This WebCalendar SourceForge Bugtracker comment</a> tried to comment out a few lines in the WebCalendar source code. The final code of my <em>&#8220;webcalendar-dir&#8221;/includes/classes/WebCalendar.class</em> now looks like this (around line 870 in v1.2.0):<br />
<code>//    if (extension_loaded('mbstring')) {<br />
//     $mb_lang = strtok($lang, '-');<br />
//      if (mb_language($mb_lang) &#038;&#038; mb_internal_encoding(translate('charset'))) {<br />
//        $enable_mbstring = true;<br />
//      } else {<br />
        $enable_mbstring = false;<br />
//      }<br />
//    }</code><br />
This workaround works fine for me at the moment. Hope it does as well for anybody having this problem <img src='http://blog.haraldkraft.de/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>Please do comment your experiences.</p>
 <img src="http://blog.haraldkraft.de/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?view=1&post_id=71" width="1" height="1" style="display: none;" />]]></content:encoded>
			<wfw:commentRss>http://blog.haraldkraft.de/2009/09/webcalendar-is-not-working-with-lightning-or-sunbird/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Invalid command &#8216;Script&#8217; in Apache configuration</title>
		<link>http://blog.haraldkraft.de/2009/08/invalid-command-script-in-apache-configuration/</link>
		<comments>http://blog.haraldkraft.de/2009/08/invalid-command-script-in-apache-configuration/#comments</comments>
		<pubDate>Mon, 03 Aug 2009 11:14:00 +0000</pubDate>
		<dc:creator>Harald Kraft</dc:creator>
				<category><![CDATA[Technical]]></category>
		<category><![CDATA[apache]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[script]]></category>

		<guid isPermaLink="false">http://blog.haraldkraft.de/?p=45</guid>
		<description><![CDATA[While I was trying to allow some tool&#8217;s PHP file to perform the HTTP command PUT, the tool&#8217;s manual said to put the following code in the httpd.conf Apache configuration file: &#60;Directory /foo/bar&#62; Script PUT /some.php &#60;/Directory&#62; And so I did. But when I tried to reload Apache&#8217;s configuration (/etc/init.d/apache2 reload), Apache complained with the [...]]]></description>
			<content:encoded><![CDATA[<p>While I was trying to allow some tool&#8217;s PHP file to perform the HTTP command <em>PUT</em>, the tool&#8217;s manual said to put the following code in the <em>httpd.conf</em> Apache configuration file:<br />
<code>&lt;Directory /foo/bar&gt;<br />
Script PUT /some.php<br />
&lt;/Directory&gt;</code></p>
<p>And so I did. But when I tried to reload Apache&#8217;s configuration (<em>/etc/init.d/apache2 reload</em>), Apache complained with the following message:</p>
<blockquote><p>Invalid command &#8216;Script&#8217;, perhaps misspelled or defined by a module not included in the server configuration<br />
<span style="color: #ff0000;">failed!</span></p></blockquote>
<p><span id="more-45"></span><br />
At this point in time, Google didn&#8217;t have any results for the error string, and this is why I am actually writing this blog entry.</p>
<p>Searching for Apache2&#8242;s directive <strong>Script</strong> got me to <a href="http://blog.haraldkraft.de/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL2h0dHBkLmFwYWNoZS5vcmcvZG9jcy8yLjIvbW9kL21vZF9hY3Rpb25zLmh0bWwjc2NyaXB0">this Apache doc</a> where you can see that the directive <strong>Script</strong> is part of the module <strong>mod_actions</strong>.<br />
As already mentioned in the error message, a module was not included, now I knew that it would probably be the <em>mod_actions</em> module. Enabling the module by symlinking it from <em>mods-enabled</em> to <em>mods-available</em> made the error message disappear and everything working just fine:</p>
<blockquote><p>ln -s /etc/apache2/mods-available/actions.load /etc/apache2/mods-enabled/actions.load<br />
ln -s /etc/apache2/mods-available/actions.conf /etc/apache2/mods-enabled/actions.conf</p></blockquote>
<p>Hope this helps to offer a quick solution for the error message.</p>
<p>Btw, while looking for fixes, I stumpled across <a href="http://blog.haraldkraft.de/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL3d3dy5hcGFjaGV3ZWVrLmNvbS9mZWF0dXJlcy9wdXQ=">this page</a>, which offers further information about how to use Apache&#8217;s <strong>Script</strong> directive.</p>
 <img src="http://blog.haraldkraft.de/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?view=1&post_id=45" width="1" height="1" style="display: none;" />]]></content:encoded>
			<wfw:commentRss>http://blog.haraldkraft.de/2009/08/invalid-command-script-in-apache-configuration/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Twitter PHP script</title>
		<link>http://blog.haraldkraft.de/2009/06/twitter-php-script/</link>
		<comments>http://blog.haraldkraft.de/2009/06/twitter-php-script/#comments</comments>
		<pubDate>Mon, 29 Jun 2009 00:19:25 +0000</pubDate>
		<dc:creator>Harald Kraft</dc:creator>
				<category><![CDATA[Life and People]]></category>
		<category><![CDATA[Technical]]></category>
		<category><![CDATA[parsing]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[script]]></category>
		<category><![CDATA[twitter]]></category>

		<guid isPermaLink="false">http://blog.haraldkraft.de/?p=19</guid>
		<description><![CDATA[I wrote this PHP script in order to include the latest tweets from my Twitter on my website. It retrieves the RSS feed, parses it and pastes a number of tweets (along with timestamp and link) to HTML. [[ OLD: Before I can / want to release it under some free software license, I would [...]]]></description>
			<content:encoded><![CDATA[<p>I wrote this PHP script in order to include the latest tweets from my Twitter on my <a href="http://blog.haraldkraft.de/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL2hhcmFsZGtyYWZ0LmRl">website</a>. It retrieves the RSS feed, parses it and pastes a number of tweets (along with timestamp and link) to HTML.</p>
<p><em>[[ OLD:<br />
Before I can / want to release it under some free software license, I would appreciate it if some of you PHP nerds could review the code. I am mainly concerned about security issues rather than formatting and coding style. Since I am no pro in PHP coding, I will probably have done some things quite clumsily.</p>
<p>So please point out security problems as well as other major issues. (For example, if anybody knows how to stop parsing after max items were dealt which, please let me know <img src='http://blog.haraldkraft.de/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  ).<br />
]]</em></p>
<p><em>[UPDATE 07/08/2009]</em><br />
(HTTP) Links are now made clickable.<br />
<em>[/UPDATE]</em></p>
<p><em>[UPDATE 15/12/2009]</em><br />
The script was <strong>released</strong> under the Creative Commons Attribution 3.0 Unported License today.<br />
Download the PHP code at <a href="http://blog.haraldkraft.de/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL2Jsb2cuaGFyYWxka3JhZnQuZGUvd3AtY29udGVudC91cGxvYWRzLzIwMDkvMTIvcGFyc2V0d2l0dGVyLnBocF8udHh0">http://blog.haraldkraft.de/wp-content/uploads/2009/12/parsetwitter.php_.txt</a> and feel free to reuse and tweak my script (along with mentioning my name as suggested in the license information in the code).<br />
<em>[/UPDATE]</em></p>
<p>Email me at <span id="emob-oybt@unenyqxensg.qr-24">blog {at} haraldkraft(.)de</span><script type="text/javascript">
    var mailNode = document.getElementById('emob-oybt@unenyqxensg.qr-24');
    var linkNode = document.createElement('a');
    linkNode.setAttribute('href', "mailto:%62%6C%6F%67%40%68%61%72%61%6C%64%6B%72%61%66%74%2E%64%65");
    tNode = document.createTextNode("blog {at} haraldkraft(.)de");
    linkNode.appendChild(tNode);
    linkNode.setAttribute('id', "emob-oybt@unenyqxensg.qr-24");
    mailNode.parentNode.replaceChild(linkNode, mailNode);
</script> (or comment)</p>
<p><a rel=\"license\" href="http://blog.haraldkraft.de/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL2NyZWF0aXZlY29tbW9ucy5vcmcvbGljZW5zZXMvYnkvMy4wLw=="><img alt="Creative Commons License" style="border-width:0" src="http://i.creativecommons.org/l/by/3.0/88x31.png" /></a><br />This work is licensed under a <a rel=\"license\" href="http://blog.haraldkraft.de/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL2NyZWF0aXZlY29tbW9ucy5vcmcvbGljZW5zZXMvYnkvMy4wLw==">Creative Commons Attribution 3.0 Unported License</a>.</p>
 <img src="http://blog.haraldkraft.de/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?view=1&post_id=19" width="1" height="1" style="display: none;" />]]></content:encoded>
			<wfw:commentRss>http://blog.haraldkraft.de/2009/06/twitter-php-script/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
	</channel>
</rss>
