[PHP-DEV] PHP 4.0 Bug #9644 Updated: File Upload eats all RAM and swap space

2001-03-24 Thread gerard

ID: 9644
User Update by: [EMAIL PROTECTED]
Old-Status: Open
Status: Closed
Bug Type: Reproduceable crash
Description: File Upload eats all RAM and swap space

After recompiling PHP with a few less options in my configure line, everything is 
working fine!  Not sure exactly which option, when removed, got things working again.

Here is the working configure line:
'./configure' '--with-mysql=/usr/local/mysql' '--with-mm' '--enable-ftp' 
'--enable-inline-optimization' '--enable-magic-quotes' '--enable-sigchild' 
'--enable-shmop' '--enable-sockets' '--enable-sysvshm' '--enable-sysvsem' 
'--enable-track-vars' '--enable-trans-sid' '--enable-versioning' '--with-gd' 
'--with-jpeg-dir=/usr/lib' '--with-xpm-dir=/usr/X11R6' 
'--with-apache=../apache_1.3.19' '--with-pgsql=/usr/local/pgsql' 
'--with-gettext=/usr/local' '--with-mcrypt=/usr/local' 
'--with-imap=/usr/local/imap-2000c' '--with-mcal' '--with-ldap'


Now I can upload very large files, without any problems.

Thanks!

Gerard

Previous Comments:
---

[2001-03-17 02:53:35] [EMAIL PROTECTED]
After doing some experimentation, I have realized something about Apache and PHP.

According to what 'ps aux' returns, when I run apache with PHP as I have been doing 
normally, it has been using from 2.5%MEM - 5.0%MEM (it varies) for each child at 
startup.  However, whenever I disable the PHP modules from Apache (by commenting off 
these lines in httpd.conf: 'LoadModule php4_module libexec/libphp4.so' and 
'AddModule mod_php4.c'), the 'ps aux' returns 0.7%MEM per child at startup.

In comparison to some other linux boxes running Apache and PHP, 2.5%MEM - 5.0%MEM is a 
large amount of RAM used.

Could this relate in any way to the problem that I am having with file uploads on my 
box?

---

[2001-03-12 01:29:57] [EMAIL PROTECTED]
I have never used gdb before, but I have a feeling that it is not working correctly.

Here are the results:

root@linux:/home/install/apps/apache/apache_1.3.19# gdb /usr/local/apache/bin/httpd
GNU gdb 5.0
Copyright 2000 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for details.
This GDB was configured as "i586-pc-linux-gnu"...
(gdb) run -X
Starting program: /usr/local/apache/bin/httpd -X
warning: Unable to find dynamic linker breakpoint function.
GDB will be unable to debug shared library initializers
and track explicitly loaded dynamic code.
Processing config directory: /usr/local/apache/conf/virtualhosts/magestudios.net/
 Processing config file: /usr/local/apache/conf/virtualhosts/magestudios.net/cwolvie
 Processing config file: /usr/local/apache/conf/virtualhosts/magestudios.net/eeno
 Processing config file: /usr/local/apache/conf/virtualhosts/magestudios.net/ewang
 Processing config file: /usr/local/apache/conf/virtualhosts/magestudios.net/ftp
 Processing config file: /usr/local/apache/conf/virtualhosts/magestudios.net/g2
 Processing config file: /usr/local/apache/conf/virtualhosts/magestudios.net/likwidx
 Processing config file: /usr/local/apache/conf/virtualhosts/magestudios.net/mail
 Processing config file: /usr/local/apache/conf/virtualhosts/magestudios.net/moscrop
 Processing config file: /usr/local/apache/conf/virtualhosts/magestudios.net/mouthoff
 Processing config file: /usr/local/apache/conf/virtualhosts/magestudios.net/pirachu
 Processing config file: /usr/local/apache/conf/virtualhosts/magestudios.net/stats
 Processing config file: /usr/local/apache/conf/virtualhosts/magestudios.net/web
 Processing config file: /usr/local/apache/conf/virtualhosts/magestudios.net/www
 Processing config file: /usr/local/apache/conf/virtualhosts/magestudios.net/xtracool

Program received signal SIGINT, Interrupt.
0x4046c564 in read () from /lib/libc.so.6
(gdb) bt full
#0  0x4046c564 in read () from /lib/libc.so.6
No symbol table info available.
#1  0x81d2044 in ?? ()
No symbol table info available.
#2  0x8084bf5 in buff_read ()
No symbol table info available.
#3  0x8084b92 in saferead_guts ()
No symbol table info available.
#4  0x8083612 in read_with_errors ()
No symbol table info available.
#5  0x8083980 in ap_bgets ()
No symbol table info available.
#6  0x8093c1b in getline ()
No symbol table info available.
#7  0x8093efd in read_request_line ()
No symbol table info available.
#8  0x809459e in ap_read_request ()
No symbol table info available.
#9  0x8091104 in child_main ()
No symbol table info available.
#10 0x8091301 in make_child ()
No symbol table info available.
#11 0x809147c in startup_children ()
No symbol table info available.
#12 0x8091aec in standalone_main ()
No symbol table inf

