<?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>Ecommy - your ecommerce support for your online business</title>
	<atom:link href="http://www.ecommy.com/feed" rel="self" type="application/rss+xml" />
	<link>http://www.ecommy.com</link>
	<description>the path to your business success</description>
	<lastBuildDate>Mon, 16 Apr 2012 18:41:57 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
		<item>
		<title>Real IP in apache acces logs whm/cpanel</title>
		<link>http://www.ecommy.com/linux/real-ip-in-apache-acces-logs-whmcpanel</link>
		<comments>http://www.ecommy.com/linux/real-ip-in-apache-acces-logs-whmcpanel#comments</comments>
		<pubDate>Mon, 16 Apr 2012 18:22:35 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://www.ecommy.com/?p=661</guid>
		<description><![CDATA[      
      in /usr/local/apache/conf/includes/post_virtualhost_global.conf add LogFormat &#34;%{X-Forwarded-For}i %h %l %u %t \&#34;%r\&#34; %&#62;s %b \&#34;%{Referer}i\&#34; \&#34;%{User-Agent}i\&#34;&#34; combined]]></description>
			<content:encoded><![CDATA[      
      <p>in /usr/local/apache/conf/includes/post_virtualhost_global.conf add</p>

<div class="wp_syntax"><div class="code"><pre class="bash">LogFormat <span class="st0">&quot;%{X-Forwarded-For}i %h %l %u %t <span class="es1">\&quot;</span>%r<span class="es1">\&quot;</span> %&gt;s %b <span class="es1">\&quot;</span>%{Referer}i<span class="es1">\&quot;</span> <span class="es1">\&quot;</span>%{User-Agent}i<span class="es1">\&quot;</span>&quot;</span> combined</pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://www.ecommy.com/linux/real-ip-in-apache-acces-logs-whmcpanel/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Some DOS/DDOS protection</title>
		<link>http://www.ecommy.com/web-security/some-dosddos-protection</link>
		<comments>http://www.ecommy.com/web-security/some-dosddos-protection#comments</comments>
		<pubDate>Mon, 16 Apr 2012 15:02:12 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Web Security]]></category>

		<guid isPermaLink="false">http://www.ecommy.com/?p=655</guid>
		<description><![CDATA[      
      Bellow I describe how to avoid some denial of service attacks TCP syn flood attacks This kind of attack assumes that an attacker is sending syn packets to the server but not any ACK packets, because of this breaking the TCP/IP 3-way handshake 1. /etc/sysctl.conf # Protection SYN flood net.ipv4.tcp_syncookies = 1 #answers to any [...]]]></description>
			<content:encoded><![CDATA[      
      <p>Bellow I describe how to avoid some denial of service attacks</p>
<h2>TCP syn flood attacks</h2>
<p>This kind of attack assumes that an attacker is sending syn packets to the server but not any ACK packets, because of this breaking the TCP/IP 3-way handshake</p>
<p><strong>1. /etc/sysctl.conf </strong><br />
# Protection SYN flood</p>

<div class="wp_syntax"><div class="code"><pre class="bash">net.ipv4.tcp_syncookies = <span class="nu0">1</span> <span class="co0">#answers to any SYN packet</span>
net.ipv4.conf.all.rp_filter = <span class="nu0">1</span> <span class="co0">#The arp_filter variable tells the kernel whether the IP address should be bound to a specific ARP address or not</span>
net.ipv4.tcp_max_syn_backlog = <span class="nu0">1024</span>  <span class="co0"># how many SYN requests to keep in memory that we have yet to get the third packet in a 3-way handshake from (requires net.ipv4.tcp_syncookies = 1)</span></pre></div></div>

<p><strong>2. reload the new parameters</strong></p>

<div class="wp_syntax"><div class="code"><pre class="bash">sysctl <span class="re5">-p</span></pre></div></div>

<h2>Slowloris like attacks</h2>
<p>The attack bears the same name as the animal, slow but poisonous. Basically the DOS attacker sends very SLOW requests to the server, header by header, even character by character. The server reserves the required resources to handle the request but it also waits for the request to finish. As a result it won&#8217;t take long until all the apache connections are flooded or server memory consumed.</p>
<p><strong>1. /etc/haproxy/haproxy.cfg</strong></p>

<div class="wp_syntax"><div class="code"><pre class="bash">timeout http-request 5s</pre></div></div>

<p><strong>2. restart haproxy</strong></p>

<div class="wp_syntax"><div class="code"><pre class="bash"><span class="sy0">/</span>etc<span class="sy0">/</span>init.d<span class="sy0">/</span>haproxy restart</pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://www.ecommy.com/web-security/some-dosddos-protection/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Cakephp 1.3 and php 5.4</title>
		<link>http://www.ecommy.com/programming/cakephp-1-3-and-php-5-4</link>
		<comments>http://www.ecommy.com/programming/cakephp-1-3-and-php-5-4#comments</comments>
		<pubDate>Mon, 16 Apr 2012 12:47:45 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[CakePHP]]></category>
		<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://www.ecommy.com/?p=649</guid>
		<description><![CDATA[      
      A quick notice how to disable the errors that appear after upgrading the php to 5.4 which is by the way a lot faster than ever before. cake/bootstrap.php replace: error_reporting&#40;E_ALL &#38; ~E_DEPRECATED&#41;; with error_reporting&#40;E_ALL &#38; ~E_DEPRECATED &#38; ~E_STRICT&#41;; cake/libs/debugger.php after: $files = $this-&#62;trace&#40;array&#40;'start' =&#62; 2, 'format' =&#62; 'points'&#41;&#41;; add if&#40;!isset&#40;$files&#91;0&#93;&#91;'file'&#93;&#41;&#41; return;]]></description>
			<content:encoded><![CDATA[      
      <p>A quick notice how to disable the errors that appear after upgrading the php to 5.4 which is by the way a lot faster than ever before.</p>
<p>cake/bootstrap.php<br />
replace:</p>

<div class="wp_syntax"><div class="code"><pre class="php"><a href="http://www.php.net/error_reporting"><span class="kw3">error_reporting</span></a><span class="br0">&#40;</span><span class="kw4">E_ALL</span> <span class="sy0">&amp;</span> ~E_DEPRECATED<span class="br0">&#41;</span><span class="sy0">;</span></pre></div></div>

<p>with</p>

<div class="wp_syntax"><div class="code"><pre class="php"><a href="http://www.php.net/error_reporting"><span class="kw3">error_reporting</span></a><span class="br0">&#40;</span><span class="kw4">E_ALL</span> <span class="sy0">&amp;</span> ~E_DEPRECATED <span class="sy0">&amp;</span> ~<span class="kw4">E_STRICT</span><span class="br0">&#41;</span><span class="sy0">;</span></pre></div></div>

<p>cake/libs/debugger.php<br />
after:</p>

<div class="wp_syntax"><div class="code"><pre class="php"><span class="re0">$files</span> <span class="sy0">=</span> <span class="re0">$this</span><span class="sy0">-&gt;</span><span class="me1">trace</span><span class="br0">&#40;</span><a href="http://www.php.net/array"><span class="kw3">array</span></a><span class="br0">&#40;</span><span class="st_h">'start'</span> <span class="sy0">=&gt;</span> <span class="nu0">2</span><span class="sy0">,</span> <span class="st_h">'format'</span> <span class="sy0">=&gt;</span> <span class="st_h">'points'</span><span class="br0">&#41;</span><span class="br0">&#41;</span><span class="sy0">;</span></pre></div></div>

<p>add</p>

<div class="wp_syntax"><div class="code"><pre class="php"><span class="kw1">if</span><span class="br0">&#40;</span><span class="sy0">!</span><a href="http://www.php.net/isset"><span class="kw3">isset</span></a><span class="br0">&#40;</span><span class="re0">$files</span><span class="br0">&#91;</span><span class="nu0">0</span><span class="br0">&#93;</span><span class="br0">&#91;</span><span class="st_h">'file'</span><span class="br0">&#93;</span><span class="br0">&#41;</span><span class="br0">&#41;</span> <span class="kw1">return</span><span class="sy0">;</span></pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://www.ecommy.com/programming/cakephp-1-3-and-php-5-4/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>centos install memcached and memcache php module</title>
		<link>http://www.ecommy.com/linux/centos-install-memcached-and-memcache-php-module</link>
		<comments>http://www.ecommy.com/linux/centos-install-memcached-and-memcache-php-module#comments</comments>
		<pubDate>Thu, 27 Oct 2011 12:16:46 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://www.ecommy.com/?p=645</guid>
		<description><![CDATA[      
      1. yum install memcached 2a. wget http://pecl.php.net/get/memcache-3.0.6.tgz 2b. tar -xvf memcache-3.0.6.tgz here is a little storry, we need to use phpize to prepare the imagick php extension for compiling. On my server I have multiple php installations and if I use phpize directly it will compile the extension for a wrong version of php. Even [...]]]></description>
			<content:encoded><![CDATA[      
      <p>1. yum install memcached<br />
2a. wget http://pecl.php.net/get/memcache-3.0.6.tgz<br />
2b. tar -xvf memcache-3.0.6.tgz</p>
<p>here is a little storry, we need to use phpize to prepare the imagick php extension for compiling.<br />
On my server I have multiple php installations and if I use phpize directly it will compile the extension for a wrong version of php. Even if I try using phpize with an absolute path the end result will still be wrong and I’ll get the following errors inside my apache error log:<br />
“PHP Warning: PHP Startup: imagick: Unable to initialize module<br />
Module compiled with module API=20060613<br />
PHP compiled with module API=20090626<br />
These options need to match”</p>
<p>so keeping the story short I backup/rename (temporary) the default php include directory:<br />
3. rename /usr/local/include/php to /usr/local/include/_php (in my case)<br />
I create a symlink inside /usr/local/include/ called php that points to the php include version I whish to compile the imagemagick extension, in this case it will point to /usr/local/php-5.3.2-fcgi/include/php</p>
<p>4. now I continue with:<br />
/usr/local/php-5.3.2-fcgi/bin/phpize</p>
<p>5. I configure with the right php-config file:<br />
./configure –with-php-config=/usr/local/php-5.3.2-fcgi/bin/php-config</p>
<p>6. and the usual<br />
make<br />
make install</p>
<p>7. now check where the imagick.so file was copied to and include it in your php.ini:<br />
extension=/usr/…/extensions/memcache.so</p>
<p>8. start memcache server<br />
memcached -d -u nobody -m 1048 -p 11211 127.0.0.1</p>
<p>9. restart apache<br />
/etc/init.d/httpd restart</p>
]]></content:encoded>
			<wfw:commentRss>http://www.ecommy.com/linux/centos-install-memcached-and-memcache-php-module/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>php compile: undefined reference to `xmlXPathContextSetCache&#8217;</title>
		<link>http://www.ecommy.com/linux/php-compile-undefined-reference-to-xmlxpathcontextsetcache</link>
		<comments>http://www.ecommy.com/linux/php-compile-undefined-reference-to-xmlxpathcontextsetcache#comments</comments>
		<pubDate>Mon, 22 Aug 2011 13:27:36 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://www.ecommy.com/?p=643</guid>
		<description><![CDATA[      
      I am doing some tests to prepare a new version of PHP on which I needed the xsl library. Everything was going ok after the ./configure command (I added -with-xsl=/usr/lib64 as one of the configure options). I mention that I am using centos 5.3 as OS. When I tried to execute the make command I [...]]]></description>
			<content:encoded><![CDATA[      
      <p>I am doing some tests to prepare a new version of PHP on which I needed the xsl library. Everything was going ok after the ./configure command (I added -with-xsl=/usr/lib64 as one of the  configure options).</p>
<p>I mention that I am using centos 5.3 as OS.</p>
<p>When I tried to execute the make command I got the following error:<br />
&#8220;undefined reference to `xmlXPathContextSetCache&#8217;&#8221; and unfortunately didn&#8217;t found an answer on google that will solve my question. </p>
<p>After some trial &#038; error I noticed that inside /usr/lib64 folder I had a symlink called libxml2.so that pointed to libxml2.so.2.6.23.  I also had the file libxml2.so.2.6.26. </p>
<p>All I did is to change the symlink to point to the newer version of libxml2. In conclusion the problem seems to be in the libxml2 versions prior to 2.6.26 (2.6.25 and bellow)</p>
]]></content:encoded>
			<wfw:commentRss>http://www.ecommy.com/linux/php-compile-undefined-reference-to-xmlxpathcontextsetcache/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>debug which wordpress plugin is slower</title>
		<link>http://www.ecommy.com/web-development/debug-which-wordpress-plugin-is-slower</link>
		<comments>http://www.ecommy.com/web-development/debug-which-wordpress-plugin-is-slower#comments</comments>
		<pubDate>Sun, 21 Aug 2011 14:07:01 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Web development]]></category>

		<guid isPermaLink="false">http://www.ecommy.com/?p=641</guid>
		<description><![CDATA[      
      Once I had a performance problem with wordpress website even if it run on a dedicated server. I suspected that the problem is one of the plugins but I had at least 50 installed . In order to see who&#8217;s the slowest I opened wp-includes/plugin.php and temprary changed the do_action function to something like this: [...]]]></description>
			<content:encoded><![CDATA[      
      <p>Once I had a performance problem with wordpress website even if it run on a dedicated server.</p>
<p>I suspected that the problem is one of the plugins but I had at least 50  installed <img src='http://www.ecommy.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> .<br />
In order to see who&#8217;s the slowest I opened wp-includes/plugin.php and temprary changed the do_action function to something like this:</p>

<div class="wp_syntax"><div class="code"><pre class="php"><span class="kw2">function</span> do_action<span class="br0">&#40;</span><span class="re0">$tag</span><span class="sy0">,</span> <span class="re0">$arg</span> <span class="sy0">=</span> <span class="st_h">''</span><span class="br0">&#41;</span> <span class="br0">&#123;</span>
	<span class="kw2">global</span> <span class="re0">$wp_filter</span><span class="sy0">,</span> <span class="re0">$wp_actions</span><span class="sy0">,</span> <span class="re0">$merged_filters</span><span class="sy0">,</span> <span class="re0">$wp_current_filter</span><span class="sy0">;</span>
&nbsp;
	<span class="kw1">if</span> <span class="br0">&#40;</span> <span class="sy0">!</span> <a href="http://www.php.net/isset"><span class="kw3">isset</span></a><span class="br0">&#40;</span><span class="re0">$wp_actions</span><span class="br0">&#41;</span> <span class="br0">&#41;</span>
		<span class="re0">$wp_actions</span> <span class="sy0">=</span> <a href="http://www.php.net/array"><span class="kw3">array</span></a><span class="br0">&#40;</span><span class="br0">&#41;</span><span class="sy0">;</span>
&nbsp;
	<span class="kw1">if</span> <span class="br0">&#40;</span> <span class="sy0">!</span> <a href="http://www.php.net/isset"><span class="kw3">isset</span></a><span class="br0">&#40;</span><span class="re0">$wp_actions</span><span class="br0">&#91;</span><span class="re0">$tag</span><span class="br0">&#93;</span><span class="br0">&#41;</span> <span class="br0">&#41;</span>
		<span class="re0">$wp_actions</span><span class="br0">&#91;</span><span class="re0">$tag</span><span class="br0">&#93;</span> <span class="sy0">=</span> <span class="nu0">1</span><span class="sy0">;</span>
	<span class="kw1">else</span>
		<span class="sy0">++</span><span class="re0">$wp_actions</span><span class="br0">&#91;</span><span class="re0">$tag</span><span class="br0">&#93;</span><span class="sy0">;</span>
&nbsp;
	<span class="re0">$wp_current_filter</span><span class="br0">&#91;</span><span class="br0">&#93;</span> <span class="sy0">=</span> <span class="re0">$tag</span><span class="sy0">;</span>
&nbsp;
	<span class="co1">// Do 'all' actions first</span>
	<span class="kw1">if</span> <span class="br0">&#40;</span> <a href="http://www.php.net/isset"><span class="kw3">isset</span></a><span class="br0">&#40;</span><span class="re0">$wp_filter</span><span class="br0">&#91;</span><span class="st_h">'all'</span><span class="br0">&#93;</span><span class="br0">&#41;</span> <span class="br0">&#41;</span> <span class="br0">&#123;</span>
		<span class="re0">$all_args</span> <span class="sy0">=</span> <a href="http://www.php.net/func_get_args"><span class="kw3">func_get_args</span></a><span class="br0">&#40;</span><span class="br0">&#41;</span><span class="sy0">;</span>
		_wp_call_all_hook<span class="br0">&#40;</span><span class="re0">$all_args</span><span class="br0">&#41;</span><span class="sy0">;</span>
	<span class="br0">&#125;</span>
&nbsp;
	<span class="kw1">if</span> <span class="br0">&#40;</span> <span class="sy0">!</span><a href="http://www.php.net/isset"><span class="kw3">isset</span></a><span class="br0">&#40;</span><span class="re0">$wp_filter</span><span class="br0">&#91;</span><span class="re0">$tag</span><span class="br0">&#93;</span><span class="br0">&#41;</span> <span class="br0">&#41;</span> <span class="br0">&#123;</span>
		<a href="http://www.php.net/array_pop"><span class="kw3">array_pop</span></a><span class="br0">&#40;</span><span class="re0">$wp_current_filter</span><span class="br0">&#41;</span><span class="sy0">;</span>
		<span class="kw1">return</span><span class="sy0">;</span>
	<span class="br0">&#125;</span>
&nbsp;
	<span class="re0">$args</span> <span class="sy0">=</span> <a href="http://www.php.net/array"><span class="kw3">array</span></a><span class="br0">&#40;</span><span class="br0">&#41;</span><span class="sy0">;</span>
	<span class="kw1">if</span> <span class="br0">&#40;</span> <a href="http://www.php.net/is_array"><span class="kw3">is_array</span></a><span class="br0">&#40;</span><span class="re0">$arg</span><span class="br0">&#41;</span> <span class="sy0">&amp;&amp;</span> <span class="nu0">1</span> <span class="sy0">==</span> <a href="http://www.php.net/count"><span class="kw3">count</span></a><span class="br0">&#40;</span><span class="re0">$arg</span><span class="br0">&#41;</span> <span class="sy0">&amp;&amp;</span> <a href="http://www.php.net/isset"><span class="kw3">isset</span></a><span class="br0">&#40;</span><span class="re0">$arg</span><span class="br0">&#91;</span><span class="nu0">0</span><span class="br0">&#93;</span><span class="br0">&#41;</span> <span class="sy0">&amp;&amp;</span> <a href="http://www.php.net/is_object"><span class="kw3">is_object</span></a><span class="br0">&#40;</span><span class="re0">$arg</span><span class="br0">&#91;</span><span class="nu0">0</span><span class="br0">&#93;</span><span class="br0">&#41;</span> <span class="br0">&#41;</span> <span class="co1">// array(&amp;$this)</span>
		<span class="re0">$args</span><span class="br0">&#91;</span><span class="br0">&#93;</span> <span class="sy0">=&amp;</span> <span class="re0">$arg</span><span class="br0">&#91;</span><span class="nu0">0</span><span class="br0">&#93;</span><span class="sy0">;</span>
	<span class="kw1">else</span>
		<span class="re0">$args</span><span class="br0">&#91;</span><span class="br0">&#93;</span> <span class="sy0">=</span> <span class="re0">$arg</span><span class="sy0">;</span>
	<span class="kw1">for</span> <span class="br0">&#40;</span> <span class="re0">$a</span> <span class="sy0">=</span> <span class="nu0">2</span><span class="sy0">;</span> <span class="re0">$a</span> <span class="sy0">&lt;</span> <a href="http://www.php.net/func_num_args"><span class="kw3">func_num_args</span></a><span class="br0">&#40;</span><span class="br0">&#41;</span><span class="sy0">;</span> <span class="re0">$a</span><span class="sy0">++</span> <span class="br0">&#41;</span>
		<span class="re0">$args</span><span class="br0">&#91;</span><span class="br0">&#93;</span> <span class="sy0">=</span> <a href="http://www.php.net/func_get_arg"><span class="kw3">func_get_arg</span></a><span class="br0">&#40;</span><span class="re0">$a</span><span class="br0">&#41;</span><span class="sy0">;</span>
&nbsp;
	<span class="co1">// Sort</span>
	<span class="kw1">if</span> <span class="br0">&#40;</span> <span class="sy0">!</span><a href="http://www.php.net/isset"><span class="kw3">isset</span></a><span class="br0">&#40;</span> <span class="re0">$merged_filters</span><span class="br0">&#91;</span> <span class="re0">$tag</span> <span class="br0">&#93;</span> <span class="br0">&#41;</span> <span class="br0">&#41;</span> <span class="br0">&#123;</span>
		<a href="http://www.php.net/ksort"><span class="kw3">ksort</span></a><span class="br0">&#40;</span><span class="re0">$wp_filter</span><span class="br0">&#91;</span><span class="re0">$tag</span><span class="br0">&#93;</span><span class="br0">&#41;</span><span class="sy0">;</span>
		<span class="re0">$merged_filters</span><span class="br0">&#91;</span> <span class="re0">$tag</span> <span class="br0">&#93;</span> <span class="sy0">=</span> <span class="kw4">true</span><span class="sy0">;</span>
	<span class="br0">&#125;</span>
&nbsp;
	<a href="http://www.php.net/reset"><span class="kw3">reset</span></a><span class="br0">&#40;</span> <span class="re0">$wp_filter</span><span class="br0">&#91;</span> <span class="re0">$tag</span> <span class="br0">&#93;</span> <span class="br0">&#41;</span><span class="sy0">;</span>
&nbsp;
	<span class="kw1">do</span> <span class="br0">&#123;</span>
		<span class="kw1">foreach</span> <span class="br0">&#40;</span> <span class="br0">&#40;</span><a href="http://www.php.net/array"><span class="kw3">array</span></a><span class="br0">&#41;</span> <a href="http://www.php.net/current"><span class="kw3">current</span></a><span class="br0">&#40;</span><span class="re0">$wp_filter</span><span class="br0">&#91;</span><span class="re0">$tag</span><span class="br0">&#93;</span><span class="br0">&#41;</span> <span class="kw1">as</span> <span class="re0">$the_</span> <span class="br0">&#41;</span> <span class="br0">&#123;</span>
&nbsp;
			<span class="kw1">if</span> <span class="br0">&#40;</span> <span class="sy0">!</span><a href="http://www.php.net/is_null"><span class="kw3">is_null</span></a><span class="br0">&#40;</span><span class="re0">$the_</span><span class="br0">&#91;</span><span class="st_h">'function'</span><span class="br0">&#93;</span><span class="br0">&#41;</span> <span class="br0">&#41;</span> <span class="br0">&#123;</span>
                <span class="kw1">if</span><span class="br0">&#40;</span><span class="re0">$tag</span><span class="sy0">==</span><span class="st_h">'init'</span><span class="br0">&#41;</span> <span class="re0">$time_start</span> <span class="sy0">=</span> <a href="http://www.php.net/microtime"><span class="kw3">microtime</span></a><span class="br0">&#40;</span><span class="kw4">true</span><span class="br0">&#41;</span><span class="sy0">;</span>
				<a href="http://www.php.net/call_user_func_array"><span class="kw3">call_user_func_array</span></a><span class="br0">&#40;</span><span class="re0">$the_</span><span class="br0">&#91;</span><span class="st_h">'function'</span><span class="br0">&#93;</span><span class="sy0">,</span> <a href="http://www.php.net/array_slice"><span class="kw3">array_slice</span></a><span class="br0">&#40;</span><span class="re0">$args</span><span class="sy0">,</span> <span class="nu0">0</span><span class="sy0">,</span> <span class="br0">&#40;</span>int<span class="br0">&#41;</span> <span class="re0">$the_</span><span class="br0">&#91;</span><span class="st_h">'accepted_args'</span><span class="br0">&#93;</span><span class="br0">&#41;</span><span class="br0">&#41;</span><span class="sy0">;</span>
                <span class="kw1">if</span><span class="br0">&#40;</span><span class="re0">$tag</span><span class="sy0">==</span><span class="st_h">'init'</span><span class="br0">&#41;</span> <span class="br0">&#123;</span>
                    <span class="re0">$time_end</span> <span class="sy0">=</span> <a href="http://www.php.net/microtime"><span class="kw3">microtime</span></a><span class="br0">&#40;</span><span class="kw4">true</span><span class="br0">&#41;</span><span class="sy0">;</span><span class="re0">$time</span> <span class="sy0">=</span> <span class="re0">$time_end</span> <span class="sy0">-</span> <span class="re0">$time_start</span><span class="sy0">;</span>
                    <span class="kw1">echo</span> <a href="http://www.php.net/print_r"><span class="kw3">print_r</span></a><span class="br0">&#40;</span><span class="re0">$the_</span><span class="br0">&#91;</span><span class="st_h">'function'</span><span class="br0">&#93;</span><span class="br0">&#41;</span><span class="sy0">.</span><span class="st_h">' -----  &lt;b&gt;'</span><span class="sy0">.</span><span class="re0">$time</span><span class="sy0">.</span><span class="st0">&quot;&lt;/b&gt;&lt;br&gt;<span class="es1">\n</span>&quot;</span><span class="sy0">;</span>
                <span class="br0">&#125;</span>                
            <span class="br0">&#125;</span>
        <span class="br0">&#125;</span>
&nbsp;
	<span class="br0">&#125;</span> <span class="kw1">while</span> <span class="br0">&#40;</span> <a href="http://www.php.net/next"><span class="kw3">next</span></a><span class="br0">&#40;</span><span class="re0">$wp_filter</span><span class="br0">&#91;</span><span class="re0">$tag</span><span class="br0">&#93;</span><span class="br0">&#41;</span> <span class="sy0">!==</span> <span class="kw4">false</span> <span class="br0">&#41;</span><span class="sy0">;</span>
&nbsp;
	<a href="http://www.php.net/array_pop"><span class="kw3">array_pop</span></a><span class="br0">&#40;</span><span class="re0">$wp_current_filter</span><span class="br0">&#41;</span><span class="sy0">;</span>
<span class="br0">&#125;</span></pre></div></div>

<p>after this you&#8217;ll be able to see what plugin is eating the most of your time (after each function call you&#8217;ll see execution time in bold)</p>
<p>It&#8217;s not a mature script just a quick snippet to have a starting point for someone  who runs into the same problem.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.ecommy.com/web-development/debug-which-wordpress-plugin-is-slower/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>debug sql inside cakephp model</title>
		<link>http://www.ecommy.com/ecommerce/debug-sql-inside-cakephp-model</link>
		<comments>http://www.ecommy.com/ecommerce/debug-sql-inside-cakephp-model#comments</comments>
		<pubDate>Tue, 16 Aug 2011 19:31:05 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[E-commerce]]></category>

		<guid isPermaLink="false">http://www.ecommy.com/?p=638</guid>
		<description><![CDATA[      
      $dbo = $this->getDatasource(); $dbo->fullDebug = true; $this->find(&#8216;all&#8217;, &#8230; $logs = $dbo->_queriesLog; $log = end($logs); print_r($logs);exit;]]></description>
			<content:encoded><![CDATA[      
      <p>    $dbo = $this->getDatasource();<br />
    $dbo->fullDebug = true;</p>
<p>    $this->find(&#8216;all&#8217;, &#8230;</p>
<p>    $logs = $dbo->_queriesLog;<br />
    $log = end($logs);<br />
    print_r($logs);exit;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.ecommy.com/ecommerce/debug-sql-inside-cakephp-model/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Configure: error: Cannot find libmysqlclient under /usr/local</title>
		<link>http://www.ecommy.com/linux/configure-error-cannot-find-libmysqlclient-under-usrlocal</link>
		<comments>http://www.ecommy.com/linux/configure-error-cannot-find-libmysqlclient-under-usrlocal#comments</comments>
		<pubDate>Tue, 26 Jul 2011 22:29:57 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://www.ecommy.com/?p=636</guid>
		<description><![CDATA[      
      The fix is pretty simple, run the following commands and afterwards reenter your previous ./configure command ln -s /usr/lib64/libmysqlclient.so /usr/lib/libmysqlclient.so ln -s /usr/lib64/libmysqlclient.so /usr/local/libmysqlclient.so]]></description>
			<content:encoded><![CDATA[      
      <p>The fix is pretty simple, run the following commands and afterwards reenter your previous ./configure command<br />
ln -s /usr/lib64/libmysqlclient.so /usr/lib/libmysqlclient.so<br />
ln -s /usr/lib64/libmysqlclient.so /usr/local/libmysqlclient.so </p>
]]></content:encoded>
			<wfw:commentRss>http://www.ecommy.com/linux/configure-error-cannot-find-libmysqlclient-under-usrlocal/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>install percona in a whm cpanel environment</title>
		<link>http://www.ecommy.com/linux/install-percona-in-a-whm-cpanel-environment</link>
		<comments>http://www.ecommy.com/linux/install-percona-in-a-whm-cpanel-environment#comments</comments>
		<pubDate>Wed, 22 Jun 2011 14:35:43 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://www.ecommy.com/?p=628</guid>
		<description><![CDATA[      
      1. stop all services /etc/init.d/httpd stop ; /etc/init.d/exim stop ; /etc/init.d/pure-ftpd stop ; /etc/init.d/dovecot stop ; /etc/init.d/cpanel stop ; /etc/init.d/lfd stop ; /etc/init.d/munin-node stop ; /etc/init.d/crond stop ; /etc/init.d/mysql stop ; /etc/init.d/exim stop ; /etc/init.d/portsentry stop 2. uninstall mysql, the database files are not removed, but feel free to backup them if you want check [...]]]></description>
			<content:encoded><![CDATA[      
      <p>1. stop all services<br />
/etc/init.d/httpd stop ; /etc/init.d/exim stop ; /etc/init.d/pure-ftpd stop ; /etc/init.d/dovecot stop ; /etc/init.d/cpanel stop ; /etc/init.d/lfd stop ; /etc/init.d/munin-node stop ; /etc/init.d/crond stop ; /etc/init.d/mysql stop ; /etc/init.d/exim stop ; /etc/init.d/portsentry stop</p>
<p>2. uninstall mysql, the database files are not removed, but feel free to backup them if you want<br />
check the installed mysql packages<br />
yum list installed | grep -i mysql<br />
and now unsinstall them one by one, in my case:<br />
yum remove MySQL-test.x86_64<br />
yum remove MySQL-shared.x86_64<br />
yum remove MySQL-server.x86_64<br />
yum remove MySQL-devel.x86_64<br />
yum remove MySQL-client.x86_64</p>
<p>3. install yum repository for percona<br />
rpm -Uhv http://www.percona.com/downloads/percona-release/percona-release-0.0-1.x86_64.rpm</p>
<p>4. install percona yum install Percona-Server-client-51 Percona-Server-server-51<br />
LATER UPDATE!!!!<br />
please install the separate rpm from this because later you&#8217;ll run into all sort of dependency problems on centos5:</p>
<p>http://www.percona.com/downloads/Percona-Server-5.1/Percona-XtraDB-5.1.43-9.1/RPM/rhel5/x86_64/</p>
<p>you need to use rpm -ivh ~package_name.rpm~</p>
<p>5. now go to whm configuration section and set up mysql not to be updated automatically</p>
<p>6. you may need to recompile php, I needed to do it anyway so I am not sure if it wil work if you won&#8217;t compile it</p>
<p>7. start services again<br />
/etc/init.d/httpd start ; /etc/init.d/exim start ; /etc/init.d/pure-ftpd start ; /etc/init.d/dovecot start ; /etc/init.d/cpanel start ; /etc/init.d/lfd start ; /etc/init.d/munin-node start ; /etc/init.d/crond start ; /etc/init.d/mysql start ; /etc/init.d/exim start ; /etc/init.d/portsentry start</p>
<p>8. optionally install percona xbackup<br />
yum install xtrabackup</p>
]]></content:encoded>
			<wfw:commentRss>http://www.ecommy.com/linux/install-percona-in-a-whm-cpanel-environment/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>install imagick for php</title>
		<link>http://www.ecommy.com/linux/install-imagick-for-php</link>
		<comments>http://www.ecommy.com/linux/install-imagick-for-php#comments</comments>
		<pubDate>Tue, 07 Jun 2011 22:30:55 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://www.ecommy.com/?p=624</guid>
		<description><![CDATA[      
      I&#8217;ll describe the installation process for Centos as this is my server&#8217;s operating system, the installation is very similar for any linux flavour. In order to have imagick class available inside php firstly we need to install ImageMagick-devel: 1. yum install ImageMagick-devel then, download &#038; extract the imagick pecl package: 2.a. cd ~ 2.b. wget [...]]]></description>
			<content:encoded><![CDATA[      
      <p>I&#8217;ll describe the installation process for Centos as this is my server&#8217;s operating system, the installation is very similar for any linux flavour.</p>
<p>In order to have imagick class available inside php firstly we need to install ImageMagick-devel:<br />
1. yum install ImageMagick-devel</p>
<p>then, download &#038; extract the imagick pecl package:<br />
2.a. cd ~<br />
2.b. wget http://pecl.php.net/get/imagick-3.0.1.tgz<br />
2.c. tar -xvf imagick-3.0.1.tgz<br />
2.d cd imagick-3.0.1.tgz</p>
<p>here is a little storry, we need to use phpize to prepare the imagick php extension for compiling.<br />
On my server I have multiple php installations and if I use phpize directly it will compile the extension for a wrong version of php. Even if I try using phpize with an absolute path the end result will still be wrong and I&#8217;ll get the following errors inside my apache error log:<br />
&#8220;PHP Warning:  PHP Startup: imagick: Unable to initialize module<br />
Module compiled with module API=20060613<br />
PHP    compiled with module API=20090626<br />
These options need to match&#8221;</p>
<p>so keeping the story short I backup/rename (temporary) the default php include directory:<br />
3. rename /usr/local/include/php to /usr/local/include/_php (in my case)<br />
I create a symlink inside /usr/local/include/ called php that points to the php include version I whish to compile the imagemagick extension, in this case it will point to /usr/local/php-5.3.2-fcgi/include/php</p>
<p>4. now I continue with:<br />
/usr/local/php-5.3.2-fcgi/bin/phpize</p>
<p>5. I configure with the right php-config file:<br />
./configure &#8211;with-php-config=/usr/local/php-5.3.2-fcgi/bin/php-config</p>
<p>6. and the usual<br />
make<br />
make install</p>
<p>7. now check where the imagick.so file was copied to and include it in your php.ini:<br />
extension=/usr/&#8230;/extensions/no-debug-non-zts-20090626/imagick.so</p>
]]></content:encoded>
			<wfw:commentRss>http://www.ecommy.com/linux/install-imagick-for-php/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

