<?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>Web Developer Blog</title>
	<atom:link href="http://blog.my-helper.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.my-helper.com</link>
	<description>A helpful guide to all web developers.</description>
	<lastBuildDate>Sat, 12 May 2012 06:47:51 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.6</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Setup VirtualHost on Nginx</title>
		<link>http://blog.my-helper.com/nginx/setup-virtualhost-on-nginx/</link>
		<comments>http://blog.my-helper.com/nginx/setup-virtualhost-on-nginx/#comments</comments>
		<pubDate>Sat, 12 May 2012 06:45:52 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Nginx]]></category>

		<guid isPermaLink="false">http://blog.my-helper.com/?p=558</guid>
		<description><![CDATA[vim /etc/nginx/conf.d/virutal.conf
server {
listen 80;
server_name my-helper.com;
rewrite ^/(.*) http://www.my-helper.com/$1 permanent;
}
server {
listen 80;
server_name www.my-helper.com;
access_log /var/www/vhosts/my-helper.com/logs/access.log;
error_log /var/www/vhosts/my-helper.com/logs/error.log;
location / {
root	/var/www/vhosts/my-helper.com/htdocs/;
index	index.php;
}
}
Reference:
 http://articles.slicehost.com/2009/2/25/centos-nginx-virtual-hosts
]]></description>
		<wfw:commentRss>http://blog.my-helper.com/nginx/setup-virtualhost-on-nginx/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Install Nginx</title>
		<link>http://blog.my-helper.com/nginx/install-nginx/</link>
		<comments>http://blog.my-helper.com/nginx/install-nginx/#comments</comments>
		<pubDate>Sat, 12 May 2012 04:02:09 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Nginx]]></category>

		<guid isPermaLink="false">http://blog.my-helper.com/?p=555</guid>
		<description><![CDATA[1. Enable EPEL repo (ref: http://www.cyberciti.biz/faq/rhel-fedora-centos-linux-enable-epel-repo/)
rpm -Uvh http://download.fedoraproject.org/pub/epel/6/i386/epel-release-6-6.noarch.rpm
2. Install nginx
yum install nginx
3. Start nginx
/etc/init.d/nginx
Reference:
 http://www.ibualoy.net/blog/itech/linux/167-how-to-configure-nginx-and-apache-on-debian
 http://articles.slicehost.com/2008/12/17/centos-installing-nginx-via-yum
 http://www.cyberciti.biz/faq/rhel-fedora-install-configure-nginx-php5/
]]></description>
		<wfw:commentRss>http://blog.my-helper.com/nginx/install-nginx/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Configure Network Interface Card on CentOS</title>
		<link>http://blog.my-helper.com/centos/configure-network-interface-card-on-centos/</link>
		<comments>http://blog.my-helper.com/centos/configure-network-interface-card-on-centos/#comments</comments>
		<pubDate>Sat, 12 May 2012 01:26:15 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[CentOS]]></category>

		<guid isPermaLink="false">http://blog.my-helper.com/?p=549</guid>
		<description><![CDATA[DHCP:

vim /etc/sysconfig/network-scripts/ifcfg-eth0
BOOTPROTO=dhcp
ONBOOT=yes


/etc/init.d/network restart

Static IP:

vim /etc/sysconfig/network-scripts/ifcfg-eth0
BOOTPROTO=none
ONBOOT=yes
IPADDR=192.168.1.10
NETWORK=192.168.1.0
NETMASK=255.255.255.0
GATEWAY=192.168.1.1


/etc/init.d/network restart

]]></description>
		<wfw:commentRss>http://blog.my-helper.com/centos/configure-network-interface-card-on-centos/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Web Server Root Directory</title>
		<link>http://blog.my-helper.com/mac/web-server-root-directory/</link>
		<comments>http://blog.my-helper.com/mac/web-server-root-directory/#comments</comments>
		<pubDate>Wed, 09 May 2012 08:03:32 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Mac]]></category>

		<guid isPermaLink="false">http://blog.my-helper.com/?p=547</guid>
		<description><![CDATA[/Library/WebServer/Documents/
]]></description>
		<wfw:commentRss>http://blog.my-helper.com/mac/web-server-root-directory/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Install VLD</title>
		<link>http://blog.my-helper.com/php/install-vld/</link>
		<comments>http://blog.my-helper.com/php/install-vld/#comments</comments>
		<pubDate>Wed, 02 May 2012 04:43:33 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://blog.my-helper.com/?p=544</guid>
		<description><![CDATA[Install VLD
wget http://pecl.php.net/get/vld
tar xzf vld-0.11.1.tgz
cd vld-0.11.1
phpize
./configure
make install
Enable VLD
vim /etc/php.ini
extension=vld.so
Use VLD

php -dvld.active=1 test.php
php -dvld.active=1 -dvld.verbosity=3 test.php

]]></description>
		<wfw:commentRss>http://blog.my-helper.com/php/install-vld/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Performance of fgets()</title>
		<link>http://blog.my-helper.com/php/performance-of-fgets/</link>
		<comments>http://blog.my-helper.com/php/performance-of-fgets/#comments</comments>
		<pubDate>Sat, 28 Apr 2012 13:05:37 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://blog.my-helper.com/?p=538</guid>
		<description><![CDATA[If the content of a file is long, the performance of fgets() will be poor. Let's see this example:

$ts = microtime(true);
$fh = fopen('input.in', 'r');
for ($i = 0; $i < 100000; $i++) fgets($fh, 1000000);
printf("%.4f\n", microtime(true) - $ts);

Result:

8.4704

To improve the performance, we can use file_get_contents() instead.

$ts = microtime(true);
$lines = explode("\n", file_get_contents('input.in'));
printf("%.4f\n", microtime(true) - $ts);

Result:

0.0495

]]></description>
		<wfw:commentRss>http://blog.my-helper.com/php/performance-of-fgets/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Performance of array_shift()</title>
		<link>http://blog.my-helper.com/php/performance-of-array_shift/</link>
		<comments>http://blog.my-helper.com/php/performance-of-array_shift/#comments</comments>
		<pubDate>Sat, 28 Apr 2012 08:26:30 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://blog.my-helper.com/?p=531</guid>
		<description><![CDATA[When the array size is large, the performance of array_shift() will become poor. Let's see the following example:

$a = range(0, 100000);
$ts = microtime(true);
for ($i=0; $i]]></description>
		<wfw:commentRss>http://blog.my-helper.com/php/performance-of-array_shift/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Install Second Version of PHP on Plesk</title>
		<link>http://blog.my-helper.com/plesk/install-second-version-of-php-on-plesk/</link>
		<comments>http://blog.my-helper.com/plesk/install-second-version-of-php-on-plesk/#comments</comments>
		<pubDate>Mon, 23 Apr 2012 09:56:09 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Plesk]]></category>

		<guid isPermaLink="false">http://blog.my-helper.com/?p=521</guid>
		<description><![CDATA[1. Download php from http://www.php.net/releases/
2. Unpack the tarball to your home directory
tar -xjf php-5.2.10.tar.bz2
3. Get module list
php -m &#124; grep -v -e Modules] -e ^$ > php-default-modules
4. Create a configure script
for i in $(cat php-default-modules); do echo -n "--with-$i ">> phpconfigure.sh ;done
5. Edit phpconfigure.sh and insert these 2 lines to the beginning of the file
#!/bin/bash
./configure
6. [...]]]></description>
		<wfw:commentRss>http://blog.my-helper.com/plesk/install-second-version-of-php-on-plesk/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Improve Performance of in_array()</title>
		<link>http://blog.my-helper.com/php/improve-performance-of-in_array/</link>
		<comments>http://blog.my-helper.com/php/improve-performance-of-in_array/#comments</comments>
		<pubDate>Sat, 21 Apr 2012 11:20:45 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://blog.my-helper.com/?p=517</guid>
		<description><![CDATA[When the array size is large, performance of the built-in function in_array() will be extremely poor. To solve this problem, we can implement a custom in_array() function using hash maps. Here is the source code:

$map = array();
foreach($a as $val) $map[$val] = 1;
function better_in_array($needle, $map) {
return isset($map[$needle]);
}

Let's compare the performance now:

$a = array();
for ($i=0; $i]]></description>
		<wfw:commentRss>http://blog.my-helper.com/php/improve-performance-of-in_array/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>WARNING: You are using obsolete option, use corresponding option of httpdmng.</title>
		<link>http://blog.my-helper.com/plesk/warning-you-are-using-obsolete-option-use-corresponding-option-of-httpdmng/</link>
		<comments>http://blog.my-helper.com/plesk/warning-you-are-using-obsolete-option-use-corresponding-option-of-httpdmng/#comments</comments>
		<pubDate>Thu, 19 Apr 2012 09:27:08 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Plesk]]></category>

		<guid isPermaLink="false">http://blog.my-helper.com/?p=513</guid>
		<description><![CDATA[If you get the error "WARNING: You are using obsolete option, use corresponding option of httpdmng." when you run this command:
/usr/local/psa/admin/sbin/websrvmng --reconfigure-vhost --vhost-name=domain.com
you should use the following command instead:
/usr/local/psa/admin/bin/httpdmng --reconfigure-domain domain.com
]]></description>
		<wfw:commentRss>http://blog.my-helper.com/plesk/warning-you-are-using-obsolete-option-use-corresponding-option-of-httpdmng/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

