#25074 [Opn->Bgs]: addslashes() fails for large data
| From: | iliaa@php.net | Date: | Wed, 13 Aug 2003 17:24:22 +0000 |
| Subject: | #25074 [Opn->Bgs]: addslashes() fails for large data | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-45864@lists.php.net to get a copy of this message | ||
ID: 25074
Updated by: iliaa@php.net
Reported By: sandeepc at myrealbox dot com
-Status: Open
+Status: Bogus
Bug Type: Performance problem
Operating System: Linux 2.4.9
PHP Version: Irrelevant
New Comment:
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.
This sounds like a configuration issue, possibly having to do with the
memory limit.
Previous Comments:
------------------------------------------------------------------------
[2003-08-13 06:38:08] sandeepc at myrealbox dot com
Description:
------------
using addslashes() on large data fails. We tested with data size
ranging form 4MB to 100 MB.It would fail around 36 MB of data.
I have'nt tested this in the latest releases, however.
From phpinfo():
PHP Version 4.2.3
System: Linux linuxbuild 2.4.9-e.3smp #1 SMP Fri May 3 16:48:54 EDT
2002 i686
Build Date Apr 29 2003 17:44:32
Server API Apache
Virtual Directory Support disabled
Thread Safety disabled
Configure Command './configure' '--enable-shared=all'
'--disable-static' '--enable-memory-limit=yes'
'--enable-magic-quotes=yes' '--enable-debug=no'
'--enable-inline-optimization' '--enable-mbstring'
'--enable-safe-mode'
'--enable-sigchild' '--enable-sysvsem' '--enable-sysvshm'
'--enable-shmop' '--enable-track-vars' '--enable-gd-native-ttf'
'--enable-gd-imgstrttf' '--with-gd' '--with-xml'
'--with-dom'
'--with-ttf' '--with-gettext' '--with-ldap' '--with-curl'
'--with-mcrypt' '--without-mysql' '--without-imap'
'--with-pgsql'
'--with-apxs'
Reproduce code:
---------------
<?php
if ($upload){
$size=filesize($uploaded_data);
$data = "";
if (is_uploaded_file($uploaded_data)){
if ($fp = fopen($uploaded_data, "r")){
$data = fread($fp,$size);
fclose($fp);
addslashes($data);
print "Hello World";
}// end if (able to get uploaded file)
}
}
else{
?>
<html>
<form method="POST" enctype="multipart/form-data"
name="testform">
<input type="hidden" name="MAX_FILE_SIZE" value="104857600">
<input type="file" name="uploaded_data"
size="30"><br><br>
<input type="submit" name="upload" value="Upload">
</form>
</html>
<?php
}
?>
Expected result:
----------------
We are storing the uploaded file into a table(Postgres).
The uploaded data needs to be addslashes()'d before storing into the
database.
Actual result:
--------------
There is no error in the error log, however the php hangs.
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=25074&edit=1