Not signed in (Sign In)

Vanilla 1.1.9 is a product of Lussumo. More Information: Documentation, Community Support.

Welcome Guest!
Want to take part in these discussions? If you have an account, sign in now.
If you don't have an account, apply for one now.
    • CommentAuthorhenning
    • CommentTimeNov 7th 2007 edited
     
    Hi!

    props to the developers! a great theme...

    But I get an error message any time, I want to open the options page reading:

    Fatal error: Allowed memory size of 8388608 bytes exhausted (tried to allocate 311296 bytes) in /home/bakshalom/public_html/wp-content/themes/tarski/library/includes/feedparser/lib-utf8.php on line 769



    what can I do?!

    thx,henning
  1.  

    I had this problem when trying to set up WordPress on a new PHP install the other day. Basically, what you need to do is go into your php.ini file (where it is will depend on the system) and change the memory_limit value to something higher (12 or 16MB should do it, try the lower value first!).

    memory_limit = 12M

    As the error indicates, it looks like this is down to the Feedparser library. I’m going to see if there’s anything I can do to reduce that load.

    I’ve actually found that WordPress (at least on the bundled Mac OS 10.5 library of PHP and Apache) causes that error all by itself, without Tarski being activated, so Tarski’s intermittent apparent high memory usage may just push your server over the edge.

    • CommentAuthorhenning
    • CommentTimeNov 7th 2007
     
    thanx for the quick reply,
    but that would mean, only my webhost could change this on his/her server (if I don't have a own), right?!
  2.  

    That’s correct. I take it you don’t have the problem with just WordPress, the default theme and no plugins running?

    You could also try setting this in your .htaccess file (if your server is running Apache, which given that it looks like a *nix server it probably is):

    php_value memory_limit 12M

    But that capability may have been disabled by your host.

    • CommentAuthorhenning
    • CommentTimeNov 7th 2007
     
    nope. it works just fine with the default theme: http://bakshalom.byto.de/

    and I seem to have problems only in the backend. – what's bad enough since neither the dashbord nor the tarski options can be displayed.
  3.  

    Can you try disabling all your plugins, enabling Tarski, and seeing if you can access the Options page? I’d like to find out Feedparser is all the problem or just a contributor to it.

    • CommentAuthorhenning
    • CommentTimeNov 7th 2007
     
    I have all plugins disabled... doesn't help. also the .htaccess-solution didn't work out for me.
  4.  

    Then I’m afraid the only options I can suggest are contacting your host to change the memory limit, or manually removing the update notification system.

    To do that, go to library/launcher.php in your Tarski directory and comment out the following line:

    add_action('activity_box_end', 'tarski_update_notifier');

    So it becomes

    // add_action('activity_box_end', 'tarski_update_notifier');

    Then you need to remove it from the Tarski Options page. Go to library/display/admin/options_page.php, on lines 25-27 there should be the following code:

    <?php if(!detectWPMU() || detectWPMUadmin()) { ?> <?php tarski_update_notifier('options_page'); ?> <?php } ?>

    Comment out the middle line, so you end up with this:

    <?php if(!detectWPMU() || detectWPMUadmin()) { ?> <?php // tarski_update_notifier('options_page'); ?> <?php } ?>

    Obviously it means you’ll have to manually check for Tarski updates.

    • CommentAuthorross
    • CommentTimeNov 7th 2007
     
    Hi,

    After upgrading I got exactly the same error message, when trying to access Tarski Options:

    Fatal error: Allowed memory size of 8388608 bytes exhausted (tried to allocate 311296 bytes) in ....../tarski/library/includes/feedparser/lib-utf8.php on line 769

    Following your suggestion to raise the memory limit from 8M to 12M it worked fine again. This was on my local machine (Mac + MAMP). My hosted server didn't have this problem.

    Thanks,

    Ross
  5.  

    I think the new PHP defaults are the problem on Leopard; I didn’t have the issue when I set up PHP on Tiger (in addition to this I think Leopard is bundled with PHP 5, not 4, and it doesn’t automatically copy per-user Apache settings over either).

    • CommentAuthorliggitt
    • CommentTimeNov 7th 2007 edited
     
    I know it's distasteful, but it might be worth manually parsing the version.atom file to avoid this problem. It would stink to not be able to use Tarski out of the box because the version checking was running out of memory. This change to version.php would just return the raw data, then use a couple regular expressions to pull out the version and link. It works as long as you don't have non-ascii characters or escaped XML entities in your version or link... not ideal, I know, but much lighter-weight, and you do control the feed. Just an idea.


    /**
    * version_feed_data() - Returns latest version feed data.
    *
    * @link http://tarskitheme.com/version.atom
    * @since 2.0
    * @return string $atomdata
    */
    function version_feed_data() {
    // Thanks to Simon Willison for the inspiration
    $cachefile = TARSKICACHE . "/version.atom";
    $cachetime = 60 * 60;

    // Serve from the cache if it is younger than $cachetime
    if (
    file_exists($cachefile)
    && (time() - $cachetime < filemtime($cachefile))
    && file_get_contents($cachefile)
    ) {
    $atomdata = file_get_contents($cachefile);
    } else {
    $ch = curl_init(TARSKIVERSIONFILE);
    curl_setopt($ch, CURLOPT_FAILONERROR, 1);
    curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
    curl_setopt($ch, CURLOPT_HEADER, 0);
    $atomdata = curl_exec($ch);
    curl_close($ch);

    if(!empty($atomdata) && cache_is_writable("version.atom")) {
    $fp = @fopen($cachefile, "w");
    if($fp) {
    fwrite($fp, $atomdata);
    fclose($fp);
    }
    }
    }

    return $atomdata;
    }

    /**
    * latest_version_number() - Returns latest version number.
    *
    * @since 2.0
    * @return string
    */
    function latest_version_number() {
    if(preg_match('/<entry>.*?<title>(.+?)<\/title>.*?<\/entry>/is', Version::version_feed_data(), $matches)) {
    $this->latest = wp_specialchars($matches[1]);
    }
    }

    /**
    * latest_version_link() - Returns link to latest version release post.
    *
    * The link should be the release post on the Tarski website
    * for the latest version of Tarski, which will include a link
    * to download the .zip file of that latest version.
    * @since 2.0
    * @return string
    */
    function latest_version_link() {
    if(preg_match('/<entry>.*?<id>(.+?)<\/id>.*?<\/entry>/is', Version::version_feed_data(), $matches)) {
    $this->latest_link = wp_specialchars($matches[1]);
    }
    }
    • CommentAuthorhenning
    • CommentTimeNov 7th 2007
     
    thank you so much, Ben.

    That did it for me... Now I am sooooo happy to have access to options and dashboard! What a coool service! Thanks!

    I'll move to the donations form as soon as I have added this comment! :-)
  6.  

    Thanks Henning, that’s very kind of you.

    Jordan: it’s less than ideal, but ideally WordPress’s included feed parsing library wouldn’t be so awful and I wouldn’t need to include anything in the first place. Thanks for the patch, it’s now in trunk and will be in 2.0.1.

  7.  

    2.0.1 is now out and incorporates this change.