<?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>iTechLog &#187; php.ini</title>
	<atom:link href="http://itechlog.com/tag/phpini/feed/" rel="self" type="application/rss+xml" />
	<link>http://itechlog.com</link>
	<description>Your source to IT solutions, interesting technology news and a hint of Space and Physics.</description>
	<lastBuildDate>Wed, 09 May 2012 13:02:06 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=</generator>
		<item>
		<title>It is not safe to rely on the system’s timezone settings</title>
		<link>http://itechlog.com/web-programming/2011/01/31/it-is-not-safe-to-rely-on-the-systems-timezone-settings/</link>
		<comments>http://itechlog.com/web-programming/2011/01/31/it-is-not-safe-to-rely-on-the-systems-timezone-settings/#comments</comments>
		<pubDate>Mon, 31 Jan 2011 14:33:09 +0000</pubDate>
		<dc:creator>Alex Costa</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[Web Programming]]></category>
		<category><![CDATA[DATE]]></category>
		<category><![CDATA[error]]></category>
		<category><![CDATA[php.ini]]></category>
		<category><![CDATA[PHP5]]></category>
		<category><![CDATA[time setting]]></category>

		<guid isPermaLink="false">http://itechlog.com/?p=976</guid>
		<description><![CDATA[<a href="http://itechlog.com/web-programming/2011/01/31/it-is-not-safe-to-rely-on-the-systems-timezone-settings/" title="It is not safe to rely on the system’s timezone settings"></a>Recently I have been having the following error on my PHP code every time I call the PHP function date();  Mostly when running it on my local test server. Warning: date(): It is not safe to rely on the system&#8217;s &#8230;<p class="read-more"><a href="http://itechlog.com/web-programming/2011/01/31/it-is-not-safe-to-rely-on-the-systems-timezone-settings/">Read more &#187;</a></p>]]></description>
			<content:encoded><![CDATA[<a href="http://itechlog.com/web-programming/2011/01/31/it-is-not-safe-to-rely-on-the-systems-timezone-settings/" title="It is not safe to rely on the system’s timezone settings"></a><p><img style="float: left; padding-right: 10px;" src="http://itechlog.com/wp-content/uploads/2011/01/php_logo.png" alt="" width="150" height="80" align="left" />Recently I have been having the following error on my PHP code every time I call the PHP function date();  Mostly when running it on my local test server.</p>
<p><strong>Warning: date(): It is not safe to rely on the system&#8217;s timezone settings</strong></p>
<p><strong>Cause:</strong> Since PHP5.1.0 the E_RESTRICT setting causes PHP to report error for every call<br />
 to a date/time function, if no default time is set.<br />
 <strong><br />
 Fix: </strong>There are 2 approaches to  resolving this.</p>
<ol>
<li><strong>Set time setting to your PHP script</strong> with the function <a href="http://php.net/manual/en/function.date-default-timezone-set.php" target="_blank">date_default_timezone_set</a>();  with the intended time zone/location eg: for GMT one can use date_default_timezone_set(&#8216;Europe/London&#8217;); </li>
<li><strong>Set time setting to your php.ini </strong>file by editing the line <a href="http://php.net/manual/en/function.date-default-timezone-set.php" target="_blank"><strong><em>;date.timezone =</em></strong> to <strong><em>date.timezone = &#8220;Europe/London&#8221;</em></strong> </a> or you required location. This is good for setting a server wide time setting. </li>
</ol>

<!-- start wp-tags-to-technorati 1.02 -->

<p class='technorati-tags'>Technorati Tags: <a class='technorati-link' href='http://technorati.com/tag/DATE' rel='tag' target='_self'>DATE</a>, <a class='technorati-link' href='http://technorati.com/tag/error' rel='tag' target='_self'>error</a>, <a class='technorati-link' href='http://technorati.com/tag/PHP' rel='tag' target='_self'>PHP</a>, <a class='technorati-link' href='http://technorati.com/tag/php.ini' rel='tag' target='_self'>php.ini</a>, <a class='technorati-link' href='http://technorati.com/tag/PHP5' rel='tag' target='_self'>PHP5</a>, <a class='technorati-link' href='http://technorati.com/tag/time+setting' rel='tag' target='_self'>time setting</a></p>

<!-- end wp-tags-to-technorati -->
<h3  class="related_post_title">Related Posts</h3><ul class="related_post"><li>October 7, 2011 -- <a href="http://itechlog.com/easy-tips/2011/10/07/spotify-crashes-in-linux-under-wine/" title="Spotify crashes in Linux under Wine">Spotify crashes in Linux under Wine</a></li><li>August 10, 2011 -- <a href="http://itechlog.com/code-snipets/2011/08/10/cardsave-error-transaction-datetime-expired/" title="Cardsave error &#8220;transaction date/time expired&#8221;">Cardsave error &#8220;transaction date/time expired&#8221;</a></li><li>August 26, 2009 -- <a href="http://itechlog.com/wordpress/2009/08/26/wordpress-media-upload-http-error/" title="Wordpress Media upload HTTP Error">Wordpress Media upload HTTP Error</a></li><li>May 13, 2009 -- <a href="http://itechlog.com/web-programming/2009/05/13/automatically-display-form-data-with-php/" title="Automatically display form data with PHP">Automatically display form data with PHP</a></li><li>April 14, 2009 -- <a href="http://itechlog.com/web-programming/2009/04/14/pdf-to-email-with-registration/" title="PDF to Email with registration">PDF to Email with registration</a></li></ul>]]></content:encoded>
			<wfw:commentRss>http://itechlog.com/web-programming/2011/01/31/it-is-not-safe-to-rely-on-the-systems-timezone-settings/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>WordPress Media upload HTTP Error</title>
		<link>http://itechlog.com/wordpress/2009/08/26/wordpress-media-upload-http-error/</link>
		<comments>http://itechlog.com/wordpress/2009/08/26/wordpress-media-upload-http-error/#comments</comments>
		<pubDate>Wed, 26 Aug 2009 10:19:10 +0000</pubDate>
		<dc:creator>Alex Costa</dc:creator>
				<category><![CDATA[Wordpress]]></category>
		<category><![CDATA[.htaccess]]></category>
		<category><![CDATA[Apache mod_security]]></category>
		<category><![CDATA[HTTP Error]]></category>
		<category><![CDATA[php.ini]]></category>
		<category><![CDATA[swfupload]]></category>
		<category><![CDATA[Wordpress-MU]]></category>

		<guid isPermaLink="false">http://itechlog.com/wordpress/2009/08/26/wordpress-media-upload-http-error/</guid>
		<description><![CDATA[<a href="http://itechlog.com/wordpress/2009/08/26/wordpress-media-upload-http-error/" title="Wordpress Media upload HTTP Error"></a>WordPress and WordPress-MU have given me the HTTP error in the various installations I have performed and each time there&#8217;s a different cause. This post is nothing more than a personal notation for future reference but I hope it&#8217;s helpful &#8230;<p class="read-more"><a href="http://itechlog.com/wordpress/2009/08/26/wordpress-media-upload-http-error/">Read more &#187;</a></p>]]></description>
			<content:encoded><![CDATA[<a href="http://itechlog.com/wordpress/2009/08/26/wordpress-media-upload-http-error/" title="Wordpress Media upload HTTP Error"></a><p><b><a target="_blank" href="http://wordpress.org">WordPress</a> </b>and <a target="_blank" href="http://mu.wordpress.org/"><b>WordPress-MU</b></a> have given me the HTTP error in the various installations I have performed and each time there&#8217;s a different cause. This post is nothing more than a personal notation for future reference but I hope it&#8217;s helpful to someone.</p>
<p>Error: when trying to upload media using the <b>WordPress Flash uploader</b> it get the message <b>HTTP Error</b></p>
<p><b>Disclaimer</b>: <i>before messing with your .htaccess file, make sure you have a backup copy of it in case it causes a 500 Server configuration error. If this happens just replace the .htaccess file with the back up version. Check your code for any mistakes and try again.<br /></i><br />Possible causes:
<ul>
<li><b>mod_security</b> &#8211; basically all Apache servers will have it turned on, so you may need to turn it off for the async-upload.php file using .htaccess. The newer versions of WP have added this code already, but in case you mess up your htaccess file, here it is.&nbsp; Just add the following lines to the bottom of your .htaccess file in the root folder of your WP or WP-MU installation.&nbsp; </li>
</ul>
<div align="center">&lt;IfModule mod_security.c&gt; <br />&lt;Files async-upload.php&gt; <br />SecFilterEngine Off <br />SecFilterScanPOST Off <br />&lt;/Files&gt; <br />&lt;/IfModule&gt;</div>
<p>
<ul>
<li><b>Access Denied Error 403/ Permission issue</b> &#8211; another typical problem. Make sure that the upload folder is writeable by the server, you can set the permission to 754 and it should work fine. In WordPress the upload folder sits under /wp-content/&nbsp; in WP-MU it sits under /blogs.dir/&#8221;blog number&#8221;/files&nbsp; (default site blog number is 1 and the other blogs are numbered in ascending order of creation)</li>
</ul>
<ul>
<li><b>PHP Upload limit</b> &#8211; check you PHP.ini settings for the settings upload_max_filesize and post_max_size. You can change these directly in your PHP.ini if you have access to it or you can change it by adding a php.ini file to you root directory with the following code. The default is normally 2M but you can change it to anything at your own risk, you should not need more then 8M.)</li>
</ul>
<div align="center">post_max_size = 8M<br />upload_max_filesize = 8M</p>
<p>
<div align="left">
<div align="center">or by adding the following lines to your .htaccess file:</div>
<div align="center">php_value upload_max_filesize 8M<br />php_value post_max_size 8M</p>
<p>for anything above 8M you may need to add an execution time to the .htaccess code also<br />php_value max_execution_time  800</p>
</div>
</div>
<div align="left"> </div>
</div>
<ul>
<li><b>Authentication Failed Error 401</b>- I checked my server log and noticed that WordPress was trying to access the 401.shtml error template every time I got the HTTP error during a media upload attempt. This normally occours if you are using password protection for the WordPress root folder or the folder where your uploads should reside. You should disable the password protection on the folder i norder for the uploader to work.</li>
</ul>
<p>Hope it helps. Please leave your contributions and bug reports so others can benefit from it.</p>
<p>
<div class="zemanta-pixie"><img class="zemanta-pixie-img" alt="" src="http://img.zemanta.com/pixy.gif?x-id=d6acb708-013d-8f9e-9a07-de3417c3833a" /></div>

<!-- start wp-tags-to-technorati 1.02 -->

<p class='technorati-tags'>Technorati Tags: <a class='technorati-link' href='http://technorati.com/tag/.htaccess' rel='tag' target='_self'>.htaccess</a>, <a class='technorati-link' href='http://technorati.com/tag/Apache+mod_security' rel='tag' target='_self'>Apache mod_security</a>, <a class='technorati-link' href='http://technorati.com/tag/HTTP+Error' rel='tag' target='_self'>HTTP Error</a>, <a class='technorati-link' href='http://technorati.com/tag/php.ini' rel='tag' target='_self'>php.ini</a>, <a class='technorati-link' href='http://technorati.com/tag/swfupload' rel='tag' target='_self'>swfupload</a>, <a class='technorati-link' href='http://technorati.com/tag/Wordpress' rel='tag' target='_self'>WordPress</a>, <a class='technorati-link' href='http://technorati.com/tag/Wordpress-MU' rel='tag' target='_self'>WordPress-MU</a></p>

<!-- end wp-tags-to-technorati -->
<h3  class="related_post_title">Related Posts</h3><ul class="related_post"><li>January 31, 2011 -- <a href="http://itechlog.com/web-programming/2011/01/31/it-is-not-safe-to-rely-on-the-systems-timezone-settings/" title="It is not safe to rely on the system’s timezone settings">It is not safe to rely on the system’s timezone settings</a></li><li>August 12, 2010 -- <a href="http://itechlog.com/linux/2010/08/12/linuxcon-2010-just-for-fun-poll-results-explained/" title="LinuxCon 2010 Just for Fun Poll Results explained">LinuxCon 2010 Just for Fun Poll Results explained</a></li><li>June 5, 2009 -- <a href="http://itechlog.com/itechlog-news/2009/06/05/keyword-search-and-website-ranking-tools/" title="Keyword search and website ranking tools">Keyword search and website ranking tools</a></li><li>May 12, 2009 -- <a href="http://itechlog.com/itechlog-news/2009/05/12/offline-blogging-tools/" title="Offline Blogging Tools">Offline Blogging Tools</a></li><li>March 27, 2009 -- <a href="http://itechlog.com/web-programming/2009/03/27/htaccess-301-redirect/" title=".htaccess 301 Redirect">.htaccess 301 Redirect</a></li></ul>]]></content:encoded>
			<wfw:commentRss>http://itechlog.com/wordpress/2009/08/26/wordpress-media-upload-http-error/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
	</channel>
</rss>

