<?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>twopointouch &#187; php</title> <atom:link href="http://twopointouch.com/tag/php/feed/" rel="self" type="application/rss+xml" /><link>http://twopointouch.com</link> <description>web 2.0, blogs and social media</description> <lastBuildDate>Mon, 09 May 2011 20:03:42 +0000</lastBuildDate> <language>en</language> <sy:updatePeriod>hourly</sy:updatePeriod> <sy:updateFrequency>1</sy:updateFrequency> <generator>http://wordpress.org/?v=3.1.3</generator> <item><title>WordPress Out-of-Memory Fix</title><link>http://twopointouch.com/2009/blogs/wordpress-out-of-memory-fix/</link> <comments>http://twopointouch.com/2009/blogs/wordpress-out-of-memory-fix/#comments</comments> <pubDate>Wed, 23 Dec 2009 18:28:21 +0000</pubDate> <dc:creator>Ian</dc:creator> <category><![CDATA[blogs]]></category> <category><![CDATA[error]]></category> <category><![CDATA[fix]]></category> <category><![CDATA[memory]]></category> <category><![CDATA[php]]></category> <category><![CDATA[Plug-in]]></category> <category><![CDATA[wordpress]]></category> <guid
isPermaLink="false">http://twopointouch.com/?p=1158</guid> <description><![CDATA[<p><a
href="http://twopointouch.com/wp-content/uploads/2009/12/wp.jpg"></a></p><p>I’ve been making some changes to this site recently: upgrading to the newest version of WordPress, choosing a new theme and fiddling with the layout.</p><p>One thing I discovered is that, unless you’re running a very minimal installation, it’s quite easy to run out of memory, even with only a handful of plug-ins.<p><a
href="http://twopointouch.com/2009/blogs/wordpress-out-of-memory-fix/">Continue reading WordPress Out-of-Memory Fix</a></p>]]></description> <content:encoded><![CDATA[<p><a
href="http://twopointouch.com/wp-content/uploads/2009/12/wp.jpg"><img
class="alignnone size-full wp-image-1901" title="wp" src="http://twopointouch.com/wp-content/uploads/2009/12/wp.jpg" alt="wordpress logo" width="500" height="500" /></a></p><p>I’ve been making some changes to this site recently: upgrading to the newest version of WordPress, choosing a new theme and fiddling with the layout.</p><p>One thing I discovered is that, unless you’re running a very minimal installation, it’s quite easy to run out of memory, even with only a handful of plug-ins. Versions of the software have become slightly larger since WordPress 2.6 or so, plus plug-ins have become more ambitious, not to mention the increased usage of rich content like videos and AJAX transitions.</p><p><span
id="more-1158"></span>Every time I tweaked something, I ended up with blank pages and an error message like this:</p><p><strong>Fatal error: Allowed memory size of X bytes exhausted (tried to allocate X bytes) in /home /Your-Username/public_html/ the particular folder on line X</strong></p><p>I searched around for quite some time for advice, and tried each of the following, before ending up at a working solution. They didn’t work for me, but I’ll leave them here since they might prove useful for someone else. Please be very careful, though: some of these ‘handy tips’ will break your entire site.</p><p>1) De-activating all but the most essential plug-ins. This is probably good housekeeping advice all-round, but didn’t actually make a lot of difference. The basic install was using 26MB of the 32MB allocated; with a full suite of plug-ins it was just over 28MB. Add some users, and you’ll quickly run out of memory — the extra 2MB from disabling plug-ins didn’t make enough difference.</p><p>2) Alter the value of php_value memory_limit in your .htaccess file. Doing this broke the whole site: YMMV.</p><p>3) Optimise your database tables using phpMyAdmin. Saved about 200KB. Woop.</p><p>4) Adding the line “memory_limit = 64M” in my php5.ini file. Made no difference one way or another.</p><p><strong>What actually worked was this.</strong></p><p>Open wp-config.php and find this bit:</p><pre dir="ltr">/** Sets up WordPress vars and included files. */
require_once(ABSPATH . 'wp-settings.php');
</pre><p>Change it so that it reads like this:</p><pre dir="ltr">/** Sets up WordPress vars and included files. */
define('WP_MEMORY_LIMIT', '64M');
require_once(ABSPATH . 'wp-settings.php');
</pre><p>Touch wood, that’s done the trick. The site’s still as slow as molasses, of course, but at least I’m not running out of memory.</p> ]]></content:encoded> <wfw:commentRss>http://twopointouch.com/2009/blogs/wordpress-out-of-memory-fix/feed/</wfw:commentRss> <slash:comments>6</slash:comments> </item> </channel> </rss>