[PHP-DEV] PHP 4.0 Bug #9644 Updated: File Upload eats all RAM and swap space

2001-03-16 Thread gerard

ID: 9644
User Update by: [EMAIL PROTECTED]
Status: Open
Bug Type: Reproduceable crash
Description: File Upload eats all RAM and swap space

After doing some experimentation, I have realized something about Apache and PHP.

According to what 'ps aux' returns, when I run apache with PHP as I have been doing 
normally, it has been using from 2.5%MEM - 5.0%MEM (it varies) for each child at 
startup.  However, whenever I disable the PHP modules from Apache (by commenting off 
these lines in httpd.conf: 'LoadModule php4_module libexec/libphp4.so' and 
'AddModule mod_php4.c'), the 'ps aux' returns 0.7%MEM per child at startup.

In comparison to some other linux boxes running Apache and PHP, 2.5%MEM - 5.0%MEM is a 
large amount of RAM used.

Could this relate in any way to the problem that I am having with file uploads on my 
box?

Previous Comments:
---

[2001-03-12 01:29:57] [EMAIL PROTECTED]
I have never used gdb before, but I have a feeling that it is not working correctly.

Here are the results:

root@linux:/home/install/apps/apache/apache_1.3.19# gdb /usr/local/apache/bin/httpd
GNU gdb 5.0
Copyright 2000 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for details.
This GDB was configured as "i586-pc-linux-gnu"...
(gdb) run -X
Starting program: /usr/local/apache/bin/httpd -X
warning: Unable to find dynamic linker breakpoint function.
GDB will be unable to debug shared library initializers
and track explicitly loaded dynamic code.
Processing config directory: /usr/local/apache/conf/virtualhosts/magestudios.net/
 Processing config file: /usr/local/apache/conf/virtualhosts/magestudios.net/cwolvie
 Processing config file: /usr/local/apache/conf/virtualhosts/magestudios.net/eeno
 Processing config file: /usr/local/apache/conf/virtualhosts/magestudios.net/ewang
 Processing config file: /usr/local/apache/conf/virtualhosts/magestudios.net/ftp
 Processing config file: /usr/local/apache/conf/virtualhosts/magestudios.net/g2
 Processing config file: /usr/local/apache/conf/virtualhosts/magestudios.net/likwidx
 Processing config file: /usr/local/apache/conf/virtualhosts/magestudios.net/mail
 Processing config file: /usr/local/apache/conf/virtualhosts/magestudios.net/moscrop
 Processing config file: /usr/local/apache/conf/virtualhosts/magestudios.net/mouthoff
 Processing config file: /usr/local/apache/conf/virtualhosts/magestudios.net/pirachu
 Processing config file: /usr/local/apache/conf/virtualhosts/magestudios.net/stats
 Processing config file: /usr/local/apache/conf/virtualhosts/magestudios.net/web
 Processing config file: /usr/local/apache/conf/virtualhosts/magestudios.net/www
 Processing config file: /usr/local/apache/conf/virtualhosts/magestudios.net/xtracool

Program received signal SIGINT, Interrupt.
0x4046c564 in read () from /lib/libc.so.6
(gdb) bt full
#0  0x4046c564 in read () from /lib/libc.so.6
No symbol table info available.
#1  0x81d2044 in ?? ()
No symbol table info available.
#2  0x8084bf5 in buff_read ()
No symbol table info available.
#3  0x8084b92 in saferead_guts ()
No symbol table info available.
#4  0x8083612 in read_with_errors ()
No symbol table info available.
#5  0x8083980 in ap_bgets ()
No symbol table info available.
#6  0x8093c1b in getline ()
No symbol table info available.
#7  0x8093efd in read_request_line ()
No symbol table info available.
#8  0x809459e in ap_read_request ()
No symbol table info available.
#9  0x8091104 in child_main ()
No symbol table info available.
#10 0x8091301 in make_child ()
No symbol table info available.
#11 0x809147c in startup_children ()
No symbol table info available.
#12 0x8091aec in standalone_main ()
No symbol table info available.
#13 0x809231c in main ()
No symbol table info available.
#14 0x403e4577 in __libc_start_main () from /lib/libc.so.6
No symbol table info available.
(gdb)




---

