#31398 [Opn]: File Upload Original name problem with magic_quotes_gpc = On

2005-01-13 Thread theseer
 ID:   31398
 Updated by:   [EMAIL PROTECTED]
-Summary:  File Upload Original name problem
 Reported By:  lobo235 at gmail dot com
 Status:   Open
-Bug Type: Documentation problem
+Bug Type: Scripting Engine problem
 Operating System: Windows and Linux
 PHP Version:  4CVS-2005-01-04 (stable)
 New Comment:

I don't consider that a documentation problem but rather an engine bug
(?)


Previous Comments:


[2005-01-11 13:03:40] fsolinas at it dot tiscali dot com

I've been able to reproduce this bug on PHP 4.3.10 with
magic_quotes_gpc = On.
It's *not* reproducible turning off magic_quotes_gpc,
because the array element containing the (original) file
name is preserved "intact" this way.

This bug seems to have been introduced in 4.3.10, and breaks
many document management systems that rely on
$_FILES['userfile']['name'] as the name of the file
uploaded, definitely forcing users to *not* use single
quotes in filename.

Do you plan to write a patch to fix this behaviour?



[2005-01-05 16:18:51] lobo235 at gmail dot com

It may be only PHP4 specific, I do remember it working at one point
though using PHP4 a couple of months ago. I had written a file upload
script for one of my sites and I remember testing to see what types of
filenames it would support and the apostrophes worked fine then. It
wasn't until just recently that my host upgraded to 4.3.10 that I
started to notice the problem, now my script does not work as it used
to.



[2005-01-05 10:11:50] [EMAIL PROTECTED]

I can't reproduce this on PHP 5.0.2 with php.ini-dist, Apache 2 and
Windows. "lobo235's fam.jpg" becomes "lobo235\'s fam.jpg" or "lobo235's
fam.jpg" with magic_quotes_gpc=Off.

Maybe it's PHP 4 specific.



[2005-01-05 09:03:22] [EMAIL PROTECTED]

Yeah, I agree... the documentation should mention this issue.



[2005-01-04 22:49:51] lobo235 at gmail dot com

If I remember correctly, PHP used to handle filenames of this type just
fine. I know that other scripting languages are able to handle these
types of filenames just fine. Is there any way that this can be
implemented in a future version? It seems like if an array element is
going to be set to the "original" file name it should work all the time
or not at all. It is misleading when one reads the documentation
concerning Handling file uploads. It says:

$_FILES['userfile']['name']

The original name of the file on the client machine. 

To me this says that no matter what they've named their file this array
element always gets set to the name of the file on the client machine.
Maybe a change is needed in the documentation.



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/31398

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


#26490 [NoF->Opn]: Lost connection to MySQL server during query

2004-03-11 Thread theseer
 ID:   26490
 Updated by:   [EMAIL PROTECTED]
 Reported By:  chris dot noden at monstermob dot com
-Status:   No Feedback
+Status:   Open
 Bug Type: MySQL related
 Operating System: Redhat AS 2.1
 PHP Version:  4.3.3
 New Comment:

Since i just stumbled across the very same problem, i wrote a small (?)
testcode to check it.



It seems like using pconnect in favor of a 'normal' connect fixes the
problem for the testcode, while it does not for my reallife
application.



The code assumes a database with at least 100 rows.

Structure as follows:



CREATE TABLE debug2 (

  ID int(11) NOT NULL auto_increment,

  CODE varchar(10) NOT NULL default '',

  PRIMARY KEY  (ID),

) TYPE=MyISAM 





This is the testcode, run it from cli ;)



 $ppid) {

 $tmp=pcntl_waitpid($ppid, $temp, WNOHANG);

 if ($tmp!=0 ) {

unset($pidlist[$key]);

 }

 }

 sleep(2);

 }





 ?>





You may have to run the code multiple times to actually see the
problem. The "Lost connection" error doesn't occur on a fixed rate or
value. You may be 'lucky' and don't hit it at all in a run..



Feel free to contact me in irc ( freenode / ircnet ) 




Previous Comments:


[2003-12-07 12:00:26] [EMAIL PROTECTED]

