Bug#399179: [php-maint] Bug#399179: php5-cli: setting higher memory limit in php.ini doesn't affect php

sean finney seanius at debian.org
Sat Dec 9 11:18:02 CET 2006


tags 399179 unreproducible moreinfo
thanks

hi domas,

sorry for the delay in response.

On Sat, 2006-11-18 at 10:44 +0000, Domas Jokubauskis wrote:
> As you see, although php gets the setting, it doesn't use it while it
> executes a script.
> I have encountered the problem with the version 5.2.0-3 and thought
> that the update would fix the
> unwanted behaviour. When it updated I have purged everything related
> to php and reinstalled only
> php5-cli and php5-common.

i can't reproduce this, unfortunately.  this is what i've done:

first, size of 30MB and 32MB in bytes, just for reference later:

copelandia[~]11:11:15$ echo '30*1024*1024'|bc
31457280
copelandia[~]11:11:21$ echo '32*1024*1024'|bc
33554432

a script which should gobble up around ~64MB:

cat << EOF > foo.php
<?php
echo "memory limit: " . ini_get("memory_limit") . "\n";
echo "building a big pile of bytes...";
for($i=0; $i<64; $i++){
        $buf = $buf . str_repeat(".", 1024*1024);
        echo "$i.";
}
echo "\n";

?>
EOF

when memory_limit is set to 30MB in php5.ini:

copelandia[~]11:12:44$ php5 foo.php
memory limit: 30M
building a big pile of bytes...0.1.2.3.4.5.6.7.8.9.10.11.12.13.
Fatal error: Allowed memory size of 31457280 bytes exhausted (tried to
allocate 15728641 bytes) in /home/seanius/foo.php on line 5

when memory_limit is set to 32MB in php5.ini:

copelandia[~]11:14:13$ php5 foo.php
memory limit: 32M
building a big pile of bytes...0.1.2.3.4.5.6.7.8.9.10.11.12.13.14.
Fatal error: Allowed memory size of 33554432 bytes exhausted (tried to
allocate 16777217 bytes) in /home/seanius/foo.php on line 5


as you can see it's what's expected.  could you double check that:

(a) /usr/bin/php points to what you think it does, and
(b) the code in question doesn't include something that changes
    overrides the memory_limit setting


thanks,
	sean


-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 191 bytes
Desc: This is a digitally signed message part
Url : http://lists.alioth.debian.org/pipermail/pkg-php-maint/attachments/20061209/5bbbc7c2/attachment.pgp


More information about the pkg-php-maint mailing list