[2001-03-11 16:21:25] [EMAIL PROTECTED]
Try creating a GDB backtrace of that.

1. rm config.cache
2. Add --enable-debug to you php configure line
3. 'make clean ; make ; make install'
4. And same for apache (step 3.)
5. apachectl stop
6. gdb /path/to/httpd
7. (gdb) run -X
8. Then try that script I sent you.
9. When (if) it hangs, ctrl+c
10. (gdb) bt full
11. cut'n'paste that backtrace into this bug report.

And do all this using the LATEST CVS snapshot.

--Jani


---

[2001-03-11 04:25:06] [EMAIL PROTECTED]
I'm also getting the same problem with this script.

Any script, even those that work on other systems, are giving

[PHP-DEV] PHP 4.0 Bug #9644 Updated: File Upload eats all RAM and swap space

2001-03-11 Thread gerard

ID: 9644
User Update by: [EMAIL PROTECTED]
Old-Status: Feedback
Status: Open
Bug Type: Reproduceable crash
Description: File Upload eats all RAM and swap space

I have never used gdb before, but I have a feeling that it is not working correctly.

Here are the results:

root@linux:/home/install/apps/apache/apache_1.3.19# gdb /usr/local/apache/bin/httpd
GNU gdb 5.0
Copyright 2000 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for details.
This GDB was configured as "i586-pc-linux-gnu"...
(gdb) run -X
Starting program: /usr/local/apache/bin/httpd -X
warning: Unable to find dynamic linker breakpoint function.
GDB will be unable to debug shared library initializers
and track explicitly loaded dynamic code.
Processing config directory: /usr/local/apache/conf/virtualhosts/magestudios.net/
 Processing config file: /usr/local/apache/conf/virtualhosts/magestudios.net/cwolvie
 Processing config file: /usr/local/apache/conf/virtualhosts/magestudios.net/eeno
 Processing config file: /usr/local/apache/conf/virtualhosts/magestudios.net/ewang
 Processing config file: /usr/local/apache/conf/virtualhosts/magestudios.net/ftp
 Processing config file: /usr/local/apache/conf/virtualhosts/magestudios.net/g2
 Processing config file: /usr/local/apache/conf/virtualhosts/magestudios.net/likwidx
 Processing config file: /usr/local/apache/conf/virtualhosts/magestudios.net/mail
 Processing config file: /usr/local/apache/conf/virtualhosts/magestudios.net/moscrop
 Processing config file: /usr/local/apache/conf/virtualhosts/magestudios.net/mouthoff
 Processing config file: /usr/local/apache/conf/virtualhosts/magestudios.net/pirachu
 Processing config file: /usr/local/apache/conf/virtualhosts/magestudios.net/stats
 Processing config file: /usr/local/apache/conf/virtualhosts/magestudios.net/web
 Processing config file: /usr/local/apache/conf/virtualhosts/magestudios.net/www
 Processing config file: /usr/local/apache/conf/virtualhosts/magestudios.net/xtracool

Program received signal SIGINT, Interrupt.
0x4046c564 in read () from /lib/libc.so.6
(gdb) bt full
#0  0x4046c564 in read () from /lib/libc.so.6
No symbol table info available.
#1  0x81d2044 in ?? ()
No symbol table info available.
#2  0x8084bf5 in buff_read ()
No symbol table info available.
#3  0x8084b92 in saferead_guts ()
No symbol table info available.
#4  0x8083612 in read_with_errors ()
No symbol table info available.
#5  0x8083980 in ap_bgets ()
No symbol table info available.
#6  0x8093c1b in getline ()
No symbol table info available.
#7  0x8093efd in read_request_line ()
No symbol table info available.
#8  0x809459e in ap_read_request ()
No symbol table info available.
#9  0x8091104 in child_main ()
No symbol table info available.
#10 0x8091301 in make_child ()
No symbol table info available.
#11 0x809147c in startup_children ()
No symbol table info available.
#12 0x8091aec in standalone_main ()
No symbol table info available.
#13 0x809231c in main ()
No symbol table info available.
#14 0x403e4577 in __libc_start_main () from /lib/libc.so.6
No symbol table info available.
(gdb)




Previous Comments:
---

[2001-03-11 16:21:25] [EMAIL PROTECTED]
Try creating a GDB backtrace of that.

1. rm config.cache
2. Add --enable-debug to you php configure line
3. 'make clean ; make ; make install'
4. And same for apache (step 3.)
5. apachectl stop
6. gdb /path/to/httpd
7. (gdb) run -X
8. Then try that script I sent you.
9. When (if) it hangs, ctrl+c
10. (gdb) bt full
11. cut'n'paste that backtrace into this bug report.

