php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #11832 memory exhausted error
Submitted: 2001-07-02 06:20 UTC Modified: 2001-07-02 09:42 UTC
From: fb at esc-electronics dot de Assigned:
Status: Closed Package: *General Issues
PHP Version: 4.0.6 OS: Linux 2.2.19
Private report: No CVE-ID: None
 [2001-07-02 06:20 UTC] fb at esc-electronics dot de
Fatal error: Allowed memory size of 8388608 bytes exhausted (tried to
allocate 9 bytes) in
[somewhere]/mysql.php on line 8

Apache 1.3.19, PHP 4.0.6 configured with:
./configure  --prefix=/opt/php4 --with-apxs=/opt/apache/bin/apxs --with-pgsql=/opt/pgsql --with-mysql=/opt/mysql/ --with-openssl=/usr/local/ssl/ --with-imap=/opt/imap --with-gettext --with-zlib --with-dom --with-gd --enable-gd-imgstrttf --enable-inline-optimization --with-xml --with-ttf --with-gdbm --with-mm --enable-versioning --enable-trans-sid --enable-magic-quotes --enable-safe-mode --enable-sockets --enable-sysvsem --enable-sysvshm --enable-shmop --enable-calendar --enable-exif --enable-memory-limit

Might "--enable-memory-limit" be the culprit?
(It's a production system and I can not play much with it)

mysql.php worked correctly with php 4.0.5
mysql.php:
<?php
  function getData($query)
  {
    global $host, $user, $password, $db;
    //echo $query."<br>";
    $conn      = mysql_connect ($host, $user, $password);
    $result    = mysql_db_query($db, $query);
    while($row = mysql_fetch_array($result))
      $aux[] = $row;
    mysql_free_result($result);
    return $aux;
  };
  function putData($query)
  {
    global $host, $user, $password, $db;
    $conn      = mysql_connect ($host, $user, $password);
    $result    = mysql_db_query($db, $query);
    return $query;
  };
?>

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2001-07-02 06:23 UTC] derick@php.net
This does look like a normal thing. Your script simply uses too mch memory.
Can you increase the memory_limit to a higher value:
memory_limit = 16M

This should solve the problem if you are fetching too much rows.

Derick
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Mar 28 12:01:27 2024 UTC