[PHP] memory leak - how to find it?

2006-07-31 Thread Robin Getz
I am trying to debug a php script that I downloaded, which has a memory leak in it. I was looking for a way to find what variables were in php's memory, and what size, they were, but I couldn't find anything? The script is a off-line wiki conversion tool (walks through a wiki to create a

RE: [PHP] apache_child_terminate?

2005-01-04 Thread Robin Getz
Curt Zirzow wrote: I should be able to turn this on with 'child_terminate' in php.ini However, I do this, and when I do a phpinfo(); it returns a: apache2handler with only three Directives: - engine - last_modified - xbithack Are you running apache in multithreaded per chance?

RE: [PHP] handling large files w/readfile

2005-01-04 Thread Robin Getz
Jason Wong wrote: Are you using the above code on its own (ie not within some other code that may affect the memory usage)? Well, herethe entire file (It is pretty short - only a 2 pages, but sorry in advance if anyone considers this bad form). site is called with something like

[PHP] apache_child_terminate?

2005-01-03 Thread Robin Getz
I am trying to turn on apache_child_terminate with PHP V4.3.10 / Apache 2.0.52 According to: http://php.planetmirror.com/manual/en/function.apache-child-terminate.php I should be able to turn this on with 'child_terminate' in php.ini However, I do this, and when I do a phpinfo(); it returns a:

RE: [PHP] handling large files w/readfile

2005-01-02 Thread Robin Getz
Rasmus Lerdorf wrote: $buff = 0; while (!feof($fp)) { $buff = fread($fp, 4096); print $buff; } unset($buff); fclose ($fp); Well, the above code does not use more than 4K of ram plus a bit of overhead. So if something is

[PHP] PHP V4.3.10 / Apache2 Handler Question...

2005-01-01 Thread Robin Getz
I am trying to turn on apache_child_terminate with PHP V4.3.10 / Apache 2.0.52 When I do a phpinfo(); it returns a: apache2handler with only three Directives: - engine - last_modified - xbithack When I look at others with apache 1.3, it lists, child_terminate, which I need to be able to set.

RE: [PHP] handling large files w/readfile

2005-01-01 Thread Robin Getz
Curt Zirzow wrote: * Thus wrote Richard Lynch: Sebastian wrote: i'm working on a app which output files with readfile() and some headers.. i read a comment in the manual that says if your outputting a file php will use the same amount of memory as the size of the file. so, if the file is

RE: [PHP] handling large files w/readfile

2005-01-01 Thread Robin Getz
Robin Getz wrote: My next experiment is: $buff = 0; while (!feof($fp)) { $buff = fread($fp, 4096); print $buff; } unset($buff); fclose ($fp); Nope that doesn't work either - came back, and saw apache processes that were +450Meg

[PHP] Apache 2.0.52 / PHP 4.3.10 Integration Question...

2004-12-31 Thread Robin Getz
Hi. I am trying to get Apache 2.0.52 / PHP 4.3.10 working with some scripts I am using. I have a file named /www/projects which is a php script. When I type the url: www.site/projects/variable I want variable passed to the script projects I have the the http.conf set up as: Files projects

RE: [PHP] Apache 2.0.52 / PHP 4.3.10 Integration Question...

2004-12-31 Thread Robin Getz
Andrew Kreps wrote: I had to add this line to my httpd.conf: AddType application/x-httpd-php .php I have this and the DirectoryIndex - the problem is that my script does not end in a .php extention. (GForge ) If I rename the file projects.php and point to that, it works, but that means an

RE: [PHP] Apache 2.0.52 / PHP 4.3.10 Integration Question...

2004-12-31 Thread Robin Getz
The prize goes to Mark Charette of [EMAIL PROTECTED] for reading the apache manual in more detail than I. After Reading http://httpd.apache.org/docs-2.0/mod/core.html#forcetype Then adding: ForceType application/x-httpd-php Things work great. Thanks -Robin -- PHP General Mailing List

[PHP] Downloading Large (100M+) Files

2004-11-04 Thread Robin Getz
Hi. I have searched a few of the mailing lists, and have not found an answer. I am working on a site that is currently running gforge ( http://gforge.org/ ). The process that is used to download files from the file repository is something like: Header('Content-disposition:

Re: [PHP] Downloading Large (100M+) Files

2004-11-04 Thread Robin Getz
Klaus Reimer [EMAIL PROTECTED] wrote: If this theory is true, you may try fpassthru(). replaced: readfile($name); with: $fp = fopen($name, 'rb'); fpassthru($fp); and now I don't loose 250 Meg of memory every time I download a 250Meg file. If someone wants to add this to the readfile() php

[PHP] Determining system resources

2004-11-04 Thread Robin Getz
I have been unable to find a php function to determine available system memory (physical and swap)? Right now I am using something like: = # ensure there is enough free memory for the download $free = shell_exec('free -b'); $i=0; while ( $i != strlen($free) ) { i = strlen($free);

Re: [PHP] Determining system resources

2004-11-04 Thread Robin Getz
Francisco M. Marzoa Alonso [EMAIL PROTECTED] wrote: As far as you cannot lock another processes in the system, so this will not give you the security that the resources will not change -and probably they'll do it- while you're trying to download that file. Yes, I understand, but not to know even

Re: [PHP] Downloading Large (100M+) Files

2004-11-04 Thread Robin Getz
Curt Zirzow [EMAIL PROTECTED] wrote: replaced: readfile($name); with: $fp = fopen($name, 'rb'); fpassthru($fp); The only difference between readfile() and fpassthru() is what parameters you pass it. Something else is the problem, what version of php are you running? I am using php

Re: [PHP] Downloading Large (100M+) Files

2004-11-04 Thread Robin Getz
OK, I checked things out, and based on some private emails, and pointers, from Francisco M. Marzoa [EMAIL PROTECTED], I have now replaced: readfile($name); with: while(!feof($fp)) { $buf = fread($fp, 4096); echo $buf; $bytesSent+=strlen($buf);/* We know how