<?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>Developer Oracles &#187; php search engine script</title>
	<atom:link href="http://devoracles.com/tag/php-search-engine-script/feed" rel="self" type="application/rss+xml" />
	<link>http://devoracles.com</link>
	<description></description>
	<lastBuildDate>Sun, 21 Mar 2010 11:05:37 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Additional tweaks to tighten php</title>
		<link>http://devoracles.com/additional-tweaks-to-tighten-php/12</link>
		<comments>http://devoracles.com/additional-tweaks-to-tighten-php/12#comments</comments>
		<pubDate>Sun, 13 Jul 2008 09:21:37 +0000</pubDate>
		<dc:creator>Gary Illyes</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[Server Management]]></category>
		<category><![CDATA[image upload]]></category>
		<category><![CDATA[improve memory]]></category>
		<category><![CDATA[memory]]></category>
		<category><![CDATA[optimize php]]></category>
		<category><![CDATA[optimize virtual memory]]></category>
		<category><![CDATA[php file upload]]></category>
		<category><![CDATA[php script]]></category>
		<category><![CDATA[php search engine script]]></category>
		<category><![CDATA[php security]]></category>
		<category><![CDATA[php settings]]></category>
		<category><![CDATA[php tweaks]]></category>
		<category><![CDATA[php5]]></category>
		<category><![CDATA[upload]]></category>
		<category><![CDATA[upload file]]></category>
		<category><![CDATA[virtual memory]]></category>

		<guid isPermaLink="false">http://devoracles.com/?p=12</guid>
		<description><![CDATA[Believe me or not, the resource limiting of PHP can also be an enormous security factor.
Take this scenario: Mr. John Hacker managed somehow to upload to your server a script, let&#8217;s say an IRC bot which eats up computing power and RAM. Your server became inaccessible due to the running script, who your regular users [...]]]></description>
			<content:encoded><![CDATA[<p>Believe me or not, the resource limiting of PHP can also be an enormous security factor.<br />
Take this scenario: Mr. John Hacker managed somehow to upload to your server a script, let&#8217;s say an IRC bot which eats up computing power and RAM. Your server became inaccessible due to the running script, who your regular users blame? You, of course, who else?<br />
Php has some very neat settings you can tweak in order to limit its memory usage, to expose what version of php you are using or not, and others.<br />
Let&#8217;s start from the beginning:<br />
<strong>asp_tags</strong> and <strong>short_open_tags</strong>, whether to allow the use  of asp-like tags like &#8220;&lt;%&#8221; and short open tags like &#8220;&lt;?&#8221; instead of &#8220;&lt;?php&#8221;. I usually set these to off, for one reason: I usually know I set them to off thus I&#8217;m not trying to use them in the scripts, but others don&#8217;t know. If they manage to upload a script containing these tags it will be much likely useless for them as PHP won&#8217;t do anything with them.<br />
<strong>expose_php</strong> if set to on, will append to the server signature the PHP version you are using. If you didn&#8217;t upgrade yet to the latest php, you should set it to off, else it&#8217;s up to you what you do. I like to set it off, let&#8217;s not allow others what version the server runs.<br />
<b>memory_limit</b>, this is a nice one and you should tweak it to extreme. You can set how much memory would you like to allocate for PHP. If your scripts are not memory eaters, this should be a low value, if they are, a higher value. You can also disable the directive by setting a value of -1, but be aware that with -1, PHP can use as much memory as it wants. I learned that the golden middle is 32, try first that value and if everything is running well, leave at that value.<br />
<b>register_globals</b>, the black sheep <img src='http://devoracles.com/wp-includes/images/smilies/icon_neutral.gif' alt=':|' class='wp-smiley' /> . Whether to register the $_ENV, $_GET, $_POST, $_SERVER and $_COOKIE variables as global variables. This is covered in too much articles already, i won&#8217;t explain why to set it OFF. If you rely on it, stop doing so, learn how to not rely on it or give up coding, period.<br />
<b>file_uploads</b> and <b>upload_max_filesize</b>, whether to allow or not file uploads, and if you allow, what&#8217;s the maximum filesize you would like to accept via the HTTP request. The file upload is pretty useless to have it enabled if you don&#8217;t use file upload scripts, so if you are not using disable it. Why let Mr. John Hacker to put file-upload scripts on your server?</p>
<p>And these were all the settings I wanted to cover in this post. Consider using them, think carefully before allowing something and before setting something, always.<br />
Here are the settings I recommend:<br />
<code><br />
asp_tags = Off<br />
short_open_tags = Off<br />
expose_php = Off<br />
memory_limit = 32M<br />
register_globals = Off<br />
file_uploads = Off<br />
upload_max_filesize = 2M<br />
</code><br />
Again, much likely others would do it in another way, that&#8217;s my way, feel free to use it or not <img src='http://devoracles.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://devoracles.com/additional-tweaks-to-tighten-php/12/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
