<?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>Linux, Open Source and Web 2.0 &#187; php</title>
	<atom:link href="http://www.itecsoftware.com/tag/php/feed" rel="self" type="application/rss+xml" />
	<link>http://www.itecsoftware.com</link>
	<description>Itec Software</description>
	<lastBuildDate>Sun, 13 May 2012 19:34:51 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.1.3</generator>
<xhtml:meta xmlns:xhtml="http://www.w3.org/1999/xhtml" name="robots" content="noindex" />
		<item>
		<title>Using Regular Expression In PHP &#8211; The Basics</title>
		<link>http://www.itecsoftware.com/using-regular-expression-in-php-the-basics?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=using-regular-expression-in-php-the-basics</link>
		<comments>http://www.itecsoftware.com/using-regular-expression-in-php-the-basics#comments</comments>
		<pubDate>Wed, 25 Aug 2010 20:03:56 +0000</pubDate>
		<dc:creator>Peter</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Web Development]]></category>
		<category><![CDATA[pcre]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[posix]]></category>
		<category><![CDATA[regular expression]]></category>

		<guid isPermaLink="false">http://articles.itecsoftware.com/?p=495</guid>
		<description><![CDATA[<a href="http://www.itecsoftware.com/using-regular-expression-in-php-the-basics" title="Using Regular Expression In PHP - The Basics"></a>Regular expressions are a powerful tool for finding, examining and/or modifying text. Regular expressions themselves are, with a general pattern notation almost like a mini programming language, allowing you to define and parse text. They enable you to search for &#8230;<p class="read-more"><a href="http://www.itecsoftware.com/using-regular-expression-in-php-the-basics">Read more &#187;</a></p>]]></description>
			<content:encoded><![CDATA[<a href="http://www.itecsoftware.com/using-regular-expression-in-php-the-basics" title="Using Regular Expression In PHP - The Basics"></a><!-- google_ad_section_start --><p><a href="http://www.amazon.com/gp/product/0596520689?ie=UTF8&#038;tag=cudandsnu-20&#038;linkCode=as2&#038;camp=1789&#038;creative=390957&#038;creativeASIN=0596520689" target="_new"><img class="alignleft size-full wp-image-531" title="regular-expressions-cookbook" src="http://www.itecsoftware.com/wp-content/uploads/2010/08/regular-expressions-cookbook.jpg" alt="regular expressions cookbook" width="122" height="160" /></a>Regular expressions are a powerful tool for finding, examining and/or modifying text. Regular expressions themselves are, with a general pattern notation almost like a mini programming language, allowing you to define and parse text. They enable you to search for patterns within a string, extracting matches flexible and precise. However, you should note that because regular expressions are more powerful, they also suffer from added overhead and are slower than the more basic string functions. You should make careful consideration and only use regular expressions if you have a particular need.</p>
<p>PHP supports two different types of regular expressions: POSIX-extended and Perl-Compatible Regular Expressions (PCRE). The PCRE functions are more commonly used, are more powerful than the POSIX ones and faster as well</p>
<p>In a regular expression, most characters match only themselves. For instance, if you search for the regular expression &#8220;foo&#8221; in the string &#8220;only a fool does not use regular expressions&#8221; you get a match because &#8220;foo&#8221; occurs in that string. Some characters have a special meaning. For instance, the dollar sign ($) is used to match strings that end with the given pattern. Similarly, a caret (^) character at the beginning of a regular expression indicates that it must match the beginning of the string. Characters that match themselves are called literals while characters that have special meanings are called metacharacters.<span id="more-495"></span></p>
<p>The dot (.) metacharacter matches any single character except newline (\). Hence, the pattern h.t matches hat, hothit, hut and h7t. The vertical pipe (|) metacharacter is used for alternatives in a regular expression. It behaves much like a logical OR operator and you should use it if you want to construct a pattern that matches more than one set of characters. For instance, the pattern Monday|Tuesday|Wednesday matches strings that contain &#8220;Monday&#8221; or &#8220;Tuesday&#8221; or &#8220;Wednesday&#8221;. Parentheses are used to group sequences. For example, (fri|satur)day matches &#8220;friday&#8221; or &#8220;saturday&#8221;. Using parentheses to group characters for alternation is called grouping.</p>
<p>If we want to match a literal metacharacter in a pattern, we have to escape it with a backslash.</p>
<p>To specify a set of acceptable characters in a pattern, we can either build a character class ourself, or use a predefined one. A character class lets us represent a bunch of characters as a single item. We can build our own character class by enclosing the acceptable characters in square brackets. A character class matches any one of the characters in the class. For example a character class [abc] matches a, b or c. To define a range of characters, we just add the first and last characters separated by hyphen. For example, to match all alphanumeric characters: [a-zA-Z0-9]. We can also create a negated character class, which matches any character that is not in the class. To create a negated character class, we start the character class with ^: [^0-9].</p>
<p>Metacharacters +, *, ?, and {} affect the number of times a pattern should be matched. + means &#8220;Match one or more of the preceding expression&#8221;, * means &#8220;Match zero or more of the preceding expression&#8221;, and ? means &#8220;Match zero or one of the preceding expression&#8221;. Curly braces {} are be used differently. With a single integer, {n} means &#8220;match exactly n occurrences of the preceding expression&#8221;, with one integer and a comma, {n,} means &#8220;match n or more occurrences of the preceding expression&#8221;, and with two comma-separated integers {n,m} means &#8220;match the previous character if it occurs at least n times, but no more than m times&#8221;.</p>
<!-- google_ad_section_end -->]]></content:encoded>
			<wfw:commentRss>http://www.itecsoftware.com/using-regular-expression-in-php-the-basics/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Hot To Install Memcache And PHP Client On Mac Snow Leopard</title>
		<link>http://www.itecsoftware.com/hot-to-install-memcache-and-php-client-on-mac-snow-leopard?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=hot-to-install-memcache-and-php-client-on-mac-snow-leopard</link>
		<comments>http://www.itecsoftware.com/hot-to-install-memcache-and-php-client-on-mac-snow-leopard#comments</comments>
		<pubDate>Mon, 08 Feb 2010 23:59:32 +0000</pubDate>
		<dc:creator>Peter</dc:creator>
				<category><![CDATA[Mac]]></category>
		<category><![CDATA[Web Development]]></category>
		<category><![CDATA[apache]]></category>
		<category><![CDATA[memcache]]></category>
		<category><![CDATA[memcached]]></category>
		<category><![CDATA[PECL]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[php5-memache]]></category>

		<guid isPermaLink="false">http://articles.itecsoftware.com/?p=346</guid>
		<description><![CDATA[<a href="http://www.itecsoftware.com/hot-to-install-memcache-and-php-client-on-mac-snow-leopard" title="Hot To Install Memcache And PHP Client On Mac Snow Leopard"></a>I recently installed the memcached daemon on my MacBook Pro, incuding the necessary PHP client for development purposes. I just prefer to work locally instead of using a VM running Linux. And the process is actually quite simple and straight &#8230;<p class="read-more"><a href="http://www.itecsoftware.com/hot-to-install-memcache-and-php-client-on-mac-snow-leopard">Read more &#187;</a></p>]]></description>
			<content:encoded><![CDATA[<a href="http://www.itecsoftware.com/hot-to-install-memcache-and-php-client-on-mac-snow-leopard" title="Hot To Install Memcache And PHP Client On Mac Snow Leopard"></a><!-- google_ad_section_start --><p>I recently installed the memcached daemon on my MacBook Pro, incuding the necessary PHP client for development purposes. I just prefer to work locally instead of using a VM running Linux. And the process is actually quite simple and straight forward. Please note, I have included both clients, the old standard one and the newer PECL extension, because I deal with different applications and also lots of people seems to get confused when they install one version and their memcache classes cannot get instantiated and throw errors. So, if in doubt, just install both.</p>
<p>These are the five (four if you know which extension you want) components needed:</p>
<p>- libevent (requred library for memcached)</p>
<p>- memcached daemon</p>
<p>- libmemcached (required library for the php client)</p>
<p>- php extension (standard)</p>
<p>- php extension (PECL)</p>
<p>Now open your terminal and off we go:<span id="more-346"></span></p>
<p><em> Note: if you don&#8217;t want to install wget, you can alternatively use &#8220;curl -O&#8221;)</em></p>
<p><span style="color: #008000;"><strong><span style="color: #000000;">Installing libevent:</span></strong></span><br />
<span style="color: #008000;"><br />
$ cd /tmp<br />
$ wget http://www.monkey.org/~provos/libevent-1.4.13-stable.tar.gz (if you&#8217;re brave, you can try the 2.0 beta)<br />
$ tar zxvf libevent-1.4.13-stable.tar.gz<br />
$ ./configure<br />
$ make<br />
$ sudo make install</span></p>
<p><span style="color: #008000;"><strong><span style="color: #000000;">Installing memcached:</span></strong></span></p>
<p><span style="color: #008000;">$ wget http://memcached.googlecode.com/files/memcached-1.4.1.tar.gz<br />
$ tar xzvf memcached-1.4.1.tar.gz<br />
$ cd memcached-1.4.1<br />
$ ./configure<br />
$ make<br />
$ make test<br />
$ sudo make install</span><br />
<span style="color: #008000;">$ memcached -d -P pidfile -l 127.0.0.1</span> (this will start the memcached daemon)<br />
<span style="color: #008000;">$ ps aux | grep &#8216;memcached&#8217; <span style="color: #000000;">(this should confirm that memcached is running and how much memory is assigned to it)</span></span></p>
<p><strong><span style="color: #008000;"><span style="color: #000000;">Installing libmemcached:</span></span></strong></p>
<p><span style="color: #008000;">$ wget http://launchpad.net/libmemcached/1.0/0.34/+download/libmemcached-0.34.tar.gz<br />
$ tar -zxvf libmemcached-0.34.tar.gz<br />
$ cd libmemcached-0.34<br />
$ ./configure<br />
$ make<br />
$ sudo make install</span></p>
<p><strong><span style="color: #000000;">Installing PECL memcache extension:</span></strong></p>
<p><span style="color: #008000;">$ cd /tmp<br />
$ pecl download memcached<br />
$ tar xzvf memcached-1.0.0.tgz<br />
$ cd memcached-1.0.0<br />
$ phpize<br />
$ ./configure<br />
$ make<br />
$ sudo make install</span></p>
<p><strong><span style="color: #000000;">Installing PHP memcache extension:</span></strong></p>
<p><span style="color: #008000;">$ cd /tmp<br />
$ wget http://pecl.php.net/get/memcache-2.2.4.tgz<br />
$ tar -zxvf memcache-2.2.4.tgz<br />
$ cd memcache-2.2.4<br />
$ phpize &amp;&amp;<br />
$ ./configure<br />
$ make<br />
$ sudo make install</span></p>
<p>Once all the steps are completed successfully, ensure that the extension directory is specified as the same as the output of the terminal after the extensions installed. Otherwise correct in php.ini.</p>
<p>Also add the line(s) to load the extension(s) in the php.ini file, in the extension section:</p>
<p>extension=memcached.so<br />
extension=memcache.so</p>
<p>And finally restart apache:<br />
<span style="color: #008000;">$ sudo apachectl restart</span></p>
<p>And verify in phpinfo that memcache(d) is loaded and working.</p>
<!-- google_ad_section_end -->]]></content:encoded>
			<wfw:commentRss>http://www.itecsoftware.com/hot-to-install-memcache-and-php-client-on-mac-snow-leopard/feed</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>How To Add PHP Mcrypt Module On Snow Leopard 10.6</title>
		<link>http://www.itecsoftware.com/how-to-add-php-mcrypt-module-on-snow-leopard-10-6?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=how-to-add-php-mcrypt-module-on-snow-leopard-10-6</link>
		<comments>http://www.itecsoftware.com/how-to-add-php-mcrypt-module-on-snow-leopard-10-6#comments</comments>
		<pubDate>Tue, 03 Nov 2009 20:39:47 +0000</pubDate>
		<dc:creator>Peter</dc:creator>
				<category><![CDATA[Mac]]></category>
		<category><![CDATA[Web Development]]></category>
		<category><![CDATA[apache]]></category>
		<category><![CDATA[mcrypt]]></category>
		<category><![CDATA[php]]></category>

		<guid isPermaLink="false">http://articles.itecsoftware.com/?p=322</guid>
		<description><![CDATA[<a href="http://www.itecsoftware.com/how-to-add-php-mcrypt-module-on-snow-leopard-10-6" title="How To Add PHP Mcrypt Module On Snow Leopard 10.6"></a>These instructions assume that you have a working Apache 2.2 / PHP 5.3 in place and want to add the php mcrypt module. It will work as a fresh install, but keep in mind that additional configuration steps after these &#8230;<p class="read-more"><a href="http://www.itecsoftware.com/how-to-add-php-mcrypt-module-on-snow-leopard-10-6">Read more &#187;</a></p>]]></description>
			<content:encoded><![CDATA[<a href="http://www.itecsoftware.com/how-to-add-php-mcrypt-module-on-snow-leopard-10-6" title="How To Add PHP Mcrypt Module On Snow Leopard 10.6"></a><!-- google_ad_section_start --><p>These instructions assume that you have a working Apache 2.2 / PHP 5.3 in place and want to add the php mcrypt module. It will work as a fresh install, but keep in mind that additional configuration steps after these instructions are necessary to get your webserver working properly. Those additional steps are omitted here, as there are countless resources available on the Internet.</p>
<p>1. If you don&#8217;t already have the mcrypt module (in /usr/lib), d<span style="background-color: #ffffff;">ownload the <span style="text-decoration: underline;">libmcrypt</span> source code from sourceforge <a href="http://sourceforge.net/projects/mcrypt/files/Libmcrypt/" target="_blank">here</a>. Then extract the downloaded file in a Terminal and move inside the created directory. (cd libmcrypt-2.5.8 in my case)</span></p>
<p>2. Execute the following lines in one command in your Terminal, if you have a 64bit version of Apache/PHP:</p>
<p><span style="color: #003300;"><em><span style="color: #008000;">CFLAGS=&#8221;-arch x86_64&#8243; \<br />
CXXFLAGS=&#8221;-arch x86_64&#8243; \<br />
./configure &#8211;disable-posix-threads</span></em></span></p>
<p>(for 32 bit versions: ./configure &#8211;disable-posix-threads)</p>
<p><span id="more-322"></span></p>
<p>2. In your Terminal, run:</p>
<p><span style="color: #003300;"><em><span style="color: #008000;">make</span></em></span></p>
<p>3. If no errors, in your Terminal run:</p>
<p><span style="color: #003300;"><em><span style="color: #008000;">sudo make install</span></em></span></p>
<p>4. Download the PHP source code from PHP&#8217;s website <a href="http://www.php.net/downloads.php#v5" target="_blank">here</a>. Extract in a Terminal and move into the extracted directory.</p>
<p>5. In your Terminal, run the following lines in one command:</p>
<p><span style="color: #003300;"><em><span style="color: #008000;">export MACOSX_DEPLOYMENT_TARGET=10.6 \<br />
CFLAGS=&#8221;-arch x86_64&#8243; \<br />
CXXFLAGS=&#8221;-arch x86_64&#8243;</span></em></span></p>
<p><span style="color: #003300;"><em><span style="color: #008000;"><br />
./configure &#8211;prefix=/usr/local/php5<br />
&#8211;mandir=/usr/share/man<br />
&#8211;infodir=/usr/share/info<br />
&#8211;sysconfdir=/etc \<br />
&#8211;with-config-file-path=/etc \<br />
&#8211;with-zlib \<br />
&#8211;with-zlib-dir=/usr \<br />
&#8211;with-openssl \<br />
&#8211;with-iconv=/usr \<br />
&#8211;enable-exif \<br />
&#8211;enable-ftp \<br />
&#8211;enable-mbstring \<br />
&#8211;enable-mbregex \<br />
&#8211;with-mcrypt \<br />
&#8211;enable-sockets \<br />
&#8211;with-mysql=/usr/local/mysql \<br />
&#8211;with-pdo-mysql=/usr/local/mysql \<br />
&#8211;with-mysqli=/usr/local/mysql/bin/mysql_config \<br />
&#8211;with-apxs2=/usr/sbin/apxs</span></em></span></p>
<p>6. Correct a bug in Makefile.</p>
<p>As a result of a bug in PHP 5.2.9 and 5.3.0, we&#8217;ll need to correct the file <span style="text-decoration: underline;">Makefile</span> generated by the configure phase. Let&#8217;s add ‘-lresolv‘ at the end of the line that begins with ‘EXTRA_LIBS‘. Leave a space and add it like &#8221; &#8230;   -lz -licucore -lm -lresolv to whatever is there already. Do not alter the exiting text, simply add it.</p>
<p>7. In your Terminal, run:</p>
<p><span style="color: #003300;"><em><span style="color: #008000;">make</span></em></span></p>
<p>8. If no errors, run:</p>
<p><span style="color: #003300;"><em><span style="color: #008000;">sudo make install</span></em></span></p>
<p>At this point, restart apache and check your configuration with phpinfo(). Look for mcrypt as it should appear as an enabled module.</p>
<!-- google_ad_section_end -->]]></content:encoded>
			<wfw:commentRss>http://www.itecsoftware.com/how-to-add-php-mcrypt-module-on-snow-leopard-10-6/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to install MySQL Server, PHP and Apache on a Mac</title>
		<link>http://www.itecsoftware.com/how-to-install-mysql-server-php-and-apache-on-a-mac?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=how-to-install-mysql-server-php-and-apache-on-a-mac</link>
		<comments>http://www.itecsoftware.com/how-to-install-mysql-server-php-and-apache-on-a-mac#comments</comments>
		<pubDate>Sat, 24 Oct 2009 19:39:50 +0000</pubDate>
		<dc:creator>Peter</dc:creator>
				<category><![CDATA[Mac]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[Web Development]]></category>
		<category><![CDATA[apache]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[Snow Leopard]]></category>

		<guid isPermaLink="false">http://articles.itecsoftware.com/?p=301</guid>
		<description><![CDATA[<a href="http://www.itecsoftware.com/how-to-install-mysql-server-php-and-apache-on-a-mac" title="How to install MySQL Server, PHP and Apache on a Mac"></a>These instructions lead you thru the installation of the latest LAMP Stack on MacOS X Snow Leopard. 1 &#8211; Download the installation image from MySQL website here. Then double-click to mount and open the disk image. 2 &#8211; Install MySQL &#8230;<p class="read-more"><a href="http://www.itecsoftware.com/how-to-install-mysql-server-php-and-apache-on-a-mac">Read more &#187;</a></p>]]></description>
			<content:encoded><![CDATA[<a href="http://www.itecsoftware.com/how-to-install-mysql-server-php-and-apache-on-a-mac" title="How to install MySQL Server, PHP and Apache on a Mac"></a><!-- google_ad_section_start --><p>These instructions lead you thru the installation of the latest LAMP Stack on MacOS X Snow Leopard.</p>
<p>1 &#8211; Download the installation image from MySQL website <a href="http://dev.mysql.com/downloads/mysql/5.1.html#macosx-dmg" target="_blank">here</a>. Then double-click to mount and open the disk image.</p>
<p>2 &#8211; Install MySQL Server by double clicking the package &#8220;mysql-5.1.*****.pkg&#8221; and follow the menu, accepting the default values, unless you want to change something and know exactly what you&#8217;re doing.</p>
<p>3 &#8211; Install MySQL Startup Item by double-clicking the package &#8220;MySQLStartupitem.pkg&#8221; and follow the menu.</p>
<p>4 &#8211; Install MySQL Preference Pane by double-clicking the file &#8220;MySQL.prefPane&#8221; and follow the menu. This item will simplify the management of your SQL Server. You can now use the &#8220;System Preferences&#8221; panel to start and stop the database server.</p>
<p>5 &#8211; Enable the php module in your apache config file. You might know that Snow Leopard already ships with Apache 2.2 and PHP 5.3, but it needs a couple of tweaks to make it work smoothly. So, open /etc/apache2/httpd.conf and search for &#8220;php5_module&#8221;. Remove the comment (#) in front of the line, save and close the file, then restart apache (sudo apachectl restart)</p>
<p><span id="more-301"></span></p>
<p>6 &#8211; Testing Apache/PHP. Let&#8217;s create an info file so we know what we got. Navigate to /Library/WebServer/Documents and create a file called phpinfo.php. Put the following line into the file, save and close. &#8220;&lt;?php phpinfo(); ?&gt;&#8221;. Now open your favorite browser and hit it (http://localhost/phpinfo.php). You should see a page like the one below, which shows you configuration details, modules enabled and other useful information.</p>
<p><img class="size-medium wp-image-307  alignleft" style="margin: 10px;" title="php-info-page" src="http://www.itecsoftware.com/wp-content/uploads/2009/10/php-info-page-300x195.png" alt="PHP Info Page" width="300" height="195" /></p>
<p>7 &#8211; There is no php.ini out of the box (as you may have discovered by looking at the phpinfo page), but there is a sample file called &#8220;php.ini.default&#8221; which we&#8217;re going to use. Copy this file and save it as php.ini.</p>
<p>8 &#8211; Set the default time zone. As PHP 5.3 requires the timezone to be set, let&#8217;s do this inside php.ini, so we don&#8217;t have to worry about it anymore. You can always override it in your application&#8217;s bootstrap, if needed. Open /etc/php.ini and search for &#8220;[Date]&#8220;. Uncomment the line &#8220;date.timezone = &#8221; and add your timezone. Check the <a href="http://www.php.net/manual/en/timezones.php" target="_blank">php manual</a> for acceptable values. (example: date.timezone = &#8216;America/Los Angeles&#8217;)</p>
<p>And that&#8217;s it. You should now have a fully functional LAMP stack with Apache, PHP and MySQL server.</p>
<!-- google_ad_section_end -->]]></content:encoded>
			<wfw:commentRss>http://www.itecsoftware.com/how-to-install-mysql-server-php-and-apache-on-a-mac/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Install JSON PHP Extension on CentOs / RedHat</title>
		<link>http://www.itecsoftware.com/install-json-php-extension-on-centos-redhat?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=install-json-php-extension-on-centos-redhat</link>
		<comments>http://www.itecsoftware.com/install-json-php-extension-on-centos-redhat#comments</comments>
		<pubDate>Thu, 24 Sep 2009 00:15:05 +0000</pubDate>
		<dc:creator>Peter</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Web Development]]></category>
		<category><![CDATA[CentOS]]></category>
		<category><![CDATA[JSON]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[Redhat]]></category>

		<guid isPermaLink="false">http://articles.itecsoftware.com/?p=264</guid>
		<description><![CDATA[<a href="http://www.itecsoftware.com/install-json-php-extension-on-centos-redhat" title="Install JSON PHP Extension on CentOs / RedHat"></a>I had numerous requests for info and questions relating to JSON extension in CentOS. To enable these functions in RedHat and CentOs 5, the process is really simple and fast. NOTE: As of PHP 5.2, json extension is now standard. &#8230;<p class="read-more"><a href="http://www.itecsoftware.com/install-json-php-extension-on-centos-redhat">Read more &#187;</a></p>]]></description>
			<content:encoded><![CDATA[<a href="http://www.itecsoftware.com/install-json-php-extension-on-centos-redhat" title="Install JSON PHP Extension on CentOs / RedHat"></a><!-- google_ad_section_start --><p>I had numerous requests for info and questions relating to JSON extension in CentOS. To enable these functions in RedHat and CentOs 5, the process is really simple and fast.</p>
<p>NOTE: As of PHP 5.2, json extension is now standard. If you&#8217;re running PHP 5.2 or later, or like to upgrade instead, you can skip this!</p>
<ol>
<li>Ensure you have the necessary dependecies (php, php-pear, php-devel, gcc, make):
<ul>
<li><span style="color: #003300;">$ sudo yum install gcc make</span></li>
<li><span style="color: #003300;">$ sudo yum install php php-pear php-devel</span></li>
</ul>
</li>
<li>Use PECL (<strong>P</strong>HP <strong>E</strong>xtension <strong>C</strong>ommunity <strong>L</strong>ibrary) to download the json package:
<ul>
<li><span style="color: #003300;">$ sudo pecl download json</span></li>
</ul>
</li>
<li>Use PEAR (<strong>P</strong>HP <strong>E</strong>xtension and <strong>A</strong>pplication <strong>R</strong>epository) to extract and install the extension:
<ul>
<li><span style="color: #003300;">$ sudo pear install json-1.2.1.tgz</span></li>
</ul>
</li>
<li>Create a file in <code>/etc/php.d</code> called &#8220;json.ini&#8221;, and add the following lines:
<ul>
<li><span style="color: #003300;">; php-json extension</span></li>
<li> extension=json.so</li>
</ul>
</li>
<li>Restart apache (gracefully if you&#8217;re running a live site:
<ul>
<li><span style="color: #003300;">$ sudo service httpd restart (apachectl graceful)</span></li>
</ul>
</li>
<li>Check for availability by creating an info.php file in the web root with the following line:
<ul>
<li><span style="color: #003300;">&lt;?php phpinfo(); ?&gt;</span></li>
</ul>
</li>
<li>Load info.php in your browser and check for JSON. You now should be all set, but if it doesn&#8217;t appear, verify all of the above steps very carefully.</li>
</ol>
<!-- google_ad_section_end -->]]></content:encoded>
			<wfw:commentRss>http://www.itecsoftware.com/install-json-php-extension-on-centos-redhat/feed</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Nginx and memcached module</title>
		<link>http://www.itecsoftware.com/nginx-and-memcached-module?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=nginx-and-memcached-module</link>
		<comments>http://www.itecsoftware.com/nginx-and-memcached-module#comments</comments>
		<pubDate>Fri, 17 Jul 2009 20:31:35 +0000</pubDate>
		<dc:creator>Peter</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[SEO]]></category>
		<category><![CDATA[Shell Scripting]]></category>
		<category><![CDATA[Useful Stuff]]></category>
		<category><![CDATA[Web Development]]></category>
		<category><![CDATA[apache]]></category>
		<category><![CDATA[memcache]]></category>
		<category><![CDATA[nginx]]></category>
		<category><![CDATA[php]]></category>

		<guid isPermaLink="false">http://articles.itecsoftware.com/?p=148</guid>
		<description><![CDATA[With nginx memcache module, we serve more pages faster with less hardware. It's a nobrainer.<p class="read-more"><a href="http://www.itecsoftware.com/nginx-and-memcached-module">Read more &#187;</a></p>]]></description>
			<content:encoded><![CDATA[<a href="http://www.itecsoftware.com/nginx-and-memcached-module" title="Nginx and memcached module"></a><!-- google_ad_section_start --><p><a rel="nofollow" href="http://www.danga.com/memcached/" target="_blank">Memcache</a> is traditionally used as a module inside server side scripts, such as <a rel="nofollow" href="http://www.php.net" target="_blank">PHP</a>, ASP, ColdFusion and others. And it&#8217;s doing a terrific job, as long as it&#8217;s implemented correctly.</p>
<p>But if we look under the hood of the actual <a rel="nofollow" href="http://www.danga.com/memcached/" target="_blank">Memcache</a> application, and I&#8217;m not talking about the PHP or ASP extension, but rather the executable that&#8217;s running as a daemon under linux, for example, it is a rather simple database like application running in memory. Now there are two basic actions that need to be performed to use it, one is writing info into memcache, the other is reading it. In a typical scenario, there are many reads for one write, that&#8217;s the whole point, isn&#8217;t it. But what if we can isolate the reading from the server side scripts, and let a small high speed module do that for us.</p>
<p><span id="more-148"></span></p>
<p>That&#8217;s where <a rel="nofollow" href="http://nginx.net/" target="_blank">Nginx</a> and it&#8217;s <a rel="nofollow" href="http://wiki.nginx.org/NginxHttpMemcachedModule" target="_blank">Memcache Module</a> comes in. We use PHP to fill up the cache and then let Nginx serve that content to the requesting client. According to lead architect Peter Gilg, this configuration is used at <a rel="nofollow" href="http://www.mademan.com/" target="_blank">Mademan.com</a>, a lifestyle site serving up to 1 million pageviews/day.</p>
<p>To be more specific, we&#8217;ll have nginx listen on port 80. If a request comes in, it checks memcache if the requested page is in memory and serves it directly to the client, or sends it to <a rel="nofollow" href="http://apache.org/" target="_blank">Apache</a> (on port 88 for example) to produce the page. At the same time apache inserts the page into memcache, so it&#8217;s available to nginx for the next request.  A sample configuration nginx script would look something like this:</p>
<pre class="code"><a href="http://wiki.nginx.org/NginxHttpCoreModule#server"><span class="kw3">server</span></a> <span class="br0">{</span>
  <a rel="nofollow" href="http://wiki.nginx.org/NginxHttpCoreModule#location"><span class="kw3">location</span></a> / <span class="br0">{</span>
    <a rel="nofollow" href="http://wiki.nginx.org/NginxHttpRewriteModule#set"><span class="kw22">set</span></a> <span class="re0">$memcached_key</span> <span class="re0">$uri</span>;
    <a rel="nofollow" href="http://wiki.nginx.org/NginxHttpMemcachedModule#memcached_pass"><span class="kw20">memcached_pass</span></a>     name:<span class="nu0">11211</span>;
    <a rel="nofollow" href="http://wiki.nginx.org/NginxHttpCoreModule#default_type"><span class="kw3">default_type</span></a>       text/html;
    <a rel="nofollow" href="http://wiki.nginx.org/NginxHttpCoreModule#error_page"><span class="kw3">error_page</span></a>         <span class="nu0">404</span> = /fallback;
  <span class="br0">}</span>

  <a rel="nofollow" href="http://wiki.nginx.org/NginxHttpCoreModule#location"><span class="kw3">location</span></a> = /fallback <span class="br0">{</span>
    <a rel="nofollow" href="http://wiki.nginx.org/NginxHttpProxyModule#proxy_pass"><span class="kw21">proxy_pass</span></a> backend;
  <span class="br0">}</span>
<span class="br0">}</span></pre>
<p><span style="text-decoration: underline;"><strong>Additional Resources:</strong></span> <a rel="nofollow" href="http://nginx.net/" target="_blank">Nginx</a> <a rel="nofollow" href="http://www.danga.com/memcached/" target="_blank">Memcache</a> <a rel="nofollow" href="http://apache.org/" target="_blank">Apache</a><script type="text/javascript"><!--
google_ad_client = "pub-5075229468189091";
google_ad_slot = "2446713154";
google_ad_width = 468;
google_ad_height = 15;
// --></script><br />
<script src="http://pagead2.googlesyndication.com/pagead/show_ads.js" type="text/javascript"></script></p>
<!-- google_ad_section_end -->]]></content:encoded>
			<wfw:commentRss>http://www.itecsoftware.com/nginx-and-memcached-module/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Eclipse Ganymede and PDT 2.0 for PHP Development</title>
		<link>http://www.itecsoftware.com/eclipse-ganymede-and-pdt-for-php-development?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=eclipse-ganymede-and-pdt-for-php-development</link>
		<comments>http://www.itecsoftware.com/eclipse-ganymede-and-pdt-for-php-development#comments</comments>
		<pubDate>Sat, 18 Apr 2009 17:22:54 +0000</pubDate>
		<dc:creator>Peter</dc:creator>
				<category><![CDATA[Web Development]]></category>
		<category><![CDATA[eclipse]]></category>
		<category><![CDATA[ganymede]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[jre 64 bit]]></category>
		<category><![CDATA[pdt]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[subversion]]></category>

		<guid isPermaLink="false">http://articles.itecsoftware.com/?p=108</guid>
		<description><![CDATA[<a href="http://www.itecsoftware.com/eclipse-ganymede-and-pdt-for-php-development" title="Eclipse Ganymede and PDT 2.0 for PHP Development"></a>With the release of Eclipse Ganymede, the IDE has become even better. I remember using Zend Studio for Eclipse 6.0.1 for about two weeks, after giving up and moving over to Netbeans 6.5. Too many issues with the debugging part, &#8230;<p class="read-more"><a href="http://www.itecsoftware.com/eclipse-ganymede-and-pdt-for-php-development">Read more &#187;</a></p>]]></description>
			<content:encoded><![CDATA[<a href="http://www.itecsoftware.com/eclipse-ganymede-and-pdt-for-php-development" title="Eclipse Ganymede and PDT 2.0 for PHP Development"></a><!-- google_ad_section_start --><p>With the release of Eclipse Ganymede, the IDE has become even better. I remember using Zend Studio for Eclipse 6.0.1 for about two weeks, after giving up and moving over to Netbeans 6.5. Too many issues with the debugging part, constant exceptions and a sizable slow down when working on web pages just got me too frustrated.</p>
<p>Now Ganymede is out for a while, but I just haven&#8217;t given it a change until now. And I&#8217;m positively surprised. While still fairly slow and lagging wile editing html/css content, gone are the countless exceptions, the cumbersome, seemingly endless installation procedure and also xDebug integrates quite nicely with the IDE. There are still a few caveats during the install, especially on a 64 bit environment.</p>
<p><span id="more-108"></span></p>
<p>So here are the installation steps I went through getting this IDE installed, PHP editing enabled and everything configured.</p>
<p>Getting the correct version of Java JRE setup. Eclipse doesn&#8217;t come with one, so we have to get the right version. I have read multiple blogs from frustrated users complaining that their IDE won&#8217;t start up or just start half way. That would be an indication of the wrong JRE. We need the matching JRE for your OS. I got it from here:    <a href="http://javadl.sun.com/webapps/download/AutoDL?BundleId=29210" target="_blank">32 bit JRE</a> and <a href="http://javadl.sun.com/webapps/download/AutoDL?BundleId=29214" target="_blank">64 bit JRE</a></p>
<p>1. Download Install the Java Runtime Environment. I will install the 64bit version it into /opt, for 32bit version you will need to substitute the file name.</p>
<address style="padding-left: 30px;">cd /opt</p>
<p>sudo mkdir java</p>
</address>
<address style="padding-left: 30px;">cd java</address>
<address style="padding-left: 30px;">wget http://javadl.sun.com/webapps/download/AutoDL?BundleId=29214</p>
<p>sudo chmod 755 /opt/java/jre-6u13-linux-x64.bin</p>
</address>
<address style="padding-left: 30px;">sudo ./jre-6u13-linux-x64.bin</address>
<address style="padding-left: 30px;"> </address>
<p>2. Setting the JRE 6u13 as the default:</p>
<address style="padding-left: 30px;">sudo update-alternatives &#8211;install &#8220;/usr/bin/java&#8221; &#8220;java&#8221; &#8220;/opt/java/jre1.6.0_13/bin/java&#8221; 1</p>
<p>sudo update-alternatives &#8211;set java /opt/java/jre1.6.0_13/bin/java</p>
</address>
<address style="padding-left: 30px;"> </address>
<p style="padding-left: 30px;">(you should be getting an output like this: Using &#8216;/opt/java/jre1.6.0_13/bin/java&#8217; to provide &#8216;java&#8217;)</p>
<p>3. Download and install Eclipse. I will install the full version 3.4 64bit and PDT into /opt/eclipse. You&#8217;ll find other versions (32bit) <a title="Eclipse Downloads" href="http://www.eclipse.org/downloads/" target="_blank">here</a>:</p>
<address style="padding-left: 30px;">cd /opt</address>
<address style="padding-left: 30px;">wget http://www.eclipse.org/downloads/download.php?file=/technology/epp/downloads/release/ganymede/SR2/eclipse-jee-ganymede-SR2-linux-gtk-x86_64.tar.gz</address>
<address style="padding-left: 30px;">tar -zxvf eclipse-jee-ganymede-SR2-linux-gtk-x86_64.tar.gz</address>
<p style="padding-left: 30px;">
<address style="padding-left: 30px;"> </address>
<p>4. Running Eclipse and install PDT 2.0</p>
<address style="padding-left: 30px;">cd /opt/eclipse</address>
<address style="padding-left: 30px;">./eclipse</address>
<p style="padding-left: 30px;">This will start our IDE.</p>
<p>5. Now we&#8217;re going to add PDT 2.0 integration.</p>
<address style="padding-left: 30px;">Help -&gt; Software Updates -&gt; Add Site</address>
<address style="padding-left: 30px;">add: http://download.eclipse.org/technology/dltk/updates-dev/1.0/ </address>
<address style="padding-left: 30px;">and:  http://download.eclipse.org/tools/pdt/updates/2.0/interim/</address>
<address style="padding-left: 30px;">and: http://subclipse.tigris.org/update_1.6.x/  (only if you want the latest subversion client)</address>
<p style="padding-left: 30px;">
<address style="padding-left: 30px;"> </address>
<address style="padding-left: 30px;"> </address>
<p>Click OK to close the Available Sites Manager. The rest is just as easy &#8211; two new sites should appear in the Available Software sites list. Expand the DLTK site (the small triangle to the left of the site name), then the Dynamic Languages Toolkit option, and check “Dynamic Languages Toolkit &#8211; Core Frameworks (Incubation)”, from the top of the list. Then repeat the process with the PDT Update site &#8211; expand PDT Update Site -&gt; PDT SDK 2.0.0 and check “PDT Runtime Feature” from the list. If you like to add the latest Subversion client, select the entire &#8220;update_1.6.x&#8221; feature. That’s it. Click Install and follow the prompts.</p>
<p>Once installed, Eclipse recommends restarting the application. Accept, restart, and enjoy your new PHP IDE with PDT 2.</p>
<!-- google_ad_section_end -->]]></content:encoded>
			<wfw:commentRss>http://www.itecsoftware.com/eclipse-ganymede-and-pdt-for-php-development/feed</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
	</channel>
</rss>

<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Page Caching using disk: basic
Database Caching 14/32 queries in 0.007 seconds using disk: basic
Object Caching 964/1002 objects using disk: basic

Served from: www.itecsoftware.com @ 2012-05-19 15:38:45 -->
