[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 243
  • Last Modified:

Memory allocation error

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.
1 Solution
bibabutzeAuthor Commented:
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...
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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Tackle projects and never again get stuck behind a technical roadblock.
Join Now