And do all this using the LATEST CVS snapshot.

--Jani


---

[2001-03-11 04:25:06] [EMAIL PROTECTED]
I'm also getting the same problem with this script.

Any script, even those that work on other systems, are giving problems on my system.

---

[2001-03-10 20:04:10] [EMAIL PROTECTED]
I can't reproduce this. Please try the following script.

upload.php:









---

[2001-03-10 01:52:48] [EMAIL PROTECTED]
I have compiled the CVS snapshot, with the same configure options as before, and the 
problem still exists.  Have not compiled it with APC this time.

I have copied php.ini-dist to /usr/local/lib/php.ini



---

[2001-03-09 19:49:25] [EMAIL PROTECTED]
1. There is an entry for APC in your php.ini.. have you
tried this without APC? 

2. Please try the latest CVS snapshot fro

[PHP-DEV] PHP 4.0 Bug #9644 Updated: File Upload eats all RAM and swap space

2001-03-11 Thread sniper

ID: 9644
Updated by: sniper
Reported By: [EMAIL PROTECTED]
Old-Status: Open
Status: Feedback
Bug Type: Reproduceable crash
Assigned To: 
Comments:

Try creating a GDB backtrace of that.

1. rm config.cache
2. Add --enable-debug to you php configure line
3. 'make clean ; make ; make install'
4. And same for apache (step 3.)
5. apachectl stop
6. gdb /path/to/httpd
7. (gdb) run -X
8. Then try that script I sent you.
9. When (if) it hangs, ctrl+c
10. (gdb) bt full
11. cut'n'paste that backtrace into this bug report.

And do all this using the LATEST CVS snapshot.

--Jani


Previous Comments:
---

[2001-03-11 04:25:06] [EMAIL PROTECTED]
I'm also getting the same problem with this script.

Any script, even those that work on other systems, are giving problems on my system.

---

[2001-03-10 20:04:10] [EMAIL PROTECTED]
I can't reproduce this. Please try the following script.

upload.php:









---

[2001-03-10 01:52:48] [EMAIL PROTECTED]
I have compiled the CVS snapshot, with the same configure options as before, and the 
problem still exists.  Have not compiled it with APC this time.

I have copied php.ini-dist to /usr/local/lib/php.ini



---

[2001-03-09 19:49:25] [EMAIL PROTECTED]
1. There is an entry for APC in your php.ini.. have you
tried this without APC? 

2. Please try the latest CVS snapshot from http://snaps.php.net/

--Jani


---

[2001-03-09 01:10:31] [EMAIL PROTECTED]
Hi!

I'm using PHP to create a file upload script for a website.  When a user uploads a 
large file (>1Mb) my server always starts to use all the available RAM(I have 160Mb 
installed), and also uses up all the swap space(256Mb).  This happens for any upload 
script written in PHP, even scripts that work on other servers.  I can upload files to 
scripts written in PERL, without a problem.  To resolve this problem, my only option 
is to completely kill apache with 'apachectl stop' and then start it back 'apachectl 
start'

Server software:
Apache 1.3.19 (also happened while I was running 1.3.17)
PHP 4.0.4pl1
Linux 2.4.1 (originally slackware 7.1 distro)

Server specs:
Intel Pentium 133Mhz
160Mb RAM
10Gb HDD