No feedback was provided. The bug is being suspended because
we assume that you are no longer experiencing the problem.
If this is not the case and you are able to provide the
information that was requested earlier, please do so and
change the status of the bug back to "Open". Thank you.





[2003-12-02 01:03:21] [EMAIL PROTECTED]

Thank you for this bug report. To properly diagnose the problem, we
need a short but complete example script to be able to reproduce
this bug ourselves. 

A proper reproducing script starts with ,
is max. 10-20 lines long and does not require any external 
resources such as databases, etc.

If possible, make the script source available online and provide
an URL to it here. Try avoid embedding huge scripts into the report.







[2003-12-01 13:16:29] chris dot noden at monstermob dot com

Description:

MySQL version 4.0.13 running on a different server on the LAN using
pconnect:



After using a pcntl_fork() the child thread suffers from the "2013 :
Lost connection to MySQL server" error above.



I can continue to use the MySQL connection without connecting again
implying that the connection has miraculously re-established itself!



The error can occur at any stage in a query, (eg during submission or
reading the results of the query).



The error usually manifests itself when the query returns no results. 
The error comes from the parent process!!



I have tried all sorts of workarounds, to no avail.

Reproduce code:
---
do {

$sql = "SELECT stuff FROM db WHERE a=b";

$qryID = mysql_query($sql,$Link_ID

while (mysql_fetch_array($qryID)) {

// Fork off a child

$is_parent = pcntl_fork();

if ($is_parent > 0) {

// I am the child - do some stuff

exit;

} else {

// I am the parent do some stuff

} // end if/else



sleep(1);

} while (condition);



Expected result:

Normal database flow.

Actual result:
--
Error 2013 - Lost connection to MySQL server during query





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


#26490 [Opn]: Lost connection to MySQL server during query

2004-03-11 Thread theseer
 ID:   26490
 Updated by:   [EMAIL PROTECTED]
 Reported By:  chris dot noden at monstermob dot com
 Status:   Open
 Bug Type: MySQL related
 Operating System: Redhat AS 2.1
 PHP Version:  4.3.3
 New Comment:

This happens on the following versions:



 php 4.3.3, 4.3.4, 4.3.5RC3



 with bundled or external mysql client code

 with shared or buildin



 MySQL Server Version here is 4.0.18



 The MySQL Log shows this row on a 'connection lost' error:

 Aborted connection 2048 to db: [] (Got an error reading
communication packets)






Previous Comments:


[2004-03-11 11:35:27] [EMAIL PROTECTED]

Since i just stumbled across the very same problem, i wrote a small (?)
testcode to check it.



It seems like using pconnect in favor of a 'normal' connect fixes the
problem for the testcode, while it does not for my reallife
application.



The code assumes a database with at least 100 rows.

Structure as follows:



CREATE TABLE debug2 (

  ID int(11) NOT NULL auto_increment,

  CODE varchar(10) NOT NULL default '',

  PRIMARY KEY  (ID),

) TYPE=MyISAM 





This is the testcode, run it from cli ;)



 $ppid) {

 $tmp=pcntl_waitpid($ppid, $temp, WNOHANG);

 if ($tmp!=0 ) {

unset($pidlist[$key]);

 }

 }

 sleep(2);

 }





 ?>





You may have to run the code multiple times to actually see the
problem. The "Lost connection" error doesn't occur on a fixed rate or
value. You may be 'lucky' and don't hit it at all in a run..



Feel free to contact me in irc ( freenode / ircnet ) 





[2003-12-07 12:00:26] [EMAIL PROTECTED]

No feedback was provided. The bug is being suspended because
we assume that you are no longer experiencing the problem.
If this is not the case and you are able to provide the
information that was requested earlier, please do so and
change the status of the bug back to "Open". Thank you.





[2003-12-02 01:03:21] [EMAIL PROTECTED]

Thank you for this bug report. To properly diagnose the problem, we
need a short but complete example script to be able to reproduce
this bug ourselves. 

A proper reproducing script starts with ,
is max. 10-20 lines long and does not require any external 
resources such as databases, etc.

If possible, make the script source available online and provide
an URL to it here. Try avoid embedding huge scripts into the report.







