<?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"
	>

<channel>
	<title>.phpist</title>
	<atom:link href="http://phpist.net/feed/" rel="self" type="application/rss+xml" />
	<link>http://phpist.net</link>
	<description>by Umut AYDIN</description>
	<pubDate>Tue, 06 Jan 2009 12:44:13 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.6.1</generator>
	<language>en</language>
			<item>
		<title>Compile Apache2 with PHP5</title>
		<link>http://phpist.net/2009/01/06/compile-apache2-with-php5/</link>
		<comments>http://phpist.net/2009/01/06/compile-apache2-with-php5/#comments</comments>
		<pubDate>Tue, 06 Jan 2009 08:34:31 +0000</pubDate>
		<dc:creator>Umut AYDIN</dc:creator>
		
		<category><![CDATA[Apache]]></category>

		<category><![CDATA[Global]]></category>

		<category><![CDATA[Linux]]></category>

		<category><![CDATA[PHP5]]></category>

		<category><![CDATA[Ubuntu]]></category>

		<guid isPermaLink="false">http://phpist.net/?p=100</guid>
		<description><![CDATA[In Linux, installing Apache2 and PHP5 is easy. Always there is a related package to your distribution. But in many case, you&#8217;re not gonna prefer that environment. Because there may be some compile-time limits in your environment. For example, in Ubuntu, Apache2 comes with 256 ServerLimit configuration.
# apt-get install apache2 php5
Yesterday, I compiled Apache2 and [...]]]></description>
			<content:encoded><![CDATA[<p>In Linux, installing Apache2 and PHP5 is easy. Always there is a related package to your distribution. But in many case, you&#8217;re not gonna prefer that environment. Because there may be some compile-time limits in your environment. For example, in Ubuntu, Apache2 comes with 256 ServerLimit configuration.</p>
<blockquote><p># apt-get install apache2 php5</p></blockquote>
<p>Yesterday, I compiled Apache2 and PHP5 from source code to solve some performance problems for a media company and I&#8217;m gonna share compiling Apache2 and PHP5 parts with you.</p>
<p>If you don&#8217;t optimize your web server your web site will never work stable whatever your server specification is. Yesterday, when I hear the website working slowly, first I checked error logs. There are so many errors on the pages. Remember, you need to fix these errors before you apply a specific performance tuning.</p>
<p>When all errors gone away web site were still slow. So, I had to do something about that! This article is not for performance tuning. Because of that I won&#8217;t touch on tuning details.</p>
<p>There is a powerful server with Dual CPU and 8GB RAM. In that case, that server is web server and runs static pages 90 percent.</p>
<p>As I said before, there is a compile-time limit in Apache2 which is installed by <em>apt-get</em> in Ubuntu. To solve that problem I compiled Apache2 from source code with PHP5. Here are the instructions:</p>
<ul>
<li>Download Apache2 source from <a href="http://httpd.apache.org/download.cgi">official web site</a>.</li>
<li>Unpack the source code.</li>
</ul>
<p>ServerLimit is a compile-time option and it&#8217;s located in <em>MPM (Multi-Processing Module)</em> scripts. If you want to set that option you need to open <em>prefork.c</em> file which is located in /server/mpm/prefork directory in your Apache2 source directory and find <em>DEFAULT_SERVER_LIMIT </em>definition and change it to value you want to.</p>
<blockquote><p># ./configure &#8211;enable-so &#8211;enable-cgi &#8211;enable-info &#8211;enable-rewrite &#8211;enable-speling &#8211;enable-usertrack &#8211;enable-deflate &#8211;enable-ssl &#8211;enable-mime-magic</p></blockquote>
<p>You have to install some extra packages to complete <em>configure</em> command with these options such as SSL, Deflate. You can use <em>apt-get</em> to install extra packages.</p>
<p>When you complete <em>configure</em> successfully it&#8217;s time to run <em>make</em> command. <em>make</em> will take times and then, you have to run <em>make install</em> to install Apache2. If you don&#8217;t use <em>&#8211;prefix</em> option in <em>configure</em> Apache2 will be installed into default directory. It&#8217;s probably <em>/usr/local/apache2</em>.</p>
<p>So, we&#8217;re completed to install Apache2. It&#8217;s PHP&#8217;s turn now.</p>
<ul>
<li>Download PHP5 source from <a href="http://www.php.net/get/php-5.2.8.tar.gz/from/a/mirror">official web site</a>.</li>
<li>Unpack source code.</li>
</ul>
<blockquote><p>./configure &#8211;with-apxs2=/usr/local/apache2/bin/apxs &#8211;with-mysql &#8211;prefix=/usr/local/apache2/php &#8211;with-config-file-path=/usr/local/apache2/php &#8211;disable-cgi &#8211;with-zlib &#8211;with-gettext &#8211;with-gd &#8211;enable-ftp</p></blockquote>
<p>You have to install some extra packages to complete <em>configure</em> command with these options such as MySQL, GD, ZLib.</p>
<p>When you complete <em>configure</em> successfully it&#8217;s time to run <em>make</em> command. <em>make</em> will take times and then, you have to run <em>make install</em> to install PHP5.</p>
<blockquote><p>cp php.ini-recommended /usr/local/apache2/php/php.ini</p></blockquote>
<p>In my case, these modules were required. You may want to change <em>configure</em> options.</p>
<p>If you completed to install successfully Apache2 and PHP5, you need to make some modifications in Apache2 configuration.</p>
<blockquote><p>AddHandler php5-script php<br />
DirectoryIndex index.php index.html<br />
AddType text/html php</p></blockquote>
<p>Now you have your own compiled Apache2 and PHP5.</p>
]]></content:encoded>
			<wfw:commentRss>http://phpist.net/2009/01/06/compile-apache2-with-php5/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Mobile Data Synchronization</title>
		<link>http://phpist.net/2008/12/20/mobile-data-synchronization/</link>
		<comments>http://phpist.net/2008/12/20/mobile-data-synchronization/#comments</comments>
		<pubDate>Fri, 19 Dec 2008 23:31:31 +0000</pubDate>
		<dc:creator>Umut AYDIN</dc:creator>
		
		<category><![CDATA[Development]]></category>

		<category><![CDATA[Global]]></category>

		<category><![CDATA[Mobile]]></category>

		<category><![CDATA[PHP5]]></category>

		<guid isPermaLink="false">http://phpist.net/?p=89</guid>
		<description><![CDATA[We&#8217;re living with our cell phones. Wherever we go all these portable devices are with us. We are more mobile these days.
With all these devices and the situation that covers us, we made an eternal market: Mobile Data Synchronization. Actually, for years, some players -really big ones- are already playing in this market. In this [...]]]></description>
			<content:encoded><![CDATA[<p>We&#8217;re living with our cell phones. Wherever we go all these portable devices are with us. We are more mobile these days.</p>
<p>With all these devices and the situation that covers us, we made an eternal market: <strong>Mobile Data Synchronization</strong>. Actually, for years, some players -really big ones- are already playing in this market. In this article, I&#8217;m gonna show you how you can build your own synchronization service with PHP5.</p>
<p>Synchronization process with a mobile device works via an OMA -<em>Open Mobile Alliance</em>- standart, <strong>SyncML</strong>. SyncML -<em>Synchronization Markup Language</em>- defines a protocol to mobile client and synchronization server talk to each other. But if you want to speak SyncML you need to understand <strong>WBXML</strong> -<em>WAP Binary XML</em>- first. WBXML is a binary representation of XML. As SyncML, WBXML was developed by OMA for XML transmission between mobile client and synchronization server.</p>
<p>As you can see, we&#8217;re going to handle and parse WBXML contents. So, let&#8217;s get ready our development environment:</p>
<blockquote><p># apt-get install php5 php5-dev php-pear libwbxml2-0 libwbxml2-0-dev libwbxml2-0-utils</p></blockquote>
<p>All these modules will be required to run next command:</p>
<blockquote><p># pecl install WBXML</p></blockquote>
<p>When you install this PECL extension correctly you will be able to call wbxml to xml methods. Thus, you will be able to parse synchronization data with your PHP script.</p>
<p>Now you can design your own application to synchronize mobile devices with your synchronization server.</p>
]]></content:encoded>
			<wfw:commentRss>http://phpist.net/2008/12/20/mobile-data-synchronization/feed/</wfw:commentRss>
		</item>
		<item>
		<title>sfPropelPager has a problem with Group By</title>
		<link>http://phpist.net/2008/12/17/sfpropelpager-has-a-problem-with-group-by/</link>
		<comments>http://phpist.net/2008/12/17/sfpropelpager-has-a-problem-with-group-by/#comments</comments>
		<pubDate>Wed, 17 Dec 2008 20:01:33 +0000</pubDate>
		<dc:creator>Umut AYDIN</dc:creator>
		
		<category><![CDATA[Development]]></category>

		<category><![CDATA[Framework]]></category>

		<category><![CDATA[Global]]></category>

		<category><![CDATA[PHP5]]></category>

		<category><![CDATA[Symfony]]></category>

		<guid isPermaLink="false">http://phpist.net/?p=86</guid>
		<description><![CDATA[In Symfony Framework, there is a pagination class written for Propel Database Abstraction Library: sfPropelPager.
Generally, that class works fine but unfortunately, there will be a serious problem when you call addGroupByColumn method by the Criteria which is passed to sfPropelPager class. As you can see, there won&#8217;t be Group By part in count statement anyway. [...]]]></description>
			<content:encoded><![CDATA[<p>In <a href="http://www.symfony-project.org">Symfony Framework</a>, there is a pagination class written for <a href="http://propel.phpdb.org/">Propel</a> Database Abstraction Library: <em>sfPropelPager</em>.</p>
<p>Generally, that class works fine but unfortunately, there will be a serious problem when you call <em>addGroupByColumn</em> method by the <em>Criteria</em> which is passed to sfPropelPager class. As you can see, there won&#8217;t be <em>Group By</em> part in count statement anyway. Thus, results and pages will never be matched.</p>
]]></content:encoded>
			<wfw:commentRss>http://phpist.net/2008/12/17/sfpropelpager-has-a-problem-with-group-by/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Script for Altering Charset of a MySQL Database</title>
		<link>http://phpist.net/2008/12/11/script-for-altering-charset-of-a-mysql-database/</link>
		<comments>http://phpist.net/2008/12/11/script-for-altering-charset-of-a-mysql-database/#comments</comments>
		<pubDate>Thu, 11 Dec 2008 11:14:47 +0000</pubDate>
		<dc:creator>Umut AYDIN</dc:creator>
		
		<category><![CDATA[Development]]></category>

		<category><![CDATA[Global]]></category>

		<category><![CDATA[MySQL]]></category>

		<category><![CDATA[PHP5]]></category>

		<guid isPermaLink="false">http://phpist.net/?p=78</guid>
		<description><![CDATA[/**
* DB Connection
* &#8230;
*/
$result = mysql_query(&#8221;SHOW TABLES;&#8221;);
$rows = mysql_num_rows($result);
if ($rows) {
while ($item = mysql_fetch_array($result)) {
mysql_query(&#8221;ALTER TABLE {$item[0]} DEFAULT CHARACTER SET utf8 COLLATE utf8_turkish_ci&#8221;);
$sub = mysql_query(&#8221;SHOW FIELDS IN {$item[0]}&#8221;);
$nums = mysql_num_rows($sub);
if ($nums) {
while ($field = mysql_fetch_array($sub)) {
if (substr_count($field['Type'], &#8216;char&#8217;) or substr_count($field['Type'], &#8216;enum&#8217;)) {
if (trim($field['Null']) == &#8216;YES&#8217;) $nn = null;
else $nn = &#8220;NOT NULL&#8221;;
if (trim($field['Default'])) $df = [...]]]></description>
			<content:encoded><![CDATA[<blockquote><p>/**<br />
* DB Connection<br />
* &#8230;<br />
*/</p>
<p>$result = mysql_query(&#8221;SHOW TABLES;&#8221;);<br />
$rows = mysql_num_rows($result);<br />
if ($rows) {<br />
while ($item = mysql_fetch_array($result)) {<br />
mysql_query(&#8221;ALTER TABLE {$item[0]} DEFAULT CHARACTER SET utf8 COLLATE utf8_turkish_ci&#8221;);<br />
$sub = mysql_query(&#8221;SHOW FIELDS IN {$item[0]}&#8221;);<br />
$nums = mysql_num_rows($sub);<br />
if ($nums) {<br />
while ($field = mysql_fetch_array($sub)) {<br />
if (substr_count($field['Type'], &#8216;char&#8217;) or substr_count($field['Type'], &#8216;enum&#8217;)) {<br />
if (trim($field['Null']) == &#8216;YES&#8217;) $nn = null;<br />
else $nn = &#8220;NOT NULL&#8221;;</p>
<p>if (trim($field['Default'])) $df = &#8216;DEFAULT = &#8216; . $field['Default'];<br />
else $df = null;</p>
<p>mysql_query(&#8221;ALTER TABLE $item[0] CHANGE {$field['Field']} {$field['Field']} {$field['Type']} $df CHARACTER SET utf8 COLLATE utf8_turkish_ci $nn&#8221;);<br />
} } } } }</p></blockquote>
<p><strong>Note:</strong> <em>You may need some modifications. Please check the code right before you run it!</em></p>
]]></content:encoded>
			<wfw:commentRss>http://phpist.net/2008/12/11/script-for-altering-charset-of-a-mysql-database/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Common Problems in Planning a Project</title>
		<link>http://phpist.net/2008/12/07/common-problems-in-planning-a-project/</link>
		<comments>http://phpist.net/2008/12/07/common-problems-in-planning-a-project/#comments</comments>
		<pubDate>Sun, 07 Dec 2008 00:20:18 +0000</pubDate>
		<dc:creator>Umut AYDIN</dc:creator>
		
		<category><![CDATA[Development]]></category>

		<category><![CDATA[Global]]></category>

		<category><![CDATA[Project Management]]></category>

		<guid isPermaLink="false">http://phpist.net/?p=73</guid>
		<description><![CDATA[Main purpose of software projects is that making useful, user-friendly and qualified solutions for customers. According to market research companies, many of software projects can&#8217;t see the end of river. There are 5 important truths that I&#8217;m gonna say about that kind of projects.

First analysis and report part takes long time more than necessary. Analysis [...]]]></description>
			<content:encoded><![CDATA[<p>Main purpose of software projects is that making useful, user-friendly and qualified solutions for customers. According to market research companies, many of software projects can&#8217;t see the end of river. There are 5 important truths that I&#8217;m gonna say about that kind of projects.</p>
<ul>
<li>First analysis and report part takes long time more than necessary. Analysis or reporting team confuses by the details.</li>
<li>Because of first approach, development team needs more time to work productive. That means there will be useless period of time.</li>
<li>Many times, a request which is asking in during development part changes existed modules. Thus the project gets more risky. Realizing problems take long time.</li>
<li>After all these situations, team gets away from first analysis of the project. They work overtime to catch the plan or they redesign the project. First way makes team exhausted day by day and the second way takes long time. Both are wasting time.</li>
<li>While team deciding to budget, they don&#8217;t think about extras or requests. Thus project needs to more money eventually.</li>
</ul>
<p>Keep those things in your mind.</p>
]]></content:encoded>
			<wfw:commentRss>http://phpist.net/2008/12/07/common-problems-in-planning-a-project/feed/</wfw:commentRss>
		</item>
	</channel>
</rss>
