ID:               26577
 User updated by:  vijolicni dot oblak at gmx dot net
 Reported By:      vijolicni dot oblak at gmx dot net
 Status:           Bogus
 Bug Type:         Strings related
 Operating System: Windows 2003
 PHP Version:      4.3.4
 New Comment:

Sniper!

My php.ini has in it the following lines:
;;;;;;;;;;;;;;;;;;;
; Resource Limits ;
;;;;;;;;;;;;;;;;;;;

max_execution_time = 30     ; Maximum execution time of each script, in
seconds
max_input_time = 60     ; Maximum amount of time each script may spend
parsing request data
memory_limit = 8M      ; Maximum amount of memory a script may consume
(8MB)



>Sorry, but your problem does not imply a bug in PHP itself. 
??? When I run the PHP script memory usage jumps to 1.8GB from around
400MB. Is it the Holy Ghost?
 
>Thank you for your interest in PHP.
??? What does this mean? Should I switch to ASP.NET?

>Your argument that PHP "should not do this or that" is flawed. This
works just as expected. There are dozens of other ways too how you
can "shoot yourself in the leg"..
??? What works just as expected? Try it on larger file. Should PHP
render the computer useless by consuming more that 1GB? You don't even
have to be a sniper to shoot it.

BTW:The problem disappers with unsetting and setting back the
variable...


Previous Comments:
------------------------------------------------------------------------

[2003-12-10 09:17:42] [EMAIL PROTECTED]

See also: php.ini, memory_limit directive..


------------------------------------------------------------------------

[2003-12-10 09:16:57] [EMAIL PROTECTED]

Sorry, but your problem does not imply a bug in PHP itself.  For a
list of more appropriate places to ask for help using PHP, please
visit http://www.php.net/support.php as this bug system is not the
appropriate forum for asking support questions. 

Thank you for your interest in PHP.

Your argument that PHP "should not do this or that" is flawed. 
This works just as expected. There are dozens of other ways too how you
can "shoot yourself in the leg"..


------------------------------------------------------------------------

[2003-12-10 07:03:41] vijolicni dot oblak at gmx dot net

To alex.
Regardless how inefficient the code is, the PHP engine should never be
allowed to almost handicap a rented server that should serve requests
for 30+ sites.

------------------------------------------------------------------------

[2003-12-10 06:57:23] vijolicni dot oblak at gmx dot net

- On the server the script is going to run the script execution just
ended with
FATAL: emalloc() : Unable to allocate 418kB bytes

- On my local computer the swapfile utilisation was so high that the
script wan't able to save a 500kB file to a file and exit in 8 seconds
(the saving function started at 22seconds since the start and ran into
30s limit) [sovertime= start_overtime, and parameter 8 means that it
should save result and end execution at 22seconds, not to reach the 30s
limit]

------------------------------------------------------------------------

[2003-12-10 06:54:35] alex at pc4p dot net

As a personal sidenote, I find your code highly inefficient and thus it
is no wonder, that you reach the limits on your system. You should
definetly read up on PREGs and http://www.php.net/preg_replace which is
much faster than str_replace. str_replace should only be used for small
strings and small replacements, larger tasks are the domain of regular
expressions. Btw. I doubt, that this behaviour is being seen as a
bug...

------------------------------------------------------------------------

The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at
    http://bugs.php.net/26577

-- 
Edit this bug report at http://bugs.php.net/?id=26577&edit=1

Reply via email to