[2003-12-01 13:16:29] chris dot noden at monstermob dot com

Description:

MySQL version 4.0.13 running on a different server on the LAN using
pconnect:



After using a pcntl_fork() the child thread suffers from the "2013 :
Lost connection to MySQL server" error above.



I can continue to use the MySQL connection without connecting again
implying that the connection has miraculously re-established itself!



The error can occur at any stage in a query, (eg during submission or
reading the results of the query).



The error usually manifests itself when the query returns no results. 
The error comes from the parent process!!



I have tried all sorts of workarounds, to no avail.

Reproduce code:
---
do {

$sql = "SELECT stuff FROM db WHERE a=b";

$qryID = mysql_query($sql,$Link_ID

while (mysql_fetch_array($qryID)) {

// Fork off a child

$is_parent = pcntl_fork();

if ($is_parent > 0) {

// I am the child - do some stuff

exit;

} else {

// I am the parent do some stuff

} // end if/else



sleep(1);

} while (condition);



Expected result:

Normal database flow.

Actual result:
--
Error 2013 - Lost connection to MySQL server during query





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


#26490 [Ver->Csd]: Lost connection to MySQL server during query

2004-08-12 Thread theseer
 ID:   26490
 Updated by:   [EMAIL PROTECTED]
 Reported By:  chris dot noden at monstermob dot com
-Status:   Verified
+Status:   Closed
 Bug Type: MySQL related
 Operating System: *
 PHP Version:  4CVS, 5CVS (2004-03-13)
 New Comment:

This is not a bug at all but rather a problem created by the reuse of
connections within php:
The mysql_connect() command does NOT open a new connection by default.
So even if one calls mysql_connect() in the forked child, no new
conenction is opened. Adding the addtional parameter to force a new
connection fixes the problem right away.




Previous Comments:


[2004-08-10 17:11:12] christian at jul dot net

Happened for me on php 4.3.8 / mysql 4.0.20 / debian unstable

Seems like putting the db connection after the fork solved the problem.
Apparently the connection dies when the connecting process exits, but
should be kept alive as long as   there is living child processes.



[2004-08-03 07:27:29] adams at mars-project dot com

I also get this error, but its on an internal mysql server.

PHP 4.3.7
MySQL 4.0.18
FreeBSD 4.10

And just to note when i do get this error i get a php core dump as
well.



[2004-07-21 17:20:59] florian dot heigl at m4f dot net

I got the same error w/o using php - connecting via bin/mysql...

It only happens *sometimes* :)
ERROR 2013 at line 78: Lost connection to MySQL server during query


OS is Tru64 5.1B-4, MySQL 4.0.20



[2004-07-20 15:00:52] garak at studenti dot it

Same problem.
Connect to mysql server on LAN.
PHP 4.3.7
MySQL 4.0.20
Linux 2.4.19



[2004-07-17 09:58:07] jdittmer at ppp0 dot net

Just wanted to say, that I see the very same error with php 4.3.8 and
postgres. (pconnect & connect) System is Debian/GNU Linux



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/26490

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


#26490 [Csd->Fbk]: Lost connection to MySQL server during query

2004-09-23 Thread theseer
 ID:   26490
 Updated by:   [EMAIL PROTECTED]
 Reported By:  chris dot noden at monstermob dot com
-Status:   Closed
+Status:   Feedback
 Bug Type: MySQL related
 Operating System: *
 PHP Version:  4CVS, 5CVS (2004-03-13)
 New Comment:

Due to people claiming the "workaround" doesn't fix their problems, the
bug is reopened.

Please provide detailed feedback on how to reproduce the problem.


Previous Comments:


[2004-09-22 21:06:23] tru at gtwreck dot com

All you need to do is check out this query on google, and you can see
that a lot of sites have this issue while google is indexing them...
http://www.google.com/search?hl=en&lr=&ie=UTF-8&q=%22Lost+connection+to+MySQL+server+during+query%22+mysql_connect



[2004-09-22 21:03:00] tommy at allstardirectories dot com

The suggested work-around does not work for me.  I'm still seeing
intermittent connection losses (About 5-10 per day).



[2004-08-12 19:20:53] [EMAIL PROTECTED]

This is not a bug at all but rather a problem created by the reuse of
connections within php:
The mysql_connect() command does NOT open a new connection by default.
So even if one calls mysql_connect() in the forked child, no new
conenction is opened. Adding the addtional parameter to force a new
connection fixes the problem right away.





[2004-08-10 17:11:12] christian at jul dot net

Happened for me on php 4.3.8 / mysql 4.0.20 / debian unstable

Seems like putting the db connection after the fork solved the problem.
Apparently the connection dies when the connecting process exits, but
should be kept alive as long as   there is living child processes.



[2004-08-03 07:27:29] adams at mars-project dot com

I also get this error, but its on an internal mysql server.

PHP 4.3.7
MySQL 4.0.18
FreeBSD 4.10

And just to note when i do get this error i get a php core dump as
well.



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/26490

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


#26490 [Ver]: Lost connection to MySQL server during query

2004-06-20 Thread theseer
 ID:   26490
 Updated by:   [EMAIL PROTECTED]
 Reported By:  chris dot noden at monstermob dot com
 Status:   Verified
 Bug Type: MySQL related
 Operating System: *
 PHP Version:  4CVS, 5CVS (2004-03-13)
 New Comment:

I cannot speak for chris but at least we are running Redhat/Fedora
Systems using MySQL rpms from mysql.com.

I will check the workarounds mentioned on the redhat page and report
back.


Previous Comments:


[2004-06-11 00:23:42] Ryan dot Springer at billingconcepts dot com

Is everyone who is effected by this bug running Red Hat?  If so, this
may be a libc problem.  See:

http://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=75128



[2004-03-11 11:39:40] [EMAIL PROTECTED]

This happens on the following versions:

 php 4.3.3, 4.3.4, 4.3.5RC3

 with bundled or external mysql client code
 with shared or buildin

 MySQL Server Version here is 4.0.18

 The MySQL Log shows this row on a 'connection lost' error:
 Aborted connection 2048 to db: [] (Got an error reading
communication packets)





[2004-03-11 11:35:27] [EMAIL PROTECTED]

Since i just stumbled across the very same problem, i wrote a small (?)
testcode to check it.

It seems like using pconnect in favor of a 'normal' connect fixes the
problem for the testcode, while it does not for my reallife
application.

The code assumes a database with at least 100 rows.
Structure as follows:

CREATE TABLE debug2 (
  ID int(11) NOT NULL auto_increment,
  CODE varchar(10) NOT NULL default '',
  PRIMARY KEY  (ID),
) TYPE=MyISAM 


This is the testcode, run it from cli ;)

 $ppid) {
 $tmp=pcntl_waitpid($ppid, $temp, WNOHANG);
 if ($tmp!=0 ) {
unset($pidlist[$key]);
 }
 }
 sleep(2);
 }


 ?>


