Memory allocation error

Posted on 2008-11-04
Last Modified: 2013-12-13
Hi Experts,

I´m using a DOM Class that reads a html file.

public function file_get_html() {
          $dom = new lib_dom_dom();
          $args = func_get_args();
          @$dom->load(call_user_func_array('file_get_contents', $args), true);

When i call my script (test.php) via the browser everything works fine. it reads the html file.

When i try to call the php file via the console it gives me the following error:

Fatal error: Allowed memory size of 33554432 bytes exhausted (tried to allocate 1848 bytes) in... ...dom/dom.class.php

I don´t understand why i can call the script directly via the webbrowser with no memory error, but i cannot call it via the console.
Question by:bibabutze
    LVL 36

    Expert Comment

    by:Loganathan Natarajan

    Author Comment

    The php limit is already on 128MB

    If this would be the problem it would not work out when i call the php fle via the webbrowser... it has to be a problem with the calling of the script via the console...
    LVL 17

    Accepted Solution

    php for windows will have more then one php.ini file,

    one for the web server and one for the command line. I would check to make sure that both have a 128 mb limit and not just the web server one.

    Featured Post

    6 Surprising Benefits of Threat Intelligence

    All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

    Join & Write a Comment

    If your site has a few sections that need to be secure when data is transmitted between the server and local computer, such as a /order/ section for ordering or /customer/ which contains customer data, etc it would of course be recommended to secure…
    Nothing in an HTTP request can be trusted, including HTTP headers and form data.  A form token is a tool that can be used to guard against request forgeries (CSRF).  This article shows an improved approach to form tokens, making it more difficult to…
    Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
    The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

    746 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    16 Experts available now in Live!

    Get 1:1 Help Now