<?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>Programming Ideas, Logics, Tips and Tricks &#187; server</title>
	<atom:link href="http://www.sajithmr.me/tag/server/feed" rel="self" type="application/rss+xml" />
	<link>http://www.sajithmr.me</link>
	<description></description>
	<lastBuildDate>Mon, 23 Jan 2012 15:44:09 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>PHP Session problem with cloud server</title>
		<link>http://www.sajithmr.me/php-session-problem-with-cloud-server</link>
		<comments>http://www.sajithmr.me/php-session-problem-with-cloud-server#comments</comments>
		<pubDate>Thu, 08 Jul 2010 09:51:58 +0000</pubDate>
		<dc:creator>Mr Me</dc:creator>
				<category><![CDATA[php]]></category>
		<category><![CDATA[$_session]]></category>
		<category><![CDATA[asp]]></category>
		<category><![CDATA[cloud]]></category>
		<category><![CDATA[empty]]></category>
		<category><![CDATA[error]]></category>
		<category><![CDATA[refresh]]></category>
		<category><![CDATA[saving]]></category>
		<category><![CDATA[server]]></category>
		<category><![CDATA[session]]></category>
		<category><![CDATA[session not saving]]></category>
		<category><![CDATA[session_save_path]]></category>
		<category><![CDATA[session_start]]></category>

		<guid isPermaLink="false">http://www.sajithmr.me/?p=838</guid>
		<description><![CDATA[There is a very strange issue with PHP session when you prefer session to save in files other than database (normal session). The problem is: some times you can access all the saved session values from $_SESSION and sometimes it returns a empty array. If you refresh 10 times, perhaps 4 times you will get [...]]]></description>
			<content:encoded><![CDATA[<p>There is a very strange issue with PHP session when you prefer session to save in files other than database (normal session).</p>
<p><strong>The problem</strong> is: some times you can access all the saved session values from $_SESSION and sometimes it returns a empty array.</p>
<p>If you refresh 10 times, perhaps 4 times you will get session and 6 times you will get it empty.</p>
<p>The problem is not due to domain level security or session expiry . It is due to session file location. If you run a phpinfo() function in any of your page, you can see there is a part of sessions. There you can see a session variable <strong>session_save_path </strong>and it will be pointing to /tmp/ or /etc/somefolder or /var some folder inside the linux file architecture.</p>
<p>Since at clouds, different servers server at different time, some server can see the exact saved files in that location and some server cannot. (Since /tmp etc directories are not shared among them)</p>
<p><strong>Solution</strong>:  Call the below php function and set session file path inside your web root . You need to call this function before your session_start() call</p>
<p>eg:</p>
<p><strong>session_save_path</strong>(&#8216;/mnt/stor1-wc2-dfw1/4675/5044/to/your/website/rootfolder/or/inner/directory<a style="color: #0000cc;" href="http://research.cicr.com.eg/web/content/'" target="_blank">&#8216;</a>);</p>
<p>For windows users as well, this is the solution. This problem occurs in ASP application as well.</p>
<p>Thanks</p>
<p>Sajith</p>
]]></content:encoded>
			<wfw:commentRss>http://www.sajithmr.me/php-session-problem-with-cloud-server/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>XAJAX</title>
		<link>http://www.sajithmr.me/xajax</link>
		<comments>http://www.sajithmr.me/xajax#comments</comments>
		<pubDate>Wed, 03 Jun 2009 16:00:24 +0000</pubDate>
		<dc:creator>Mr Me</dc:creator>
				<category><![CDATA[php]]></category>
		<category><![CDATA[php source code]]></category>
		<category><![CDATA[ajax]]></category>
		<category><![CDATA[call]]></category>
		<category><![CDATA[capitalize]]></category>
		<category><![CDATA[client]]></category>
		<category><![CDATA[function]]></category>
		<category><![CDATA[Javascript]]></category>
		<category><![CDATA[server]]></category>
		<category><![CDATA[xajax]]></category>

		<guid isPermaLink="false">http://www.sajithmr.com/?p=432</guid>
		<description><![CDATA[Basically using xajax &#8220;You can directly call php functions from your javascript code&#8221; Xajax will do the rest.  For example, if you are going to write a javascript function Capitalize which captilaze your textbox content when you press a button. Here is the pure html/javascript code for that: ============================================= &#60;script&#62; function Capitalize() {      [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://xajaxproject.org/" target="_blank"><img class="alignnone size-medium wp-image-433" title="xajax_logo" src="http://www.sajithmr.com/wp-content/uploads/2009/06/xajax_logo-300x179.png" alt="" width="300" height="179" /></a></p>
<p>Basically using xajax &#8220;You can directly call php functions from your javascript code&#8221;</p>
<p>Xajax will do the rest. </p>
<p>For example, if you are going to write a javascript function Capitalize which captilaze your textbox content when you press a button.</p>
<p>Here is the pure html/javascript code for that:</p>
<p>=============================================</p>
<p><strong><span style="color: #99cc00;">&lt;script&gt;</span></strong></p>
<p><span> </span><strong>function</strong> Capitalize()</p>
<p><span> </span>{</p>
<p>      var t = document.getElementById(&#8216;cap&#8217;).value;</p>
<p>      document.getElementById(&#8216;update&#8217;).innerHTML = t.toUpperCase() ;</p>
<p><span> </span>}</p>
<p><span style="color: #99cc00;"><strong>&lt;/script&gt;</strong></span></p>
<p> </p>
<p><span style="color: #0000ff;">&lt;input type=&#8221;text&#8221; id=&#8221;cap&#8221; name=&#8221;cap&#8221; /&gt;</span></p>
<p><span style="color: #0000ff;">&lt;input type=&#8221;button&#8221; id=&#8221;capbutton&#8221; value=&#8221;Capitalize&#8221; onclick=&#8221;Capitalize()&#8221; /&gt;</span></p>
<p><span style="color: #0000ff;">&lt;div id=&#8221;update&#8221;&gt;&lt;/div&gt;</span></p>
<p>==============================================</p>
<p>Now see the difference when we use xajax, we can write this Capitalize function in php code and can call from javascript.</p>
<p><strong>function</strong> Capitalize($value)</p>
<p>{</p>
<p>    $objResponse = new xajaxResponse();</p>
<p>    $objResponse-&gt;assign(&#8220;update&#8221;,&#8221;innerHTML&#8221;,strtoupper($value));</p>
<p>    return $objResponse;</p>
<p><span> </span></p>
<p>}</p>
<p>and you can call from your button&#8217;s onclick function:</p>
<p><span style="color: #ff6600;"> onclick=&#8221;xajax_Capitalize(document.getElementById(&#8216;cap&#8217;).value)&#8221; </span></p>
<p>Here the same functionality we moved from client to server. Thus the point is you can simply call all the functions you written in php (Server Side) from javascript code via onClick, onMouseOver or window.onLoad etc.</p>
<p>You can get the full source code of Capitalize example here:</p>
<p><a href="http://www.sajithmr.com/downloads/capitalize.zip">http://www.sajithmr.com/downloads/capitalize.zip</a></p>
<p>To download and for documentation go: </p>
<p><a href="http://xajaxproject.org/">http://xajaxproject.org/</a></p>
<p>Thanks</p>
<p>Sajith</p>
]]></content:encoded>
			<wfw:commentRss>http://www.sajithmr.me/xajax/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Server Migration</title>
		<link>http://www.sajithmr.me/server-migration</link>
		<comments>http://www.sajithmr.me/server-migration#comments</comments>
		<pubDate>Tue, 02 Sep 2008 08:58:42 +0000</pubDate>
		<dc:creator>Mr Me</dc:creator>
				<category><![CDATA[general]]></category>
		<category><![CDATA[cdn]]></category>
		<category><![CDATA[design]]></category>
		<category><![CDATA[migration]]></category>
		<category><![CDATA[picdn]]></category>
		<category><![CDATA[sajith]]></category>
		<category><![CDATA[sajithmr.com]]></category>
		<category><![CDATA[server]]></category>

		<guid isPermaLink="false">http://www.sajithmr.com/server-migration/</guid>
		<description><![CDATA[I was finding that my visitor count is increasing and alexa ranking of www.sajithmr.com is now well below 100,000 So I decided to change my old Cpanel hosting to a professional content delivery network who can provide me the scalability that www.sajithmr.com may demand in the future . After much research i ended up with [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.picdn.com" title="PiCDN" target="_blank"><img src="http://www.sajithmr.com/wp-content/uploads/2008/09/white-green.jpg" alt="piCDN" /></a></p>
<p>I was finding that my visitor count is increasing and alexa ranking of <a href="http://www.sajithmr.com" target="_blank">www.sajithmr.com</a> is now well below 100,000</p>
<p>So I decided to change my old Cpanel hosting to a professional content delivery network who can provide me the scalability that <a href="http://sajithmr.com/" target="_blank">www.sajithmr.com</a> may demand in the future . After much research i ended up with<strong><font color="#ff0000"><a href="http://www.picdn.com" title="piCDN" target="_blank"> PiCDN</a><a href="http://picdn.com" title="PiCDN" target="_blank"></a></font></strong> who provide affordable CDN service<br />
The following are the changes that the new hosting offers me:</p>
<p>They use a different web server than apache . I found that it was <strong>nginx</strong> and it seems its the rising star in web servers</p>
<p>I dumped my old cpanel mail to  Google Mail for domains &#8211; Picdn integrates it with fully and it got only minutes to get me running <img src='http://www.sajithmr.me/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>I have ssh access to my account !. Occassionally i can do cleanup jobs and have more flexibility than a FTP account. Besides picdn people claim it more secure</p>
<p>These are their features (copied from <a href="http://picdn.com/" target="_blank">http://www.picdn.com</a>)</p>
<ul>
<li><span style="font-size: small">Highly scalable hosting infrastructure</span></li>
<li><span style="font-size: small">Asynchronous web server<br />
</span></li>
<li><span style="font-size: small">Geo-distributed fault tolerant nameservers</span></li>
<li><span style="font-size: small">PHP ready<br />
</span></li>
<li><span style="font-size: small">Dedicated fine tuned MySQL database server</span></li>
<li><span style="font-size: small">Geo-aware redirection of users to the nearest cache/node</span></li>
<li><span style="font-size: small">SFTP /SSH/RSYNC publishing access</span></li>
<li><span style="font-size: small">Allows plugging in of other Application servers and content processing servers</span></li>
<li><span style="font-size: small">Google Mail for Domains Ready</span></li>
</ul>
<p>I am fully satisfied with my new host and plan to move over <a href="http://amvizone.com/" target="_blank">http://www.amvizone.com</a> to them soon</p>
<p>So Sajithmr.com is now in new server with new design (home page only ), have a look at: <a href="http://www.sajithmr.com/" title="Sajith">http://www.sajithmr.com </a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.sajithmr.me/server-migration/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