You may have to run the code multiple times to actually see the
problem. The "Lost connection" error doesn't occur on a fixed rate or
value. You may be 'lucky' and don't hit it at all in a run..

Feel free to contact me in irc ( freenode / ircnet ) 




[2003-12-01 13:16:29] chris dot noden at monstermob dot com

Description:

MySQL version 4.0.13 running on a different server on the LAN using
pconnect:

After using a pcntl_fork() the child thread suffers from the "2013 :
Lost connection to MySQL server" error above.

I can continue to use the MySQL connection without connecting again
implying that the connection has miraculously re-established itself!

The error can occur at any stage in a query, (eg during submission or
reading the results of the query).

The error usually manifests itself when the query returns no results. 
The error comes from the parent process!!

I have tried all sorts of workarounds, to no avail.

Reproduce code:
---
do {
$sql = "SELECT stuff FROM db WHERE a=b";
$qryID = mysql_query($sql,$Link_ID
while (mysql_fetch_array($qryID)) {
// Fork off a child
$is_parent = pcntl_fork();
if ($is_parent > 0) {
// I am the child - do some stuff
exit;
} else {
// I am the parent do some stuff
} // end if/else

sleep(1);
} while (condition);


Expected result:

Normal database flow.

Actual result:
--
Error 2013 - Lost connection to MySQL server during query





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