<?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>InstaCarma Blog &#187; PHP</title>
	<atom:link href="http://www.instacarma.com/blog/tag/PHP/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.instacarma.com/blog</link>
	<description>Information Resource for Web Hosting Technical Support and Server Management</description>
	<lastBuildDate>Tue, 24 May 2011 10:01:02 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2</generator>
		<item>
		<title>How to enable SuPHP ?</title>
		<link>http://www.instacarma.com/blog/technical/how-to-enable-suphp/</link>
		<comments>http://www.instacarma.com/blog/technical/how-to-enable-suphp/#comments</comments>
		<pubDate>Thu, 04 Mar 2010 20:20:02 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Quick fixes]]></category>
		<category><![CDATA[Technical]]></category>
		<category><![CDATA[apache]]></category>
		<category><![CDATA[cPanel]]></category>
		<category><![CDATA[easyapache]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[suexec]]></category>
		<category><![CDATA[suphp]]></category>
		<category><![CDATA[WHM]]></category>

		<guid isPermaLink="false">http://instacarma.com/blog/?p=1182</guid>
		<description><![CDATA[Filed under: apache, cPanel, easyapache, PHP, suexec, suphp, WHM Issue : How to enable SuPHP ? Solution : Login to WHM. Go to &#8220;Service Configuration >> Apache Configuration >> Configure PHP and Suexec&#8221; and check if SuPHP is available in the drop down menu. If it is available then select it and save the configuration [...]]]></description>
			<content:encoded><![CDATA[<p>Filed under: <a href='http://www.instacarma.com/blog/tag/apache/'>apache</a>, <a href='http://www.instacarma.com/blog/tag/cpanel/'>cPanel</a>, <a href='http://www.instacarma.com/blog/tag/easyapache/'>easyapache</a>, <a href='http://www.instacarma.com/blog/tag/php/'>PHP</a>, <a href='http://www.instacarma.com/blog/tag/suexec/'>suexec</a>, <a href='http://www.instacarma.com/blog/tag/suphp/'>suphp</a>, <a href='http://www.instacarma.com/blog/tag/whm/'>WHM</a></p>
<p><strong>Issue :</strong></p>
<p>How to enable SuPHP ?</p>
<p><strong>Solution : </strong></p>
<p>Login to WHM.</p>
<p>Go to  &#8220;Service Configuration >> Apache Configuration >> Configure PHP and Suexec&#8221; and check if SuPHP is available in the drop down menu. If it is available then select it and save the configuration after a dry run.<br />
SuExec should also be available in the same drop down with an on/off option. </p>
<p>If SuPHP is not available then you need to run EasyApache via &#8220;WHM >> Software >> EasyApache (Apache Update)&#8221; and select SuPHP in the available options. You can also run EasyApache via console by using the following cPanel scipt : </p>
<blockquote><p>
/scripts/easyapache</p></blockquote>
<div class="alignright"><div class="g-plusone" data-href="http://www.instacarma.com/blog/technical/how-to-enable-suphp/" size="standard" count="true"></div></div>]]></content:encoded>
			<wfw:commentRss>http://www.instacarma.com/blog/technical/how-to-enable-suphp/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Security concerns in executing binary files</title>
		<link>http://www.instacarma.com/blog/technical/security-concerns-in-executing-binary-files/</link>
		<comments>http://www.instacarma.com/blog/technical/security-concerns-in-executing-binary-files/#comments</comments>
		<pubDate>Mon, 18 Jan 2010 23:18:15 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Quick fixes]]></category>
		<category><![CDATA[Technical]]></category>
		<category><![CDATA[apache]]></category>
		<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://instacarma.com/blog/?p=1079</guid>
		<description><![CDATA[Filed under: apache, PHP Issue : An application requires execution of a binary file. A separate account has been created but do not want to turn on the exec() function citing security concerns. What is the best way to go about this ? Solution : If it is a php suexec server then you can [...]]]></description>
			<content:encoded><![CDATA[<p>Filed under: <a href='http://www.instacarma.com/blog/tag/apache/'>apache</a>, <a href='http://www.instacarma.com/blog/tag/php/'>PHP</a></p>
<p><strong>Issue : </strong></p>
<p>An application requires execution of a binary file. A separate account has been created but do not want to turn on the exec() function citing security concerns. What is the best way to go about this ?</p>
<p><strong>Solution : </strong></p>
<p>If it is a php suexec server then you can place a custom php.ini file under the concerned folder in the account created. Copy the content from the server php.ini but remove the required function from the &#8216;disable_function&#8217; list in the custom php.ini. This will affect only the account and not the entire server.</p>
<p>If it is not a php suexec server then place the following code in the VirtualHost entry for the domain and restart apache.</p>
<blockquote><p>< IfModule mod_php5.c ><br />
php_admin_value disable_functions &#8221; &#8221;<br />
< /IfModule ></p></blockquote>
<p>Include the functions that you want to keep disabled for the account within the quotes in the above code.</p>
<div class="alignright"><div class="g-plusone" data-href="http://www.instacarma.com/blog/technical/security-concerns-in-executing-binary-files/" size="standard" count="true"></div></div>]]></content:encoded>
			<wfw:commentRss>http://www.instacarma.com/blog/technical/security-concerns-in-executing-binary-files/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Compiling PHP5 with IMAP support on a LiteSpeed server</title>
		<link>http://www.instacarma.com/blog/technical/compiling-php5-with-imap-support-on-litespeed-server/</link>
		<comments>http://www.instacarma.com/blog/technical/compiling-php5-with-imap-support-on-litespeed-server/#comments</comments>
		<pubDate>Tue, 27 Oct 2009 22:54:11 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Articles and tutorials]]></category>
		<category><![CDATA[Technical]]></category>
		<category><![CDATA[imap]]></category>
		<category><![CDATA[litespeed]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[php5]]></category>

		<guid isPermaLink="false">http://instacarma.com/blog/?p=928</guid>
		<description><![CDATA[Filed under: imap, litespeed, PHP, php5 Tutorial on how-to compile php5 with imap support on a litespeed server Step 1 : Install imap Here are the required steps : root@server []#cd /usr/src root@server []#wget ftp://ftp.cac.washington.edu/imap/imap.tar.gz root@server []#tar -xzvf imap.tar.gz root@server []#cd imap-2007e root@server []#make lfd root@server []#mkdir /usr/local/imap root@server []#cp -prf c-client/ /usr/local/imap Step 2 [...]]]></description>
			<content:encoded><![CDATA[<p>Filed under: <a href='http://www.instacarma.com/blog/tag/imap/'>imap</a>, <a href='http://www.instacarma.com/blog/tag/litespeed/'>litespeed</a>, <a href='http://www.instacarma.com/blog/tag/php/'>PHP</a>, <a href='http://www.instacarma.com/blog/tag/php5/'>php5</a></p>
<p><strong>Tutorial on how-to compile php5 with imap support on a litespeed server</strong></p>
<p><strong>Step 1 : Install imap</strong></p>
<p>Here are the required steps :</p>
<blockquote><p>root@server []#cd /usr/src</p>
<p>root@server []#wget  ftp://ftp.cac.washington.edu/imap/imap.tar.gz</p>
<p>root@server []#tar -xzvf imap.tar.gz</p>
<p>root@server []#cd imap-2007e</p>
<p>root@server []#make lfd</p>
<p>root@server []#mkdir /usr/local/imap</p>
<p>root@server []#cp -prf c-client/ /usr/local/imap</p></blockquote>
<p><strong><br />
Step 2 : Recompile php with the options <em> &#8211;with-imap=/usr/local/imap</em> and  <em>&#8211;with-imap-ssl</em></strong></p>
<p>Here are the steps for recompiling php on a litespeed server:</p>
<p>1) Download the source for php5  from http://www.php.net/downloads.php.</p>
<blockquote><p>
root@server [/opt]# wget http://us3.php.net/get/php-5.2.6.tar.gz/from/us2.php.net/mirror</p>
<p>root@server [/opt]# tar -zxf php-5.2.6.tar.gz</p></blockquote>
<p>2) Change the directory  to php-source/sapi directory.</p>
<blockquote><p>root@server [/opt]# cd php-5.2.6/sapi</p></blockquote>
<p>3) Download  the latest  LSAPI for PHP from http://www.litespeedtech.com.</p>
<blockquote><p>root@server [/opt/php-5.2.6/sapi]wget http://www.litespeedtech.com/packages/lsapi/php-litespeed-4.7.tgz</p>
<p>root@server [/opt/php-5.2.6/sapi]tar -zxf php-litespeed-4.7.tgz</p></blockquote>
<p>4) Change the directory to root PHP source directory and run the following commands:</p>
<blockquote><p>root@server [/opt/php-5.2.6]cd ..<br />
root@server [/opt/php-5.2.6]touch ac*<br />
root@server [/opt/php-5.2.6]./buildconf &#8211;force
</p></blockquote>
<p>5) Configure/Compile PHP</p>
<blockquote><p>./configure &#8211;prefix=/opt/lsws/lsphp5 &#8211;enable-shmop &#8211;enable-sysvsem &#8211;enable-sysvshm &#8211;enable-magic-quotes &#8211;enable-mbstring &#8211;with-iconv &#8211;exec-prefix=/usr &#8211;bindir=/usr/bin &#8211;sbindir=/usr/sbin &#8211;with-config-file-path=/usr/lib/php &#8211;with-litespeed &#8211;with-xml &#8211;with-curl=/usr &#8211;enable-ftp &#8211;with-gd &#8211;with-jpeg-dir=/usr/ &#8211;with-png-dir=/usr &#8211;with-xpm-dir=/usr/X11R6 &#8211;enable-memory-limit &#8211;with-mysqli &#8211;with-mysql=/usr &#8211;with-openssl &#8211;enable-discard-path &#8211;enable-sockets &#8211;enable-track-vars &#8211;with-ttf &#8211;with-freetype-dir=/usr &#8211;enable-gd-native-ttf &#8211;disable-json &#8211;disable-pdo &#8211;without-iconv &#8211;without-sqlite &#8211;with-zlib &#8211;enable-pcntl &#8211;enable-memcache &#8211;with-imap=/usr/local/imap &#8211;with-imap-ssl</p></blockquote>
<p><strong>Step 3 :</strong> Take a backup of the existing lsphp5 binary located in the  /opt/lsws/fcgi-bin/ directory </p>
<blockquote><p>root@server [/opt/lsws/fcgi-bin]# ll<br />
===========================================<br />
-r-xr-xr-x  1 root root    2031800 Sep  3  2008 lsphp*<br />
lrwxrwxrwx  1 root root          7 Sep  3  2008 lsphp4 -> ./lsphp*<br />
lrwxrwxrwx  1 root nobody       13 Sep  7  2008 lsphp5 -> ./lsphp-5.2.6*<br />
-rwxr-xr-x  1 root nobody 15762131 Sep  6  2008 lsphp-5.2.6*<br />
============================================<br />
root@server [/opt/lsws/fcgi-bin]#mv lsphp-5.2.5 lsphp-5.2.5.bkp</p></blockquote>
<p><strong>Step 4 :</strong> Copy the the php binary from   /opt//opt/php-5.2.6/sapi/litespeed/php to  /opt/lsws/fcgi-bin/ </p>
<blockquote><p>root@server[/opt/lsws/fcgi-bin]#cp -p  /opt/php-5.2.6/sapi/litespeed/php /opt/lsws/fcgi-bin</p></blockquote>
<p><strong>Step 5 :</strong> Rename the php binary to lsphp-5.2.6</p>
<blockquote><p>
root@server [/opt/lsws/fcgi-bin]#mv php lsphp-5.2.6</p></blockquote>
<p><strong>Step 6 :</strong> Change the ownership and restart Apache.</p>
<blockquote><p>root@server [/opt/lsws/fcgi-bin]# chown root.nobody lsphp-5.2.6</p>
<p>root@server [/opt/lsws/fcgi-bin]#/scripts/restartsrv_httpd</p></blockquote>
<p>Thats it! You should be all set now.</p>
<div class="alignright"><div class="g-plusone" data-href="http://www.instacarma.com/blog/technical/compiling-php5-with-imap-support-on-litespeed-server/" size="standard" count="true"></div></div>]]></content:encoded>
			<wfw:commentRss>http://www.instacarma.com/blog/technical/compiling-php5-with-imap-support-on-litespeed-server/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Upload failed despite having custom php.ini</title>
		<link>http://www.instacarma.com/blog/technical/upload-failed-despite-having-custom-php-ini/</link>
		<comments>http://www.instacarma.com/blog/technical/upload-failed-despite-having-custom-php-ini/#comments</comments>
		<pubDate>Wed, 21 Oct 2009 18:00:10 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Quick fixes]]></category>
		<category><![CDATA[Technical]]></category>
		<category><![CDATA[cPanel]]></category>
		<category><![CDATA[filemanager]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[WHM]]></category>

		<guid isPermaLink="false">http://instacarma.com/blog/?p=921</guid>
		<description><![CDATA[Filed under: cPanel, filemanager, PHP, WHM Issue : A 5 MB file cannot be uploaded via cPanel&#8217;s File Manager even though there is a custom php.ini in place with upload_max_filesize and post_max_size set to 10 MB. Solution : To alter the maximum file size for files uploaded via cPanel&#8217;s File Manager, you must use the [...]]]></description>
			<content:encoded><![CDATA[<p>Filed under: <a href='http://www.instacarma.com/blog/tag/cpanel/'>cPanel</a>, <a href='http://www.instacarma.com/blog/tag/filemanager/'>filemanager</a>, <a href='http://www.instacarma.com/blog/tag/php/'>PHP</a>, <a href='http://www.instacarma.com/blog/tag/whm/'>WHM</a></p>
<p><strong>Issue : </strong></p>
<p>A 5 MB file cannot be uploaded via cPanel&#8217;s File Manager even though there is a custom <em>php.ini </em> in place with <em>upload_max_filesize</em> and <em>post_max_size</em> set to 10 MB.</p>
<p><strong>Solution : </strong></p>
<p>To alter the maximum file size for files uploaded via cPanel&#8217;s File Manager, you must use the following Tweak Setting in WHM:</p>
<p>WHM >> Tweak Settings >> System<br />
<strong>The maximum file size in MB allowed for upload through cPanel File manager. Use &#8220;unlimited&#8221; for unlimited</strong></p>
<p>Note: <em>upload_max_filesize</em> and <em>post_max_size</em> in <em>php.ini</em> are different.</p>
<div class="alignright"><div class="g-plusone" data-href="http://www.instacarma.com/blog/technical/upload-failed-despite-having-custom-php-ini/" size="standard" count="true"></div></div>]]></content:encoded>
			<wfw:commentRss>http://www.instacarma.com/blog/technical/upload-failed-despite-having-custom-php-ini/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>PHP 5.2.11 released !</title>
		<link>http://www.instacarma.com/blog/technical/php-5-2-11-released/</link>
		<comments>http://www.instacarma.com/blog/technical/php-5-2-11-released/#comments</comments>
		<pubDate>Fri, 18 Sep 2009 17:20:48 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Articles and tutorials]]></category>
		<category><![CDATA[Technical]]></category>
		<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://instacarma.com/blog/?p=859</guid>
		<description><![CDATA[Filed under: PHP The PHP development team has announced the release of PHP 5.2.11. This release comes with over 60 bug fixes . Some of these were security related as well. This release is intended to increase the stability of PHP 5.2.x. Official release notes are available here .]]></description>
			<content:encoded><![CDATA[<div class="sticky_post"><p>Filed under: <a href='http://www.instacarma.com/blog/tag/php/'>PHP</a></p>
<p>The PHP development team has announced the release of PHP 5.2.11. This release comes with over 60 bug fixes . Some of these were security related as well. This release is intended to increase the stability of PHP 5.2.x. </p>
<p>Official release notes are available <a href="http://www.php.net/releases/5_2_11.php">here</a> .</p>
</div>
<div class="alignright"><div class="g-plusone" data-href="http://www.instacarma.com/blog/technical/php-5-2-11-released/" size="standard" count="true"></div></div>]]></content:encoded>
			<wfw:commentRss>http://www.instacarma.com/blog/technical/php-5-2-11-released/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Enabling the PHP extension&#8211;FreeType</title>
		<link>http://www.instacarma.com/blog/technical/enabling-the-php-extension-freetype/</link>
		<comments>http://www.instacarma.com/blog/technical/enabling-the-php-extension-freetype/#comments</comments>
		<pubDate>Tue, 15 Sep 2009 20:34:18 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Quick fixes]]></category>
		<category><![CDATA[Technical]]></category>
		<category><![CDATA[apache]]></category>
		<category><![CDATA[cPanel]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[WHM]]></category>

		<guid isPermaLink="false">http://instacarma.com/blog/?p=840</guid>
		<description><![CDATA[Filed under: apache, cPanel, PHP, WHM Issue : How to enable the PHP extension&#8211;FreeType on a server running cPanel/WHM and apache? Solution : You need to re-compile apache and php with freetype . This can be done via the command line or through WHM. Command line : Run /scripts/easyapache and select &#8220;ttf&#8221; for freetype. WHM: [...]]]></description>
			<content:encoded><![CDATA[<p>Filed under: <a href='http://www.instacarma.com/blog/tag/apache/'>apache</a>, <a href='http://www.instacarma.com/blog/tag/cpanel/'>cPanel</a>, <a href='http://www.instacarma.com/blog/tag/php/'>PHP</a>, <a href='http://www.instacarma.com/blog/tag/whm/'>WHM</a></p>
<p><strong>Issue : </strong></p>
<p>How to enable the PHP extension&#8211;FreeType on a server running cPanel/WHM and apache?</p>
<p><strong>Solution : </strong></p>
<p>You need to re-compile apache and php with freetype . This can be done via the command line or through WHM.</p>
<p><em>Command line : </em><br />
Run <em>/scripts/easyapache</em> and select &#8220;ttf&#8221; for freetype.</p>
<p><em>WHM:</em><br />
You can enable freetype via WHM >> software >> Apache Update >> Load Previous Config and select TTF(FreeType)<br />
Start Build</p>
<div class="alignright"><div class="g-plusone" data-href="http://www.instacarma.com/blog/technical/enabling-the-php-extension-freetype/" size="standard" count="true"></div></div>]]></content:encoded>
			<wfw:commentRss>http://www.instacarma.com/blog/technical/enabling-the-php-extension-freetype/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Permission issues with suphp+suexec</title>
		<link>http://www.instacarma.com/blog/technical/permission-issues-with-suphpsuexec/</link>
		<comments>http://www.instacarma.com/blog/technical/permission-issues-with-suphpsuexec/#comments</comments>
		<pubDate>Sat, 05 Sep 2009 18:37:29 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Quick fixes]]></category>
		<category><![CDATA[Technical]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[suphp]]></category>

		<guid isPermaLink="false">http://instacarma.com/blog/?p=804</guid>
		<description><![CDATA[Filed under: PHP, suphp Issue : When migrating from a server NOT running suphp &#038; suexec to a server running these, permission issues occur . For example, directories which are chmoded to 777 would not be compatible. Solution : You can use the following commands to change the permissions : find /home/*/public_html -type d -perm [...]]]></description>
			<content:encoded><![CDATA[<p>Filed under: <a href='http://www.instacarma.com/blog/tag/php/'>PHP</a>, <a href='http://www.instacarma.com/blog/tag/suphp/'>suphp</a></p>
<p><strong>Issue : </strong></p>
<p>When migrating from a server NOT running  suphp &#038; suexec to a server running these, permission issues occur .<br />
For example, directories which are chmoded to 777 would not be compatible.</p>
<p><strong>Solution : </strong></p>
<p>You can use the following commands to change the permissions : </p>
<blockquote><p>find /home/*/public_html -type d -perm 0777 -exec chmod 755 {} \;</p></blockquote>
<p>This checks for directories with 0777 permissions and chmods them to 0755.</p>
<blockquote><p>find /home/*/public_html -type f -perm 0666 -exec chmod 644 {} \;<br />
find /home/*/public_html -type f -perm 0777 -exec chmod 644 {} \;</p></blockquote>
<p>These check for files with 0666 and 0777 permissions respectively and changes them to 0644</p>
<p><em>Note </em>: Another thing to remember is the change in PHP directives. These can no longer be applied in a .htaccess file and will need to be moved (and in some cases syntax needs to be changed) into a php.ini file within your users&#8217; web folder.</p>
<div class="alignright"><div class="g-plusone" data-href="http://www.instacarma.com/blog/technical/permission-issues-with-suphpsuexec/" size="standard" count="true"></div></div>]]></content:encoded>
			<wfw:commentRss>http://www.instacarma.com/blog/technical/permission-issues-with-suphpsuexec/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Cannot upload unless permissions are set to 777</title>
		<link>http://www.instacarma.com/blog/technical/cannot-upload-unless-permissions-are-set-to-777/</link>
		<comments>http://www.instacarma.com/blog/technical/cannot-upload-unless-permissions-are-set-to-777/#comments</comments>
		<pubDate>Sun, 23 Aug 2009 15:38:49 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Quick fixes]]></category>
		<category><![CDATA[Technical]]></category>
		<category><![CDATA[apache]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[wordpress]]></category>

		<guid isPermaLink="false">http://instacarma.com/blog/?p=777</guid>
		<description><![CDATA[Filed under: apache, PHP, wordpress Issue : WordPress installed on a cPanel server. Cannot upload images using WP unless the &#8220;uploads&#8221; directory is set to &#8220;777&#8243; which poses serious security threats. Solution : The reason is that WordPress is running PHP as a DSO (Apache Module) which insecurely runs all scripts commonly under the global [...]]]></description>
			<content:encoded><![CDATA[<p>Filed under: <a href='http://www.instacarma.com/blog/tag/apache/'>apache</a>, <a href='http://www.instacarma.com/blog/tag/php/'>PHP</a>, <a href='http://www.instacarma.com/blog/tag/wordpress/'>wordpress</a></p>
<p><strong>Issue : </strong></p>
<p>WordPress installed on a cPanel server.<br />
Cannot upload images using WP unless the &#8220;uploads&#8221; directory is set to &#8220;777&#8243; which poses serious security threats.</p>
<p><strong>Solution : </strong></p>
<p>The reason is that  WordPress is running PHP as a DSO (Apache Module) which insecurely runs all scripts commonly under the global username &#8220;nobody&#8221;.</p>
<p>Since your WordPress application is being run as &#8220;nobody&#8221; instead of your own login name, you must have GLOBAL readable permissions minimum. Hence, you need 777 permissions.<br />
The only way to get around this is to have  SuPHP based PHP which doesn&#8217;t have these types of security issues.</p>
<p>Note : Under SuPHP you could go as extremely tight as 400 and the typical norm is 640 for most uses. Folders are typically 750 or 755.</p>
<div class="alignright"><div class="g-plusone" data-href="http://www.instacarma.com/blog/technical/cannot-upload-unless-permissions-are-set-to-777/" size="standard" count="true"></div></div>]]></content:encoded>
			<wfw:commentRss>http://www.instacarma.com/blog/technical/cannot-upload-unless-permissions-are-set-to-777/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>500 error when using php_value/php_flag</title>
		<link>http://www.instacarma.com/blog/technical/500-error-when-using-php_valuephp_flag/</link>
		<comments>http://www.instacarma.com/blog/technical/500-error-when-using-php_valuephp_flag/#comments</comments>
		<pubDate>Thu, 20 Aug 2009 15:47:47 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Quick fixes]]></category>
		<category><![CDATA[Technical]]></category>
		<category><![CDATA[apache]]></category>
		<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://instacarma.com/blog/?p=760</guid>
		<description><![CDATA[Filed under: apache, PHP Issue : When trying to turn &#8216;register_globals&#8217; ON by adding a statement &#8220;php_flag register_globals on &#8221; in the .htaccess, following error appears on the website: &#8220;A 500 Internal Server Error error was encountered while trying to use an ErrorDocument to handle the request&#8221; Apache error log says: .htaccess: Invalid command &#8216;php_flag&#8217;, [...]]]></description>
			<content:encoded><![CDATA[<p>Filed under: <a href='http://www.instacarma.com/blog/tag/apache/'>apache</a>, <a href='http://www.instacarma.com/blog/tag/php/'>PHP</a></p>
<p><strong>Issue : </strong></p>
<p>When trying  to turn &#8216;register_globals&#8217; ON by adding a statement &#8220;php_flag register_globals on &#8221; in the .htaccess, following error  appears on the website:<br />
<em>&#8220;A 500 Internal Server Error error was encountered while trying to use an ErrorDocument to handle the request&#8221; </em><br />
Apache error log says:<br />
<em>.htaccess: Invalid command &#8216;php_flag&#8217;, perhaps mis-spelled or defined by a module not included in the server configuration </em></p>
<p><strong>Solution : </strong></p>
<p>Basically the  error message occurs because of suPHP being enabled on  the server due to which you can&#8217;t define the php values in .htaccess file. But you can manage php values by  using a custom php.ini  in each directory where you want the changes to take effect.</p>
<p>For example, if you want to enable the register_globals for the domain name &#8216;test.com&#8217; , then you need to create a &#8216;php.ini&#8217; file under the public_html folder with the content &#8220;register_globals = On&#8221;. It will enable the register_globals for that particular folder.</p>
<div class="alignright"><div class="g-plusone" data-href="http://www.instacarma.com/blog/technical/500-error-when-using-php_valuephp_flag/" size="standard" count="true"></div></div>]]></content:encoded>
			<wfw:commentRss>http://www.instacarma.com/blog/technical/500-error-when-using-php_valuephp_flag/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Logging in to PHPMyAdmin directly</title>
		<link>http://www.instacarma.com/blog/technical/logging-in-to-phpmyadmin-directly/</link>
		<comments>http://www.instacarma.com/blog/technical/logging-in-to-phpmyadmin-directly/#comments</comments>
		<pubDate>Tue, 18 Aug 2009 16:33:37 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Quick fixes]]></category>
		<category><![CDATA[Technical]]></category>
		<category><![CDATA[Mysql]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[phpmyadmin]]></category>

		<guid isPermaLink="false">http://instacarma.com/blog/?p=742</guid>
		<description><![CDATA[Filed under: Mysql, PHP, phpmyadmin Issue : How to login to PHPMyAdmin directly (without logging in to the cPanel interface) ? Solution : This can be achieved by the following steps : First, download and untar the latest version in to your public_html folder. wget http://downloads.sourceforge.net/project/phpmyadmin/phpMyAdmin/2.11.9.5/phpMyAdmin-2.11.9.5-english.tar.gz tar -zxvf phpMyAdmin-2.11.9.5-english.tar.gz cd phpMyAdmin-2.11.9.5-english mv phpMyAdmin-2.11.9.5-english phpMyAdmin Then, [...]]]></description>
			<content:encoded><![CDATA[<p>Filed under: <a href='http://www.instacarma.com/blog/tag/mysql/'>Mysql</a>, <a href='http://www.instacarma.com/blog/tag/php/'>PHP</a>, <a href='http://www.instacarma.com/blog/tag/phpmyadmin/'>phpmyadmin</a></p>
<p><strong>Issue : </strong></p>
<p>How to login to PHPMyAdmin directly (without logging in to the cPanel interface) ?</p>
<p><strong>Solution : </strong></p>
<p>This can be achieved by the following steps :</p>
<p>First, download and untar the latest version in to your public_html folder.</p>
<blockquote><p>wget http://downloads.sourceforge.net/project/phpmyadmin/phpMyAdmin/2.11.9.5/phpMyAdmin-2.11.9.5-english.tar.gz<br />
tar -zxvf phpMyAdmin-2.11.9.5-english.tar.gz<br />
cd phpMyAdmin-2.11.9.5-english<br />
mv phpMyAdmin-2.11.9.5-english phpMyAdmin</p></blockquote>
<p>Then, create a file named <em>config.inc.php</em> and put the following entries in it .</p>
<blockquote><p>vi config.inc.php<br />
&#8212;&#8212;&#8212;<br />
<?php</p>
<p>$i=0;<br />
$i++;<br />
$cfg['Servers'][$i]['user']          = 'example_test'; //database username<br />
$cfg['Servers'][$i]['password']      = 'qazplm123'; // use here your password<br />
$cfg['Servers'][$i]['auth_type']     = 'config';<br />
?><br />
&#8212;&#8212;&#8212;-</p></blockquote>
<p>Now, you would be able to access it as http://domainname.com/phpmyadmin</p>
<p>For more details on this , please refer <a href="http://www.aota.net/PHP_and_MySQL/phpmyadmin.php4">this.</a></p>
<div class="alignright"><div class="g-plusone" data-href="http://www.instacarma.com/blog/technical/logging-in-to-phpmyadmin-directly/" size="standard" count="true"></div></div>]]></content:encoded>
			<wfw:commentRss>http://www.instacarma.com/blog/technical/logging-in-to-phpmyadmin-directly/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Using multiple PHP versions</title>
		<link>http://www.instacarma.com/blog/technical/using-multiple-php-versions/</link>
		<comments>http://www.instacarma.com/blog/technical/using-multiple-php-versions/#comments</comments>
		<pubDate>Sat, 15 Aug 2009 16:33:15 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Quick fixes]]></category>
		<category><![CDATA[Technical]]></category>
		<category><![CDATA[cPanel]]></category>
		<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://instacarma.com/blog/?p=720</guid>
		<description><![CDATA[Filed under: cPanel, PHP Issue : How to install multiple versions of PHP and make one of them default? Also, how can the users choose the desired version? Solution : Installing and configuring concurrent PHP can be done by going to WHM -> Software -> EasyApache and when prompted for which version of PHP to [...]]]></description>
			<content:encoded><![CDATA[<p>Filed under: <a href='http://www.instacarma.com/blog/tag/cpanel/'>cPanel</a>, <a href='http://www.instacarma.com/blog/tag/php/'>PHP</a></p>
<p><strong>Issue : </strong><br />
How to install multiple versions of PHP and make one of them default? Also, how can the users choose the desired version?<br />
<strong><br />
Solution : </strong><br />
Installing and configuring concurrent PHP can be done by going to WHM -> Software -> EasyApache and when prompted for which version of PHP to run, select both PHP 4 and PHP 5. After the compile process is completed, you will be prompted for which PHP version should be default.<br />
cPanel users can set up which version of PHP to use by going to the PHP Configuration screen in their cPanel interface. This affects all domains under their account.</p>
<div class="alignright"><div class="g-plusone" data-href="http://www.instacarma.com/blog/technical/using-multiple-php-versions/" size="standard" count="true"></div></div>]]></content:encoded>
			<wfw:commentRss>http://www.instacarma.com/blog/technical/using-multiple-php-versions/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Disabling PHP shell functions</title>
		<link>http://www.instacarma.com/blog/technical/disabling-php-shell-functions/</link>
		<comments>http://www.instacarma.com/blog/technical/disabling-php-shell-functions/#comments</comments>
		<pubDate>Thu, 13 Aug 2009 17:49:03 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Quick fixes]]></category>
		<category><![CDATA[Technical]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[ssh]]></category>

		<guid isPermaLink="false">http://instacarma.com/blog/?p=712</guid>
		<description><![CDATA[Filed under: PHP, ssh Issue : All PHP shell functions need to be stopped. Solution : 1. Locate the php.ini file php -i &#124; grep php.ini 2. Open it with your favorite editor and put the following : disable_functions = &#8221; &#8220; Or add functions that you want to disable.]]></description>
			<content:encoded><![CDATA[<p>Filed under: <a href='http://www.instacarma.com/blog/tag/php/'>PHP</a>, <a href='http://www.instacarma.com/blog/tag/ssh/'>ssh</a></p>
<p><strong>Issue : </strong></p>
<p>All PHP shell functions need to be stopped.</p>
<p><strong>Solution : </strong></p>
<p>1. Locate the <em>php.ini</em> file </p>
<blockquote><p>php -i | grep php.ini</p></blockquote>
<p>2. Open it with your favorite editor and put the following :</p>
<blockquote><p>disable_functions = &#8221; &#8220;</p></blockquote>
<p>Or add functions that you want to disable.</p>
<div class="alignright"><div class="g-plusone" data-href="http://www.instacarma.com/blog/technical/disabling-php-shell-functions/" size="standard" count="true"></div></div>]]></content:encoded>
			<wfw:commentRss>http://www.instacarma.com/blog/technical/disabling-php-shell-functions/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Preserving httpd.conf during EasyApache</title>
		<link>http://www.instacarma.com/blog/technical/preserving-httpd-conf-during-easyapache/</link>
		<comments>http://www.instacarma.com/blog/technical/preserving-httpd-conf-during-easyapache/#comments</comments>
		<pubDate>Mon, 03 Aug 2009 20:13:32 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Quick fixes]]></category>
		<category><![CDATA[Technical]]></category>
		<category><![CDATA[apache]]></category>
		<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://instacarma.com/blog/?p=702</guid>
		<description><![CDATA[Filed under: apache, PHP Issue : The apache configuration file (httpd.conf) has several custom entries which should not be over-written when an EasyApache is done for recompiling/adding a PHP/Apache extension. Solution : Starting with cPanel 11.x, all the apache settings are also stored in a database and the configuration files are recreated each time an [...]]]></description>
			<content:encoded><![CDATA[<p>Filed under: <a href='http://www.instacarma.com/blog/tag/apache/'>apache</a>, <a href='http://www.instacarma.com/blog/tag/php/'>PHP</a></p>
<p><strong>Issue : </strong></p>
<p>The apache configuration file (httpd.conf) has several custom entries which should not be over-written when an EasyApache is done for recompiling/adding a PHP/Apache extension.</p>
<p><strong>Solution : </strong></p>
<p>Starting with cPanel 11.x, all the apache settings are also stored in a database and the configuration files are recreated each time an account is added or a recompile is done.</p>
<p>To also save the changes in the database you will have to run:</p>
<blockquote><p>/usr/local/cpanel/bin/apache_conf_distiller –update</p></blockquote>
<p>You can check to see if the changes were accepted and will not be discarded at the next apache recompile by running :</p>
<blockquote><p>/usr/local/cpanel/bin/build_apache_conf </p></blockquote>
<div class="alignright"><div class="g-plusone" data-href="http://www.instacarma.com/blog/technical/preserving-httpd-conf-during-easyapache/" size="standard" count="true"></div></div>]]></content:encoded>
			<wfw:commentRss>http://www.instacarma.com/blog/technical/preserving-httpd-conf-during-easyapache/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>&#8220;Fatal error: Allowed memory size of 8388608 bytes exhausted&#8221;</title>
		<link>http://www.instacarma.com/blog/technical/620/</link>
		<comments>http://www.instacarma.com/blog/technical/620/#comments</comments>
		<pubDate>Fri, 10 Jul 2009 20:04:04 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Quick fixes]]></category>
		<category><![CDATA[Technical]]></category>
		<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://instacarma.com/blog/?p=620</guid>
		<description><![CDATA[Filed under: PHP Issue : Error: &#8220;Fatal error: Allowed memory size of 8388608 bytes exhausted (tried to allocate 77824 bytes) in /home/ivonson/public_html/wp-content/plugins/revver/xmlrpc-2_2/xmlrpc.inc on line 2551&#8243; Fix : You need to adjust the value of &#8216;memory_limit&#8217; accordingly. If you have &#8216;root&#8217; access to the server then you can alter the value for &#8216;memory_limit&#8217; : 1. Either [...]]]></description>
			<content:encoded><![CDATA[<p>Filed under: <a href='http://www.instacarma.com/blog/tag/php/'>PHP</a></p>
<p><strong>Issue : </strong></p>
<p>Error:<em> &#8220;Fatal error: Allowed memory size of 8388608 bytes exhausted (tried to allocate 77824 bytes) in /home/ivonson/public_html/wp-content/plugins/revver/xmlrpc-2_2/xmlrpc.inc on line 2551&#8243;</em></p>
<p><strong>Fix : </strong></p>
<p>You need to adjust the value of &#8216;memory_limit&#8217; accordingly. If you have &#8216;root&#8217; access to the server then you can  alter the value for &#8216;memory_limit&#8217; :</p>
<p>1. Either by editing the server php.ini through console; or<br />
2. Editing it through WHM > Service Configuration > PHP Configuration Editor</p>
<p>If you do not have &#8216;root&#8217; access to the server then you can try to place a custom php.ini in the directory where the particular script is located. This would override the server php.ini settings. Else, you will have to contact your host.</p>
<p>Note : If the above method doesn&#8217;t work then it would be a good idea to check your script for any memory leakage issue.</p>
<div class="alignright"><div class="g-plusone" data-href="http://www.instacarma.com/blog/technical/620/" size="standard" count="true"></div></div>]]></content:encoded>
			<wfw:commentRss>http://www.instacarma.com/blog/technical/620/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Fantastico is not installed at the default location</title>
		<link>http://www.instacarma.com/blog/technical/fantastico-is-not-installed-at-the-default-location/</link>
		<comments>http://www.instacarma.com/blog/technical/fantastico-is-not-installed-at-the-default-location/#comments</comments>
		<pubDate>Tue, 23 Jun 2009 16:24:42 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Quick fixes]]></category>
		<category><![CDATA[Technical]]></category>
		<category><![CDATA[cPanel]]></category>
		<category><![CDATA[Fantastico]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[WHM]]></category>

		<guid isPermaLink="false">http://instacarma.com/blog/?p=581</guid>
		<description><![CDATA[Filed under: cPanel, Fantastico, PHP, WHM Issue : Fantastico is not installed at the default location /usr/local/cpanel/3rdparty/fantastico. Either move the Fantastico directory from it&#8217;s current location to /usr/local/cpanel/3rdparty/fantastico OR enable ioncube loaders in WHM -> Tweak settings. root@server [~]# cp -p /usr/local/cpanel/3rdparty/etc/php.ini /var/cpanel/3rdparty/etc/php.ini cp: cannot create regular file `/var/cpanel/3rdparty/etc/php.ini&#8217;: No such file or directory Solution [...]]]></description>
			<content:encoded><![CDATA[<p>Filed under: <a href='http://www.instacarma.com/blog/tag/cpanel/'>cPanel</a>, <a href='http://www.instacarma.com/blog/tag/fantastico/'>Fantastico</a>, <a href='http://www.instacarma.com/blog/tag/php/'>PHP</a>, <a href='http://www.instacarma.com/blog/tag/whm/'>WHM</a></p>
<p><strong>Issue : </strong><br />
Fantastico is not installed at the default location /usr/local/cpanel/3rdparty/fantastico. Either move the Fantastico directory from it&#8217;s current location to /usr/local/cpanel/3rdparty/fantastico OR enable ioncube loaders in WHM -> Tweak settings.</p>
<p><em>root@server [~]# cp -p /usr/local/cpanel/3rdparty/etc/php.ini /var/cpanel/3rdparty/etc/php.ini<br />
cp: cannot create regular file `/var/cpanel/3rdparty/etc/php.ini&#8217;: No such file or directory</em></p>
<p><strong>Solution :</strong></p>
<p>1. Try updating  cPanel to the latest version.<br />
2. If the above doesn&#8217;t work or if you are unable to do that then:<br />
Check your WHM Tweak Settings to make sure that the Ioncube loader is selected and that the register_globals  is checked, then save the changes. After doing this check whether you are getting any errors that the php.ini is inaccessible. If you get an error then run the following :</p>
<blockquote><p>chattr -ia /usr/local/cpanel/3rdparty/etc/php.ini
</p></blockquote>
<p>and try again.<br />
3. If the issue persists then run <em>/scripts/makecpphp</em>.<br />
It just rebuilds the copy of PHP that cPanel and WHM use (not your public version of PHP) and then makes sure that cPanel and WHM are set to use that version.</p>
<p>This should resolve the issue. </p>
<div class="alignright"><div class="g-plusone" data-href="http://www.instacarma.com/blog/technical/fantastico-is-not-installed-at-the-default-location/" size="standard" count="true"></div></div>]]></content:encoded>
			<wfw:commentRss>http://www.instacarma.com/blog/technical/fantastico-is-not-installed-at-the-default-location/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