Here is the script that I'm using:
Trying something?";
} else {
if ($userfile_size) {
$target = $xdir.'/'.$userfile_name;
if (!copy ($userfile,$target)) {
echo 'Error copying file! Please try again!Press the back button in your 
browser!';
} else {
header ("Location: 
http://mouthoff.magestudios.net/admin/filemanager/?path=".urlencode($path));
exit;
}
} else {
?>

Upload this file: 






I'm a PHP newbie, so please excuse any bad coding =)

Here's a copy of php.ini:
[PHP]

;;;
; About this file ;
;;;
; This file controls many aspects of PHP's behavior.  In order for PHP to
; read it, it must be named 'php.ini'.  PHP looks for it in the current
; working directory, in the path designated by the environment variable
; PHPRC, and in the path that was defined in compile time (in that order).
; Under Windows, the compile-time path is the Windows directory.  The
; path in which the php.ini file is looked for can be overriden using
; the -c argument in command line mode.
;
; The syntax of the file is extremely simple.  Whitespace and Lines
; beginning with a semicolon are silently ignored (as you probably guessed).
; Section headers (e.g. [Foo]) are also silently ignored, even though
; they might mean something in the future.
;
; Directives are specified using the following syntax:
; directive = value
; Directive names are *case sensitive* - foo=bar is different from FOO=bar.
;
; The value can be a string, a number, a PHP constant (e.g. E_ALL or M_PI), one
; of the INI constants (On, Off, True, False, Yes, No and None) or an expression
; (e.g. E_ALL & ~E_NOTICE), or a quoted string ("foo").
;
; Expressions in the INI file are limited to bitwise operators and parentheses:
; | bitwise OR
; & bitwise AND
; ~ bitwise NOT
; ! boolean NOT
;
; Boolean flags can be turned on using the values 1, On, True or Yes.
; They can be turned off using the values 0, Off, False or No.
;
; An empty string can be denoted by simply not writing anything after the equal
; sign, or by using the None keyword:
;
;   foo =   ; sets foo to an empty string
;   foo = none  ; sets foo to an empty string
;   foo = "none"; sets foo to the string 'none'
;
; If you use constants in your value, and these 

[PHP-DEV] PHP 4.0 Bug #9644 Updated: File Upload eats all RAM and swap space

2001-03-11 Thread gerard

ID: 9644
User Update by: [EMAIL PROTECTED]
Old-Status: Feedback
Status: Open
Bug Type: Reproduceable crash
Description: File Upload eats all RAM and swap space

I'm also getting the same problem with this script.

Any script, even those that work on other systems, are giving problems on my system.

Previous Comments:
---

[2001-03-10 20:04:10] [EMAIL PROTECTED]
I can't reproduce this. Please try the following script.

upload.php:









---

[2001-03-10 01:52:48] [EMAIL PROTECTED]
I have compiled the CVS snapshot, with the same configure options as before, and the 
problem still exists.  Have not compiled it with APC this time.

I have copied php.ini-dist to /usr/local/lib/php.ini



---

[2001-03-09 19:49:25] [EMAIL PROTECTED]
1. There is an entry for APC in your php.ini.. have you
tried this without APC? 

2. Please try the latest CVS snapshot from http://snaps.php.net/

--Jani


---

[2001-03-09 01:10:31] [EMAIL PROTECTED]
Hi!

I'm using PHP to create a file upload script for a website.  When a user uploads a 
large file (>1Mb) my server always starts to use all the available RAM(I have 160Mb 
installed), and also uses up all the swap space(256Mb).  This happens for any upload 
script written in PHP, even scripts that work on other servers.  I can upload files to 
scripts written in PERL, without a problem.  To resolve this problem, my only option 
is to completely kill apache with 'apachectl stop' and then start it back 'apachectl 
start'

Server software:
Apache 1.3.19 (also happened while I was running 1.3.17)
PHP 4.0.4pl1
Linux 2.4.1 (originally slackware 7.1 distro)

Server specs:
Intel Pentium 133Mhz
160Mb RAM
10Gb HDD

Here is the script that I'm using:
Trying something?";
} else {
if ($userfile_size) {
$target = $xdir.'/'.$userfile_name;
if (!copy ($userfile,$target)) {
echo 'Error copying file! Please try again!Press the back button in your 
browser!';
} else {
header ("Location: 
http://mouthoff.magestudios.net/admin/filemanager/?path=".urlencode($path));
exit;
}
} else {
?>

Upload this file: 






I'm a PHP newbie, so please excuse any bad coding =)

Here's a copy of php.ini:
[PHP]

;;;
; About this file ;
;;;
; This file controls many aspects of PHP's behavior.  In order for PHP to
; read it, it must be named 'php.ini'.  PHP looks for it in the current
; working directory, in the path designated by the environment variable
; PHPRC, and in the path that was defined in compile time (in that order).
; Under Windows, the compile-time path is the Windows directory.  The
; path in which the php.ini file is looked for can be overriden using
; the -c argument in command line mode.
;
; The syntax of the file is extremely simple.  Whitespace and Lines
; beginning with a semicolon are silently ignored (as you probably guessed).
; Section headers (e.g. [Foo]) are also silently ignored, even though
; they might mean something in the future.
;
; Directives are specified using the following syntax:
; directive = value
; Directive names are *case sensitive* - foo=bar is different from FOO=bar.
;
; The value can be a string, a number, a PHP constant (e.g. E_ALL or M_PI), one
; of the INI constants (On, Off, True, False, Yes, No and None) or an expression
; (e.g. E_ALL & ~E_NOTICE), or a quoted string ("foo").
;
; Expressions in the INI file are limited to bitwise operators and parentheses:
; | bitwise OR
; & bitwise AND
; ~ bitwise NOT
; ! boolean NOT
;
; Boolean flags can be turned on using the values 1, On, True or Yes.
; They can be turned off using the values 0, Off, False or No.
;
; An empty string can be denoted by simply not writing anything after the equal
; sign, or by using the None keyword:
;
;   foo =   ; sets foo to an empty string
;   foo = none  ; sets foo to an empty string
;   foo = "none"; sets foo to the string 'none'
;
; If you use constants in your value, and these constants belong to a dynamically
; loaded extension (either a PHP extension or a Zend extension), you may only
; use these constants *after* the line that loads the extension.
;
; All the values in the php.ini-dist file correspond to the builtin
; defaults (that is, if no php.ini is used, or if you delete these lines,
; the builtin defaults will be identical).



; Language Options ;


engine  =   On  ; Enable the PHP scripting language engine 
under Apache
short_op

[PHP-DEV] PHP 4.0 Bug #9644 Updated: File Upload eats all RAM and swap space

2001-03-10 Thread sniper

ID: 9644
Updated by: sniper
Reported By: [EMAIL PROTECTED]
Old-Status: Open
Status: Feedback
Bug Type: Reproduceable crash
Assigned To: 
Comments:

I can't reproduce this. Please try the following script.

upload.php:









Previous Comments:
---

[2001-03-10 01:52:48] [EMAIL PROTECTED]
I have compiled the CVS snapshot, with the same configure options as before, and the 
problem still exists.  Have not compiled it with APC this time.

I have copied php.ini-dist to /usr/local/lib/php.ini



---

[2001-03-09 19:49:25] [EMAIL PROTECTED]
1. There is an entry for APC in your php.ini.. have you
tried this without APC? 

2. Please try the latest CVS snapshot from http://snaps.php.net/

--Jani


---

[2001-03-09 01:10:31] [EMAIL PROTECTED]
Hi!

I'm using PHP to create a file upload script for a website.  When a user uploads a 
large file (>1Mb) my server always starts to use all the available RAM(I have 160Mb 
installed), and also uses up all the swap space(256Mb).  This happens for any upload 
script written in PHP, even scripts that work on other servers.  I can upload files to 
scripts written in PERL, without a problem.  To resolve this problem, my only option 
is to completely kill apache with 'apachectl stop' and then start it back 'apachectl 
start'

Server software:
Apache 1.3.19 (also happened while I was running 1.3.17)
PHP 4.0.4pl1
Linux 2.4.1 (originally slackware 7.1 distro)

Server specs:
Intel Pentium 133Mhz
160Mb RAM
10Gb HDD

Here is the script that I'm using:
Trying something?";
} else {
if ($userfile_size) {
$target = $xdir.'/'.$userfile_name;
if (!copy ($userfile,$target)) {
echo 'Error copying file! Please try again!Press the back button in your 
browser!';
} else {
header ("Location: 
http://mouthoff.magestudios.net/admin/filemanager/?path=".urlencode($path));
exit;
}
} else {
?>

Upload this file: 






I'm a PHP newbie, so please excuse any bad coding =)

Here's a copy of php.ini:
[PHP]

;;;
; About this file ;
;;;
; This file controls many aspects of PHP's behavior.  In order for PHP to
; read it, it must be named 'php.ini'.  PHP looks for it in the current
; working directory, in the path designated by the environment variable
; PHPRC, and in the path that was defined in compile time (in that order).
; Under Windows, the compile-time path is the Windows directory.  The
; path in which the php.ini file is looked for can be overriden using
; the -c argument in command line mode.
;
; The syntax of the file is extremely simple.  Whitespace and Lines
; beginning with a semicolon are silently ignored (as you probably guessed).
; Section headers (e.g. [Foo]) are also silently ignored, even though
; they might mean something in the future.
;
; Directives are specified using the following syntax:
; directive = value
; Directive names are *case sensitive* - foo=bar is different from FOO=bar.
;
; The value can be a string, a number, a PHP constant (e.g. E_ALL or M_PI), one
; of the INI constants (On, Off, True, False, Yes, No and None) or an expression
; (e.g. E_ALL & ~E_NOTICE), or a quoted string ("foo").
;
; Expressions in the INI file are limited to bitwise operators and parentheses:
; | bitwise OR
; & bitwise AND
; ~ bitwise NOT
; ! boolean NOT
;
; Boolean flags can be turned on using the values 1, On, True or Yes.
; They can be turned off using the values 0, Off, False or No.
;
; An empty string can be denoted by simply not writing anything after the equal
; sign, or by using the None keyword:
;
;   foo =   ; sets foo to an empty string
;   foo = none  ; sets foo to an empty string
;   foo = "none"; sets foo to the string 'none'
;
; If you use constants in your value, and these constants belong to a dynamically
; loaded extension (either a PHP extension or a Zend extension), you may only
; use these constants *after* the line that loads the extension.
;
; All the values in the php.ini-dist file correspond to the builtin
; defaults (that is, if no php.ini is used, or if you delete these lines,
; the builtin defaults will be identical).



; Language Options ;


engine  =   On  ; Enable the PHP scripting language engine 
under Apache
short_open_tag  =   On  ; allow the  tags are recognized.
asp_tags=   Off ; allow ASP-style <% %> tags
precision   =   14  ; number of significant digits displayed in 
floating point numbers
y2k_compliance  =   Off ; whe

[PHP-DEV] PHP 4.0 Bug #9644 Updated: File Upload eats all RAM and swap space

2001-03-09 Thread gerard

ID: 9644
User Update by: [EMAIL PROTECTED]
Old-Status: Feedback
Status: Open
Bug Type: Reproduceable crash
Description: File Upload eats all RAM and swap space

I have compiled the CVS snapshot, with the same configure options as before, and the 
problem still exists.  Have not compiled it with APC this time.

I have copied php.ini-dist to /usr/local/lib/php.ini



Previous Comments:
---

[2001-03-09 19:49:25] [EMAIL PROTECTED]
1. There is an entry for APC in your php.ini.. have you
tried this without APC? 

2. Please try the latest CVS snapshot from http://snaps.php.net/

--Jani


---

[2001-03-09 01:10:31] [EMAIL PROTECTED]
Hi!

I'm using PHP to create a file upload script for a website.  When a user uploads a 
large file (>1Mb) my server always starts to use all the available RAM(I have 160Mb 
installed), and also uses up all the swap space(256Mb).  This happens for any upload 
script written in PHP, even scripts that work on other servers.  I can upload files to 
scripts written in PERL, without a problem.  To resolve this problem, my only option 
is to completely kill apache with 'apachectl stop' and then start it back 'apachectl 
start'

Server software:
Apache 1.3.19 (also happened while I was running 1.3.17)
PHP 4.0.4pl1
Linux 2.4.1 (originally slackware 7.1 distro)

Server specs:
Intel Pentium 133Mhz
160Mb RAM
10Gb HDD

Here is the script that I'm using:
Trying something?";
} else {
if ($userfile_size) {
$target = $xdir.'/'.$userfile_name;
if (!copy ($userfile,$target)) {
echo 'Error copying file! Please try again!Press the back button in your 
browser!';
} else {
header ("Location: 
http://mouthoff.magestudios.net/admin/filemanager/?path=".urlencode($path));
exit;
}
} else {
?>

Upload this file: 






I'm a PHP newbie, so please excuse any bad coding =)

Here's a copy of php.ini:
[PHP]

;;;
; About this file ;
;;;
; This file controls many aspects of PHP's behavior.  In order for PHP to
; read it, it must be named 'php.ini'.  PHP looks for it in the current
; working directory, in the path designated by the environment variable
; PHPRC, and in the path that was defined in compile time (in that order).
; Under Windows, the compile-time path is the Windows directory.  The
; path in which the php.ini file is looked for can be overriden using
; the -c argument in command line mode.
;
; The syntax of the file is extremely simple.  Whitespace and Lines
; beginning with a semicolon are silently ignored (as you probably guessed).
; Section headers (e.g. [Foo]) are also silently ignored, even though
; they might mean something in the future.
;
; Directives are specified using the following syntax:
; directive = value
; Directive names are *case sensitive* - foo=bar is different from FOO=bar.
;
; The value can be a string, a number, a PHP constant (e.g. E_ALL or M_PI), one
; of the INI constants (On, Off, True, False, Yes, No and None) or an expression
; (e.g. E_ALL & ~E_NOTICE), or a quoted string ("foo").
;
; Expressions in the INI file are limited to bitwise operators and parentheses:
; | bitwise OR
; & bitwise AND
; ~ bitwise NOT
; ! boolean NOT
;
; Boolean flags can be turned on using the values 1, On, True or Yes.
; They can be turned off using the values 0, Off, False or No.
;
; An empty string can be denoted by simply not writing anything after the equal
; sign, or by using the None keyword:
;
;   foo =   ; sets foo to an empty string
;   foo = none  ; sets foo to an empty string
;   foo = "none"; sets foo to the string 'none'
;
; If you use constants in your value, and these constants belong to a dynamically
; loaded extension (either a PHP extension or a Zend extension), you may only
; use these constants *after* the line that loads the extension.
;
; All the values in the php.ini-dist file correspond to the builtin
; defaults (that is, if no php.ini is used, or if you delete these lines,
; the builtin defaults will be identical).



; Language Options ;


engine  =   On  ; Enable the PHP scripting language engine 
under Apache
short_open_tag  =   On  ; allow the  tags are recognized.
asp_tags=   Off ; allow ASP-style <% %> tags
precision   =   14  ; number of significant digits displayed in 
floating point numbers
y2k_compliance  =   Off ; whether to be year 2000 compliant (will cause 
problems with non y2k compliant browsers)
output_buffering= Off   ; Output buffering allows you to send header lines 
(including cookies)
 

[PHP-DEV] PHP 4.0 Bug #9644 Updated: File Upload eats all RAM and swap space

2001-03-09 Thread sniper

ID: 9644
Updated by: sniper
Reported By: [EMAIL PROTECTED]
Old-Status: Open
Status: Feedback
Bug Type: Reproduceable crash
Assigned To: 
Comments:

1. There is an entry for APC in your php.ini.. have you
tried this without APC? 

2. Please try the latest CVS snapshot from http://snaps.php.net/

--Jani


Previous Comments:
---

[2001-03-09 01:10:31] [EMAIL PROTECTED]
Hi!

I'm using PHP to create a file upload script for a website.  When a user uploads a 
large file (>1Mb) my server always starts to use all the available RAM(I have 160Mb 
installed), and also uses up all the swap space(256Mb).  This happens for any upload 
script written in PHP, even scripts that work on other servers.  I can upload files to 
scripts written in PERL, without a problem.  To resolve this problem, my only option 
is to completely kill apache with 'apachectl stop' and then start it back 'apachectl 
start'

Server software:
Apache 1.3.19 (also happened while I was running 1.3.17)
PHP 4.0.4pl1
Linux 2.4.1 (originally slackware 7.1 distro)

Server specs:
Intel Pentium 133Mhz
160Mb RAM
10Gb HDD

Here is the script that I'm using:
Trying something?";
} else {
if ($userfile_size) {
$target = $xdir.'/'.$userfile_name;
if (!copy ($userfile,$target)) {
echo 'Error copying file! Please try again!Press the back button in your 
browser!';
} else {
header ("Location: 
http://mouthoff.magestudios.net/admin/filemanager/?path=".urlencode($path));
exit;
}
} else {
?>

Upload this file: 






I'm a PHP newbie, so please excuse any bad coding =)

Here's a copy of php.ini:
[PHP]

;;;
; About this file ;
;;;
; This file controls many aspects of PHP's behavior.  In order for PHP to
; read it, it must be named 'php.ini'.  PHP looks for it in the current
; working directory, in the path designated by the environment variable
; PHPRC, and in the path that was defined in compile time (in that order).
; Under Windows, the compile-time path is the Windows directory.  The
; path in which the php.ini file is looked for can be overriden using
; the -c argument in command line mode.
;
; The syntax of the file is extremely simple.  Whitespace and Lines
; beginning with a semicolon are silently ignored (as you probably guessed).
; Section headers (e.g. [Foo]) are also silently ignored, even though
; they might mean something in the future.
;
; Directives are specified using the following syntax:
; directive = value
; Directive names are *case sensitive* - foo=bar is different from FOO=bar.
;
; The value can be a string, a number, a PHP constant (e.g. E_ALL or M_PI), one
; of the INI constants (On, Off, True, False, Yes, No and None) or an expression
; (e.g. E_ALL & ~E_NOTICE), or a quoted string ("foo").
;
; Expressions in the INI file are limited to bitwise operators and parentheses:
; | bitwise OR
; & bitwise AND
; ~ bitwise NOT
; ! boolean NOT
;
; Boolean flags can be turned on using the values 1, On, True or Yes.
; They can be turned off using the values 0, Off, False or No.
;
; An empty string can be denoted by simply not writing anything after the equal
; sign, or by using the None keyword:
;
;   foo =   ; sets foo to an empty string
;   foo = none  ; sets foo to an empty string
;   foo = "none"; sets foo to the string 'none'
;
; If you use constants in your value, and these constants belong to a dynamically
; loaded extension (either a PHP extension or a Zend extension), you may only
; use these constants *after* the line that loads the extension.
;
; All the values in the php.ini-dist file correspond to the builtin
; defaults (that is, if no php.ini is used, or if you delete these lines,
; the builtin defaults will be identical).



; Language Options ;


engine  =   On  ; Enable the PHP scripting language engine 
under Apache
short_open_tag  =   On  ; allow the  tags are recognized.
asp_tags=   Off ; allow ASP-style <% %> tags
precision   =   14  ; number of significant digits displayed in 
floating point numbers
y2k_compliance  =   Off ; whether to be year 2000 compliant (will cause 
problems with non y2k compliant browsers)
output_buffering= Off   ; Output buffering allows you to send header lines 
(including cookies)
; even after you send body 
content, in the price of slowing PHP's
; output layer a bit.
; You can enable output 
buffering by in runtime by calling the output