<?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/"
	xmlns:series="http://unfoldingneurons.com/"
	>

<channel>
	<title>Perteův pokus o blog &#187; Nezařazené</title>
	<atom:link href="http://www.perteus.cz/category/nezarazene/feed" rel="self" type="application/rss+xml" />
	<link>http://www.perteus.cz</link>
	<description></description>
	<lastBuildDate>Fri, 11 May 2012 10:17:30 +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>ALERT &#8211; script tried to increase memory_limit &#8211; aneb WordPress zlobí</title>
		<link>http://www.perteus.cz/2012/04/alert-script-tried-to-increase-memory_limit-aneb-wordpress-zlobi.html?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=alert-script-tried-to-increase-memory_limit-aneb-wordpress-zlobi</link>
		<comments>http://www.perteus.cz/2012/04/alert-script-tried-to-increase-memory_limit-aneb-wordpress-zlobi.html#comments</comments>
		<pubDate>Wed, 11 Apr 2012 09:25:31 +0000</pubDate>
		<dc:creator>perteus</dc:creator>
				<category><![CDATA[IT a Internet]]></category>
		<category><![CDATA[Nezařazené]]></category>
		<category><![CDATA[řešení problému]]></category>
		<category><![CDATA[virtuální server]]></category>
		<category><![CDATA[wordpress]]></category>

		<guid isPermaLink="false">http://www.perteus.cz/?p=181</guid>
		<description><![CDATA[&#160;Na normálním webhostingu si toho asi jen tak nevšimnete, ale wordpress zlobí. A to kupodivu hodně. Čirou náhodou jsem na to přišel, když jsem byl připojený přes konzoli na serveru a objevila se mi krásná chybová hláška v okamžiku, kdy jsem se přihlásil do administrace WordPressu: ALERT - script tried to increase memory_limit to 268435456 [...]]]></description>
			<content:encoded><![CDATA[<p>&#160;Na normálním webhostingu si toho asi jen tak nevšimnete, ale wordpress zlobí. A to kupodivu hodně. Čirou náhodou jsem na to přišel, když jsem byl připojený přes konzoli na serveru a objevila se mi krásná chybová hláška v okamžiku, kdy jsem se přihlásil do administrace WordPressu:</p>


<div class="wp-geshi-highlight-wrap5"><div class="wp-geshi-highlight-wrap4"><div class="wp-geshi-highlight-wrap3"><div class="wp-geshi-highlight-wrap2"><div class="wp-geshi-highlight-wrap"><div class="wp-geshi-highlight"><div class="bash"><pre class="de1">ALERT - script tried to increase memory_limit to <span class="nu0">268435456</span> bytes <span class="kw2">which</span> is above the allowed value <span class="br0">&#40;</span>attacker <span class="st_h">'217.11.252.6'</span>, <span class="kw2">file</span> <span class="st_h">'/neco/neco/taky/neco/wp-admin/admin.php'</span>, line <span class="nu0">109</span><span class="br0">&#41;</span></pre></div></div></div></div></div></div></div>



<span id="more-181"></span>
<p>Pokud se podíváme na uvedený řádek souboru admin.php, tak nalezneme následující.<br />


<div class="wp-geshi-highlight-wrap5"><div class="wp-geshi-highlight-wrap4"><div class="wp-geshi-highlight-wrap3"><div class="wp-geshi-highlight-wrap2"><div class="wp-geshi-highlight-wrap"><div class="wp-geshi-highlight"><div class="php"><pre class="de1"><span class="sy0">@</span><span class="kw3">ini_set</span><span class="br0">&#40;</span> <span class="st_h">'memory_limit'</span><span class="sy0">,</span> apply_filters<span class="br0">&#40;</span> <span class="st_h">'admin_memory_limit'</span><span class="sy0">,</span> WP_MAX_MEMORY_LIMIT <span class="br0">&#41;</span> <span class="br0">&#41;</span><span class="sy0">;</span></pre></div></div></div></div></div></div></div>


</p>
<p>Což už jsem věděl, že někde ve wordpressu je nastaven memory limit na 256M. Stačilo chvíli googlit a našel jsem o tom krásnou poznámku&#160;<a target="_blank" href="http://core.trac.wordpress.org/attachment/ticket/13847/13847.4.patch">http://core.trac.wordpress.org/attachment/ticket/13847/13847.4.patch</a></p>
<p>Stačí provést editaci souboru&#160;<strong>wp-includes/default-constants.php </strong>nalezneme si řádek</p>


<div class="wp-geshi-highlight-wrap5"><div class="wp-geshi-highlight-wrap4"><div class="wp-geshi-highlight-wrap3"><div class="wp-geshi-highlight-wrap2"><div class="wp-geshi-highlight-wrap"><div class="wp-geshi-highlight"><div class="php"><pre class="de1"><span class="kw1">if</span> <span class="br0">&#40;</span> <span class="sy0">!</span><span class="kw3">defined</span><span class="br0">&#40;</span><span class="st_h">'WP_MAX_MEMORY_LIMIT'</span><span class="br0">&#41;</span> <span class="br0">&#41;</span> <span class="br0">&#123;</span> 
                <span class="kw3">define</span><span class="br0">&#40;</span><span class="st_h">'WP_MAX_MEMORY_LIMIT'</span><span class="sy0">,</span> <span class="st_h">'256M'</span><span class="br0">&#41;</span><span class="sy0">;</span> 
	        <span class="br0">&#125;</span></pre></div></div></div></div></div></div></div>



<p>
A hádejte jakou hodnotu si teď změníme. 256M jsem změnil na 128M a chybové hlášení se přestalo zobrazovat.</p>]]></content:encoded>
			<wfw:commentRss>http://www.perteus.cz/2012/04/alert-script-tried-to-increase-memory_limit-aneb-wordpress-zlobi.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

