#46014 [NEW]: Unable to change Configuration File Path

2008-09-06 Thread php at perfectory dot com dot au
From: php at perfectory dot com dot au
Operating system: Windows 2003 R2 x64
PHP version:  5.2.6
PHP Bug Type: *Configuration Issues
Bug description:  Unable to change Configuration File Path

Description:

I have manually installed PHP 5.2.6 on my Win2k3 box at C:\PHP and can not
seem to change the Configuration Path File variable. I have added the
registry key IniFilePath = C:\PHP at HKLM\SOFTWARE\PHP and
HKLM\SOFTWARE\PHP\5.2.6 and added C:\PHP to the PATH variable.

Setup: IIS6 with ISAPI. As I have a 64 bit OS, I have enabled IIS to run
both 32bit and 64bit applications. If I move the php.ini and all non-php
dlls to C:\WINDOWS it works, but I want to store this in my PHP directory.

Reproduce code:
---


Expected result:

Configuration File (php.ini) Path to be set to C:\PHP and Loaded
Configuration File to be C:\PHP\php.ini

Actual result:
--
Configuration File (php.ini) Path is set to C:\WINDOWS and Loaded
Configuration File is set to (none).

-- 
Edit bug report at http://bugs.php.net/?id=46014&edit=1
-- 
Try a CVS snapshot (PHP 5.2): 
http://bugs.php.net/fix.php?id=46014&r=trysnapshot52
Try a CVS snapshot (PHP 5.3): 
http://bugs.php.net/fix.php?id=46014&r=trysnapshot53
Try a CVS snapshot (PHP 6.0): 
http://bugs.php.net/fix.php?id=46014&r=trysnapshot60
Fixed in CVS: http://bugs.php.net/fix.php?id=46014&r=fixedcvs
Fixed in release: 
http://bugs.php.net/fix.php?id=46014&r=alreadyfixed
Need backtrace:   http://bugs.php.net/fix.php?id=46014&r=needtrace
Need Reproduce Script:http://bugs.php.net/fix.php?id=46014&r=needscript
Try newer version:http://bugs.php.net/fix.php?id=46014&r=oldversion
Not developer issue:  http://bugs.php.net/fix.php?id=46014&r=support
Expected behavior:http://bugs.php.net/fix.php?id=46014&r=notwrong
Not enough info:  
http://bugs.php.net/fix.php?id=46014&r=notenoughinfo
Submitted twice:  
http://bugs.php.net/fix.php?id=46014&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=46014&r=globals
PHP 4 support discontinued:   http://bugs.php.net/fix.php?id=46014&r=php4
Daylight Savings: http://bugs.php.net/fix.php?id=46014&r=dst
IIS Stability:http://bugs.php.net/fix.php?id=46014&r=isapi
Install GNU Sed:  http://bugs.php.net/fix.php?id=46014&r=gnused
Floating point limitations:   http://bugs.php.net/fix.php?id=46014&r=float
No Zend Extensions:   http://bugs.php.net/fix.php?id=46014&r=nozend
MySQL Configuration Error:http://bugs.php.net/fix.php?id=46014&r=mysqlcfg



#43304 [Com]: Casting During Comparison

2008-09-06 Thread drm at melp dot nl
 ID:   43304
 Comment by:   drm at melp dot nl
 Reported By:  ken at smallboxsoftware dot net
 Status:   Open
 Bug Type: Feature/Change Request
 Operating System: ALL
 PHP Version:  5.2.5
 New Comment:

Though documented (http://www.php.net/language.operators, quote "If you
compare two numerical strings, they are compared as integers."), this is
indeed unexpected behaviour (and thus a bug)

This bug will probably be closed and denoted as "sorry, documented
feature", but I think this is really a candidate for revision in any
next major PHP version.

Comparison should always feel intuitive, and PHP has made the move
towards more "secure" defaults. This falls (imo) under the same
category. Please witness following example.

client side code:

No selection
whatever
selection
   (...)


server side code:
if ( $_GET['selection'] == 0 ) {
   echo 'Please make a selection!';
} else {
   // process request
}

Though the example does not imply any security issues, they are not
unimaginable. Please reconsider the behaviour of the comparison
operator.

My suggestion:
Implement (and document!) the following:
Any left side of the comparison is only cast to number if the right
side doesn't fail to. Casting to number is considered successful, if and
only if the string would syntactically be a number in the PHP
Therefore, the string should match the following:

http://php.net/language.types.integer 
http://php.net/language.types.float

[At both pages, see the "formal" definition of both types.]

In any OTHER case, the comparison should act as follows:
If ANY of the sides is of a string type (and of course fails to cast to
number), the other side is cast to string, causing the types to follow
these rules:

integer: the string representation of the integer (e.g. "0", "-4" or
"123")
float: the string representation of the floating point number,
represented in one and only one particular format, preferably just the
%.f format.
boolean: cast to integer, cast to string (so true becomes 1, becomes
"1"; false becomes 0 becomes "0")
array: "array" causing a notice
object: "object" causing a notice, or calling the __toString method if
defined.

The oppposing problem is a non-generic way of handling any other
comparison. As a rule, we could state that any other comparison -if both
sides of different type- is handled the way it is in the current PHP
version. If they are of the same type, the == operator should act the
same as the === operator.

This is, as i am very sure, easily realized. 

Please do not hesitate to ask me any questions through mail.


Previous Comments:


[2007-11-15 16:27:02] ken at smallboxsoftware dot net

Description:

Casting during comparison should only happen if values of different
types are being compared. 

For example: "42" == "+42" should not return true. 

This result is not very intuitive and probably leads to a number of
subtle errors in various scripts. 

Reproduce code:
---
";
echo "Should Return False:".((string) "400" == (string)
"+400")."";
echo "Does Return False:".("400" === "+400")."";

?>






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



#46013 [Opn]: problem with zip php functions and symbolic links

2008-09-06 Thread black-cod3 at live dot com
 ID:   46013
 User updated by:  black-cod3 at live dot com
 Reported By:  black-cod3 at live dot com
 Status:   Open
 Bug Type: Output Control
 Operating System: linux
 PHP Version:  5.2.6
 New Comment:

Also note that when zipping the symbolic link using php code as:

open('indx.zip', ZipArchive::CREATE);
if ($res === TRUE) {
$zip->addFile('indx');
$zip->close();
echo 'ok';
} else {
echo 'failed';
}
?>

also the result after extracting indx.zip with the above php extracting
code:

indx


Previous Comments:


[2008-09-06 20:43:13] black-cod3 at live dot com

Description:

When using the zip php functions to extract or read a zip file
containing a symbolic link (ex: indx ->
/home/myuser/public_html/index.html) it fails to extract the original
symbolic link it only returned the link name and it's contents is the
symbolic link path.


ln -s /home/myuser/public_html/index.html indx;ls -la 
28672300 lrwxrwxrwx  1 myuser mygroup   35 Sep  6 13:41 indx ->
/home/myuser/public_html/index.html

zip -y indx.zip indx;ls -la 
28672300 lrwxrwxrwx  1 myuser mygroup   35 Sep  6 13:41 indx ->
/home/myuser/public_html/index.html
28672304 -rw-r--r--  1 myuser mygroup  175 Sep  6 14:50 indx.zip

extracting php code to the indx.zip as following: 


Reproduce code:
---
open('indx.zip') === TRUE) {
$zip->extractTo('/home/myuser/public_html/');
$zip->close();
echo 'done';
} else {
echo 'failed';
}
?>

Expected result:

expected to be extracted as :

indx -> /home/myuser/public_html/index.html

Actual result:
--
but actual reslult is :

indx

and the contents of indx is :

/home/myuser/public_html/index.html


Thx for your attention and hope to know if there is a different coding
method to zip a symbolic link by php zip functions or the above code was
expected to works well?





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



#46013 [NEW]: problem with zip php functions and symbolic links

2008-09-06 Thread black-cod3 at live dot com
From: black-cod3 at live dot com
Operating system: linux
PHP version:  5.2.6
PHP Bug Type: Output Control
Bug description:  problem with zip php functions and symbolic links

Description:

When using the zip php functions to extract or read a zip file containing
a symbolic link (ex: indx -> /home/myuser/public_html/index.html) it fails
to extract the original symbolic link it only returned the link name and
it's contents is the symbolic link path.


ln -s /home/myuser/public_html/index.html indx;ls -la 
28672300 lrwxrwxrwx  1 myuser mygroup   35 Sep  6 13:41 indx ->
/home/myuser/public_html/index.html

zip -y indx.zip indx;ls -la 
28672300 lrwxrwxrwx  1 myuser mygroup   35 Sep  6 13:41 indx ->
/home/myuser/public_html/index.html
28672304 -rw-r--r--  1 myuser mygroup  175 Sep  6 14:50 indx.zip

extracting php code to the indx.zip as following: 


Reproduce code:
---
open('indx.zip') === TRUE) {
$zip->extractTo('/home/myuser/public_html/');
$zip->close();
echo 'done';
} else {
echo 'failed';
}
?>

Expected result:

expected to be extracted as :

indx -> /home/myuser/public_html/index.html

Actual result:
--
but actual reslult is :

indx

and the contents of indx is :

/home/myuser/public_html/index.html


Thx for your attention and hope to know if there is a different coding
method to zip a symbolic link by php zip functions or the above code was
expected to works well?

-- 
Edit bug report at http://bugs.php.net/?id=46013&edit=1
-- 
Try a CVS snapshot (PHP 5.2): 
http://bugs.php.net/fix.php?id=46013&r=trysnapshot52
Try a CVS snapshot (PHP 5.3): 
http://bugs.php.net/fix.php?id=46013&r=trysnapshot53
Try a CVS snapshot (PHP 6.0): 
http://bugs.php.net/fix.php?id=46013&r=trysnapshot60
Fixed in CVS: http://bugs.php.net/fix.php?id=46013&r=fixedcvs
Fixed in release: 
http://bugs.php.net/fix.php?id=46013&r=alreadyfixed
Need backtrace:   http://bugs.php.net/fix.php?id=46013&r=needtrace
Need Reproduce Script:http://bugs.php.net/fix.php?id=46013&r=needscript
Try newer version:http://bugs.php.net/fix.php?id=46013&r=oldversion
Not developer issue:  http://bugs.php.net/fix.php?id=46013&r=support
Expected behavior:http://bugs.php.net/fix.php?id=46013&r=notwrong
Not enough info:  
http://bugs.php.net/fix.php?id=46013&r=notenoughinfo
Submitted twice:  
http://bugs.php.net/fix.php?id=46013&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=46013&r=globals
PHP 4 support discontinued:   http://bugs.php.net/fix.php?id=46013&r=php4
Daylight Savings: http://bugs.php.net/fix.php?id=46013&r=dst
IIS Stability:http://bugs.php.net/fix.php?id=46013&r=isapi
Install GNU Sed:  http://bugs.php.net/fix.php?id=46013&r=gnused
Floating point limitations:   http://bugs.php.net/fix.php?id=46013&r=float
No Zend Extensions:   http://bugs.php.net/fix.php?id=46013&r=nozend
MySQL Configuration Error:http://bugs.php.net/fix.php?id=46013&r=mysqlcfg



#46012 [Com]: formfeeds are not considered whitespace

2008-09-06 Thread sebastian_rose at gmx dot de
 ID:   46012
 Comment by:   sebastian_rose at gmx dot de
 Reported By:  sebastian_rose at gmx dot de
 Status:   Open
 Bug Type: Feature/Change Request
 Operating System: Debian testing
 PHP Version:  5.2.6
 New Comment:

It seems the error is in Zend/zend_language_scanner.l ???
As the grammar is defined in there? I never used yacc or bison ...


./Zend/zend_language_scanner.l, line 901 and 902:


WHITESPACE [ \n\r\t\f]+
TABS_AND_SPACES [ \t\f]*

should be

WHITESPACE [ \n\r\t\f]+
TABS_AND_SPACES [ \t\f]*

???


Previous Comments:


[2008-09-06 18:18:43] sebastian_rose at gmx dot de

Description:

Formfeeds in PHP scripts trigger a warning, i.e. are NOT considered
whitespace a usual.

Reproduce code:
---


Expected result:

I expect to see nothing.

All libraries and compilers consider formfeeds a whitespace. I thought
about sending this as a bug report at first, but think it's enough to
have it here again (after http://bugs.php.net/bug.php?id=30125 - the
same but for Php 4.3.8, September 2004!!!).

I'd volunteer to change this if I someone points me to where to start.

Actual result:
--

Warning:  Unexpected character in input:  '' (ASCII=12) state=1
in /path/to/test.php on line 4






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



#46012 [NEW]: formfeeds are not considered whitespace

2008-09-06 Thread sebastian_rose at gmx dot de
From: sebastian_rose at gmx dot de
Operating system: Debian testing
PHP version:  5.2.6
PHP Bug Type: Feature/Change Request
Bug description:  formfeeds are not considered whitespace

Description:

Formfeeds in PHP scripts trigger a warning, i.e. are NOT considered
whitespace a usual.

Reproduce code:
---


Expected result:

I expect to see nothing.

All libraries and compilers consider formfeeds a whitespace. I thought
about sending this as a bug report at first, but think it's enough to have
it here again (after http://bugs.php.net/bug.php?id=30125 - the same but
for Php 4.3.8, September 2004!!!).

I'd volunteer to change this if I someone points me to where to start.

Actual result:
--

Warning:  Unexpected character in input:  '' (ASCII=12) state=1 in
/path/to/test.php on line 4


-- 
Edit bug report at http://bugs.php.net/?id=46012&edit=1
-- 
Try a CVS snapshot (PHP 5.2): 
http://bugs.php.net/fix.php?id=46012&r=trysnapshot52
Try a CVS snapshot (PHP 5.3): 
http://bugs.php.net/fix.php?id=46012&r=trysnapshot53
Try a CVS snapshot (PHP 6.0): 
http://bugs.php.net/fix.php?id=46012&r=trysnapshot60
Fixed in CVS: http://bugs.php.net/fix.php?id=46012&r=fixedcvs
Fixed in release: 
http://bugs.php.net/fix.php?id=46012&r=alreadyfixed
Need backtrace:   http://bugs.php.net/fix.php?id=46012&r=needtrace
Need Reproduce Script:http://bugs.php.net/fix.php?id=46012&r=needscript
Try newer version:http://bugs.php.net/fix.php?id=46012&r=oldversion
Not developer issue:  http://bugs.php.net/fix.php?id=46012&r=support
Expected behavior:http://bugs.php.net/fix.php?id=46012&r=notwrong
Not enough info:  
http://bugs.php.net/fix.php?id=46012&r=notenoughinfo
Submitted twice:  
http://bugs.php.net/fix.php?id=46012&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=46012&r=globals
PHP 4 support discontinued:   http://bugs.php.net/fix.php?id=46012&r=php4
Daylight Savings: http://bugs.php.net/fix.php?id=46012&r=dst
IIS Stability:http://bugs.php.net/fix.php?id=46012&r=isapi
Install GNU Sed:  http://bugs.php.net/fix.php?id=46012&r=gnused
Floating point limitations:   http://bugs.php.net/fix.php?id=46012&r=float
No Zend Extensions:   http://bugs.php.net/fix.php?id=46012&r=nozend
MySQL Configuration Error:http://bugs.php.net/fix.php?id=46012&r=mysqlcfg



#43540 [Opn->Csd]: rfc1867 handler newlength problem

2008-09-06 Thread lbarnaud
 ID:   43540
 Updated by:   [EMAIL PROTECTED]
 Reported By:  thomas at partyflock dot nl
-Status:   Open
+Status:   Closed
 Bug Type: HTTP related
 Operating System: Linux
 PHP Version:  5.2.5
 New Comment:

This bug has been fixed in CVS.

Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
http://snaps.php.net/.
 
Thank you for the report, and for helping us make PHP better.




Previous Comments:


[2008-08-21 01:25:47] tomas at tomas-muller dot net

FYI a more detailed description can be found here:
http://pecl.php.net/bugs/bug.php?id=10715



[2008-08-21 01:23:33] tomas at tomas-muller dot net

I can confirm that making this change and recompiling fixes the bug for
me. Could anyone please review this and fix it? This annoying bug makes
the rfc1867 hook effectively unusable.



[2007-12-08 23:49:45] thomas at partyflock dot nl

Description:

In main/rfc1867.c, line 928, newlength is initialized to 0.

Shouldn't this be new_val_len?

Currently if your form handler does nothing and always returns SUCCESS,
all the viables get set, but with 0 length strings.







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



#46008 [Opn->Bgs]: odbc_execute throws sql error code 01S02.

2008-09-06 Thread tularis
 ID:   46008
 Updated by:   [EMAIL PROTECTED]
 Reported By:  jiunarayan at gmail dot com
-Status:   Open
+Status:   Bogus
 Bug Type: ODBC related
 Operating System: linux
 PHP Version:  5.2.6
 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.  Due to the volume
of reports we can not explain in detail here why your report is not
a bug.  The support channels will be able to provide an explanation
for you.

Thank you for your interest in PHP.




Previous Comments:


[2008-09-06 14:00:17] jiunarayan at gmail dot com

Description:

I wanted to get the stored procedure of SQL Server2000 using odbc
driver.My system configuration is Linux where I used freeTDS to connect
to odbc, PHP version 5.2. I used the odbc_prepare() and odbc_execute()
method to access the stored procedure but it throws the SQL error code
01S02.  I have tried in many ways to solve this out but I failed. Can
anyone help me out? Has any one called the stored procedures of SQL
Server2000 using odbc, in Linux 

Reproduce code:
---


Expected result:

The stored procedure in SQL Server2000-[ phptestproc =ALTER  procedure
phptestprocnew @name varchar(20),@age int
as insert into phptest values(@name,@age)  ] gets successfully updated


Actual result:
--
connected TO DB  ***
odbc_prepare ***Resource id #2
Warning:  SQL error: [unixODBC][Driver Manager]Option value
changed, SQL state 01S02 in SQLExecute in
/home/projects/php_project/aphp.php on line 18






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



#42404 [Opn->Fbk]: PHP drops APR_EGENERAL from ap_get_brigade

2008-09-06 Thread jani
 ID:   42404
 Updated by:   [EMAIL PROTECTED]
 Reported By:  cvitale at us dot ibm dot com
-Status:   Open
+Status:   Feedback
 Bug Type: Apache2 related
 Operating System: Linux 2.4
 PHP Version:  5.2.3
 New Comment:

Since you seem to know the Apache quite well, maybe you could provide
us a patch to fix this issue?


Previous Comments:


[2007-08-23 21:52:31] cvitale at us dot ibm dot com

Description:

I've compiled php to run on Apache 2.0.59 with --with-apxs2.

The function php_apache_sapi_read_post in
php-5.2.3/sapi/apache2handler/sapi_apache2.c assumes that the call to
ap_get_brigade will never return an error that php should give to
Apache. This violates Apache best practices.

An Apache2 input content filter may return an error, like APR_EGENERAL.
I am working on a filter that will reject suspicious input content and
return this value. I also set the Apache request_rec status to 403.

The requests that are returned have a 403 Forbidden status header and
the normal php output body content. 

If ap_get_brigade returns an apache error php should stop processing.






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



#36379 [Opn->Fbk]: SVG XML parsing looses child tags and attributes

2008-09-06 Thread jani
 ID:   36379
 Updated by:   [EMAIL PROTECTED]
 Reported By:  rele at gmx dot de
-Status:   Open
+Status:   Feedback
 Bug Type: SimpleXML related
 Operating System: Windows XP SP2
 PHP Version:  5.2.4
 New Comment:

Once more: You need to provide a _short_ example script. Which clearly
demonstrates the issue. For all I can tell, it's just your script that
is buggy here.


Previous Comments:


[2007-09-13 10:44:28] rele at gmx dot de

Here is a simplified version, which only shows the missing child nodes
(so I will check attributes again once this is working).
XPath seems to be working.

The dynamic $parent->$key[$i] access is only working for $i=0,
otherwise "Notice: Uninitialized string offset" occurs.


Reproduce code:
---

$test_simplexml_errors = <<

  PARENTCHILD
  CHILD1 
   CHILD1
  

EOD;

$simplexml = simplexml_load_string($test_simplexml_errors);

// print_r($simplexml);

foreach($simplexml as $parent) {
  echo $parent->asXML(), "\n"; //text node: '", (string) $parent,
"'\n";

  if( ((string) $parent) && ! array_key_exists(0, $parent))
echo "ERROR: No text child node with index 0 found\n";

  $children = $parent->children();
  $key = $children[0]->getName();
  if(! array_key_exists($key, $parent))
echo "ERROR: No child node with key '$key' found\n";

  $child_count = count($parent->xpath($key));
  for($i = 0; $i < $child_count; $i++) {
if(! array_key_exists($i, $parent->$key) && ($child_count != 1 ||
(string) $parent->$key) )
  echo "ERROR: No child node with index $i found\n";
  // echo "child $i direct: ", $parent->c[$i]->asXML(),"\n";
  // echo "child $i dynamic: ", $parent->$key[$i]->asXML(),"\n";
  }

  foreach($parent as $child) {
// echo ' child: ', $child->asXML(), "\n child text node: '",
(string) $child, "'\n";

if($child->xpath('text()') && ! array_key_exists(0, $child)) {
  echo "ERROR: No text child element with index 0 found\n";
  // echo $child->asXML(), "\n";
}

$child_count = count($child->xpath('./*'));
if($child_count) {
  $children = $child->children();
  $key = $children[0]->getName();
  for($i = 0; $i < $child_count; $i++) {
if(! array_key_exists($i, $child->$key) && ($child_count != 1
|| (string) $child->$key) )
  echo "ERROR: No sub child node with index $i found\n";
  // echo "sub child $i direct: ",
$child->d[$i]->asXML(),"\n";
  // echo "sub child $i variable: ",
$child->$key[$i]->asXML(),"\n";
  }
}
  }
}



[2007-08-20 12:03:30] [EMAIL PROTECTED]

You're still trying to do print_r/var_dump when you were asked to test
using an iterator. Please fix your code. (And please, try make it a lot
shorter..it's very hard to read now)



[2007-06-26 06:53:51] rele at gmx dot de

I tried the snapshot with Windows XP SP2 with my 2 examples and I am
getting exactly the same output, so nothing seems to have changed.



[2006-07-27 05:44:23] rele at gmx dot de

I tried the code with the 5.2.0RC2-dev Win32 build (Date => Jul 27 2006
04:15:19), but it produced the same result, and $parent[0] was always
NULL, too.


In addition I had to modify the second example code from 
  foreach($simplexml as &$parent) {
to
  foreach($simplexml as $parent) {
because it produced:
  PHP Fatal error: An iterator cannot be used with foreach by reference



[2006-07-27 02:00:36] [EMAIL PROTECTED]

Please try using this CVS snapshot:

  http://snaps.php.net/php5.2-latest.tar.gz
 
For Windows:
 
  http://snaps.php.net/win32/php5.2-win32-latest.zip





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

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



#45834 [Opn->Fbk]: INSERT INTO t VALUES (...) ON DUPLICATE KEY UPDATE ... and mysql_insert_id()

2008-09-06 Thread jani
 ID:   45834
 Updated by:   [EMAIL PROTECTED]
 Reported By:  swadlern at op dot pl
-Status:   Open
+Status:   Feedback
 Bug Type: MySQL related
 Operating System: Mandriva Linux 2008.1 x86_64
 PHP Version:  5.2.6
 New Comment:

After running the script, what is the output of 'select * from test' ? 


Previous Comments:


[2008-08-16 10:53:38] swadlern at op dot pl

Description:

I execute the following query:

INSERT INTO test VALUES (NULL,'key','value') ON DUPLICATE KEY UPDATE
v='value';

key exists and value of v column is the same as new value in UPDATE
clause.
I call $id=mysql_insert_id(); and expect that $id is id of existing row
(id is INT NOT NULL PRIMARY KEY AUTO_INCREMENT column) but $id contains
another value.

MySQL version is 5.0.51a

Reproduce code:
---



Expected result:

I expect $id to be 1

Actual result:
--
$id is 2





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



#45843 [Opn->Asn]: Collator::getLocale crash

2008-09-06 Thread jani
 ID:   45843
 Updated by:   [EMAIL PROTECTED]
 Reported By:  felipensp at gmail dot com
-Status:   Open
+Status:   Assigned
 Bug Type: I18N and L10N related
 Operating System: FreeBSD
 PHP Version:  5.3CVS-2008-08-17 (CVS)
-Assigned To:  
+Assigned To:  stas
 New Comment:

Assigned to the ext/intl maintainer.


Previous Comments:


[2008-08-17 14:57:20] felipensp at gmail dot com

Description:

[EMAIL PROTECTED] ~/php5]$ gdb -q sapi/cli/php
(gdb) r -r '$c = collator::create("EN-US-ODESSA"); 
var_dump($c->getLocale(Locale::VALID_LOCALE));'
Starting program: /usr/home/felipe/php5/sapi/cli/php -r '$c = 
collator::create("EN-US-ODESSA"); 
var_dump($c->getLocale(Locale::VALID_LOCALE));'
warning: Unable to get location for thread creation breakpoint: 
generic error
[New LWP 100136]
[New Thread 0xd4e000 (LWP 100136)]

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0xd4e000 (LWP 100136)]
0x00860215 in zend_object_store_get_object 
(zobject=0xd7b088, tsrm_ls=0x0) 
at /usr/home/felipe/php5/Zend/zend_objects_API.c:261
261 return 
EG(objects_store).object_buckets[handle].bucket.obj.object;
(gdb) bt
#0  0x00860215 in zend_object_store_get_object 
(zobject=0xd7b088, tsrm_ls=0x0) 
at /usr/home/felipe/php5/Zend/zend_objects_API.c:261
#1  0x005407c1 in zif_collator_get_locale (ht=1, 
return_value=0xd7b008, return_value_ptr=0x0, this_ptr=0xd7b088, 
return_value_used=1,
tsrm_ls=0x0) 
at /usr/home/felipe/php5/ext/intl/collator/collator_locale.c:52
#2  0x00863fe5 in zend_do_fcall_common_helper_SPEC 
(execute_data=0x10e8088, tsrm_ls=0xd456c0) at zend_vm_execute.h:315
#3  0x0086516d in ZEND_DO_FCALL_BY_NAME_SPEC_HANDLER 
(execute_data=0x10e8088, tsrm_ls=0xd456c0) at zend_vm_execute.h:428
#4  0x00862cdb in execute (op_array=0xd7bcc0, 
tsrm_ls=0xd456c0) at zend_vm_execute.h:104
#5  0x0081e1e8 in zend_eval_string (
str=0x7fffea96 "$c = collator::create(\"EN-US-ODESSA\"); 
var_dump($c->getLocale(Locale::VALID_LOCALE));", retval_ptr=0x0,
string_name=0xbcb87c "Command line code", tsrm_ls=0xd456c0) 
at /usr/home/felipe/php5/Zend/zend_execute_API.c:1112
#6  0x0081e410 in zend_eval_string_ex (
str=0x7fffea96 "$c = collator::create(\"EN-US-ODESSA\"); 
var_dump($c->getLocale(Locale::VALID_LOCALE));", retval_ptr=0x0,
string_name=0xbcb87c "Command line code", handle_exceptions=1, 
tsrm_ls=0xd456c0) 
at /usr/home/felipe/php5/Zend/zend_execute_API.c:1147
#7  0x008d3853 in main (argc=3, argv=0x7fffe818) 
at /usr/home/felipe/php5/sapi/cli/php_cli.c:1169


Reproduce code:
---
Reproducible with:
ext/intl/tests/collator_create.phpt
ext/intl/tests/collator_get_locale.phpt






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



#45995 [Opn->Fbk]: segfault in mysql "load_defaults()" during startup

2008-09-06 Thread jani
 ID:   45995
 Updated by:   [EMAIL PROTECTED]
 Reported By:  obylan at gmail dot com
-Status:   Open
+Status:   Feedback
 Bug Type: MySQL related
 Operating System: linux
 PHP Version:  5.2.6
 New Comment:

I repeat: HOW did you configure PHP? What was the configure line you
used before you did 'make' ???




Previous Comments:


[2008-09-06 05:37:29] obylan at gmail dot com

I have tryed many version of php, mysl and apache as i reported in the

first post, tring many combination but i have allways the same kind of

bug.
And this was happen after last system ajournment (gentoo). If i try to

install others versions backing to older i have ever the same problem.



[2008-09-05 23:13:36] [EMAIL PROTECTED]

Exactly how did you confiugre PHP? What mysql version? (EXACTLY what 
version..)



[2008-09-05 08:22:29] obylan at gmail dot com

i have the same problem on different hardware ( p III biproc, Intel(R)
Core(TM)2 Duo biproc, AMD Athlon(tm) 64 X2 Dual Core ) 

System is gentoo linux on different kernel.

This is the backtrace on apache execution:

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0xb7b90700 (LWP 839)]
0xb6ece496 in load_defaults () from /usr/lib/libmysqlclient.so.15
(gdb) bt
#0  0xb6ece496 in load_defaults () from /usr/lib/libmysqlclient.so.15
#1  0xb73da540 in zm_startup_mysql () from
/usr/lib/apache2/modules/libphp5.so
#2  0xb753243e in zend_startup_module_ex () from
/usr/lib/apache2/modules/libphp5.so
#3  0xb7539645 in zend_hash_apply () from
/usr/lib/apache2/modules/libphp5.so
#4  0xb75325f9 in zend_startup_modules () from
/usr/lib/apache2/modules/libphp5.so
#5  0xb74db153 in php_module_startup () from
/usr/lib/apache2/modules/libphp5.so
#6  0xb75a8bfc in ?? () from /usr/lib/apache2/modules/libphp5.so
#7  0xb7826d80 in ?? () from /usr/lib/apache2/modules/libphp5.so
#8  0xb7826fe0 in ?? () from /usr/lib/apache2/modules/libphp5.so
#9  0x0001 in ?? ()
#10 0xb7aea6ba in ?? () from /usr/lib/apache2/modules/mod_ssl.so
#11 0x00dc in ?? ()
#12 0x000b in ?? ()
#13 0xbf9cefd8 in ?? ()
#14 0xb75a8d7e in ?? () from /usr/lib/apache2/modules/libphp5.so
#15 0xb7826d80 in ?? () from /usr/lib/apache2/modules/libphp5.so
#16 0xb77f3f98 in ?? () from /usr/lib/apache2/modules/libphp5.so
#17 0x080a30a0 in ?? ()
#18 0xb7b39ff4 in ?? () from /usr/lib/apache2/modules/mod_headers.so
#19 0x081f6ac8 in ?? ()
#20 0x081f6b38 in ?? ()
#21 0x081f6bf0 in ?? ()
#22 0x00c8 in ?? ()
#23 0x0001 in ?? ()
#24 0xb77f3f98 in ?? () from /usr/lib/apache2/modules/libphp5.so
#25 0xbf9cf008 in ?? ()
#26 0x0807a7fe in ap_run_post_config ()
Backtrace stopped: previous frame inner to this frame (corrupt stack?)



[2008-09-04 19:31:39] [EMAIL PROTECTED]

Thank you for this bug report. To properly diagnose the problem, we
need a backtrace to see what is happening behind the scenes. To
find out how to generate a backtrace, please read
http://bugs.php.net/bugs-generating-backtrace.php for *NIX and
http://bugs.php.net/bugs-generating-backtrace-win32.php for Win32

Once you have generated a backtrace, please submit it to this bug
report and change the status back to "Open". Thank you for helping
us make PHP better.



[2008-09-04 15:11:24] obylan at gmail dot com

Description:

i have a problem with 

>= apache-2.2.8
>= php-5.2
>= mysql-5.0

If i build php apache module without mysql support, apache start. 
But if i build php module with mysql support, apache exit with
segmentation fault when i try to start it.

I'm using Apache set with MPM prefork.







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



#45996 [Opn->Asn]: libxml2 2.7.1 causes breakage with character data in xml_parse()

2008-09-06 Thread jani
 ID:   45996
 Updated by:   [EMAIL PROTECTED]
 Reported By:  phpbugs at colin dot guthr dot ie
-Status:   Open
+Status:   Assigned
 Bug Type: XML related
 Operating System: Mandriva Linux
 PHP Version:  5.2.6
 Assigned To:  rrichards
 New Comment:

Assigned to the maintainer (Rob, don't forget to change status too when
you assign something to yourself :)


Previous Comments:


[2008-09-04 17:29:21] phpbugs at colin dot guthr dot ie

Description:

With libxml2 2.7.1, When using the expat type xml parsing routines in
PHP, the characater data seems to silently drop any encoded text e.g.
> < and friends.

Please see Mandriva bug for details:
https://qa.mandriva.com/show_bug.cgi?id=43486

And also please note the thread on the libxml mailing list:
http://thread.gmane.org/gmane.comp.gnome.lib.xml.general/14610

And most notably the reply to the above thread:

Can you report this as a PHP bug? It looks like some really old hack 
code in the PHP extension in order to mimic some specific expat 
functionality. The behavior change you see though resulting from a code
changes in libxml2 is really due to the hackish code in the extension
doing things it wasnt meant to be doing.


Reproduce code:
---
Please see this code:
https://qa.mandriva.com/attachment.cgi?id=10757

Expected result:

<
foo
>
wibble
<
/foo
>


Actual result:
--
foo
wibble
/foo






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



#46009 [Opn->Bgs]: mktime giving strange problem

2008-09-06 Thread jani
 ID:   46009
 Updated by:   [EMAIL PROTECTED]
 Reported By:  siddarth at revolutesolution dot com
-Status:   Open
+Status:   Bogus
 Bug Type: Date/time related
 Operating System: Linux
 PHP Version:  5.2.6
 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.  Due to the volume
of reports we can not explain in detail here why your report is not
a bug.  The support channels will be able to provide an explanation
for you.

Thank you for your interest in PHP.




Previous Comments:


[2008-09-06 15:14:47] siddarth at revolutesolution dot com

Description:

Hi,
I am making a counting system, which will told visitor to a days
difference within selected date range.

If user enter date till 2038 it works fine..and user enter beyond then
this, then it start giving error (negative values)

I read that due to PHP version problem it did, but we have "PHP Version
5.2.5" installed on the server.

Can you please suggest about this error.

Reproduce code:
---
For your reference, i am using following code:

$dateDiff = mktime( $from['hour']  , $from['minutes'] ,
$from['seconds'] , 
$from['month'] , $from['day'] ,
$from['year'] ) -
mktime( $to['hour'], $to['minutes']   ,
$to['seconds'] ,
$to['month']   , $to['day']   , $to['year']
);

$intDays= floor(  $dateDiff / (60*60*24) );

$intHours   = floor( ($dateDiff - ($intDays*60*60*24) ) / (60*60)
);

$intMinutes = floor( ($dateDiff - ($intDays*60*60*24) -
($intHours*60*60) ) /60 );







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



#46010 [NEW]: warnings incorrectly generated for iv in ecb mode

2008-09-06 Thread d_kelsey at uk dot ibm dot com
From: d_kelsey at uk dot ibm dot com
Operating system: Windows XP
PHP version:  5.2.6
PHP Bug Type: mcrypt related
Bug description:  warnings incorrectly generated for iv in ecb mode

Description:

With the functions 
mcrypt_encrypt, mcrypt_decrypt with MCRYPT_MODE_ECB and mcrypt_ecb, by not
providing an initial vector or providing one that isn't at the correct
block size results in a warning being generated. 

ECB mode never uses the initial vector, so a warning is irrelevant. 

Reproduce code:
---
 

Expected result:

string(16) "372eeb4a524b8d31"
string(16) "372eeb4a524b8d31"
string(16) "372eeb4a524b8d31"

Actual result:
--
Warning: mcrypt_encrypt(): Attempt to use an empty IV, which is NOT
recommend in C:\udata-eclipse\p8\a.phpcode\mcrypt_ecb.php on line 2
string(16) "372eeb4a524b8d31"

Warning: mcrypt_encrypt(): The IV parameter must be as long as the
blocksize in C:\udata-eclipse\p8\a.phpcode\mcrypt_ecb.php on line 3
string(16) "372eeb4a524b8d31"
string(16) "372eeb4a524b8d31"

-- 
Edit bug report at http://bugs.php.net/?id=46010&edit=1
-- 
Try a CVS snapshot (PHP 5.2): 
http://bugs.php.net/fix.php?id=46010&r=trysnapshot52
Try a CVS snapshot (PHP 5.3): 
http://bugs.php.net/fix.php?id=46010&r=trysnapshot53
Try a CVS snapshot (PHP 6.0): 
http://bugs.php.net/fix.php?id=46010&r=trysnapshot60
Fixed in CVS: http://bugs.php.net/fix.php?id=46010&r=fixedcvs
Fixed in release: 
http://bugs.php.net/fix.php?id=46010&r=alreadyfixed
Need backtrace:   http://bugs.php.net/fix.php?id=46010&r=needtrace
Need Reproduce Script:http://bugs.php.net/fix.php?id=46010&r=needscript
Try newer version:http://bugs.php.net/fix.php?id=46010&r=oldversion
Not developer issue:  http://bugs.php.net/fix.php?id=46010&r=support
Expected behavior:http://bugs.php.net/fix.php?id=46010&r=notwrong
Not enough info:  
http://bugs.php.net/fix.php?id=46010&r=notenoughinfo
Submitted twice:  
http://bugs.php.net/fix.php?id=46010&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=46010&r=globals
PHP 4 support discontinued:   http://bugs.php.net/fix.php?id=46010&r=php4
Daylight Savings: http://bugs.php.net/fix.php?id=46010&r=dst
IIS Stability:http://bugs.php.net/fix.php?id=46010&r=isapi
Install GNU Sed:  http://bugs.php.net/fix.php?id=46010&r=gnused
Floating point limitations:   http://bugs.php.net/fix.php?id=46010&r=float
No Zend Extensions:   http://bugs.php.net/fix.php?id=46010&r=nozend
MySQL Configuration Error:http://bugs.php.net/fix.php?id=46010&r=mysqlcfg



#46009 [NEW]: mktime giving strange problem

2008-09-06 Thread siddarth at revolutesolution dot com
From: siddarth at revolutesolution dot com
Operating system: Linux
PHP version:  5.2.6
PHP Bug Type: Unknown/Other Function
Bug description:  mktime giving strange problem

Description:

Hi,
I am making a counting system, which will told visitor to a days
difference within selected date range.

If user enter date till 2038 it works fine..and user enter beyond then
this, then it start giving error (negative values)

I read that due to PHP version problem it did, but we have "PHP Version
5.2.5" installed on the server.

Can you please suggest about this error.

Reproduce code:
---
For your reference, i am using following code:

$dateDiff = mktime( $from['hour']  , $from['minutes'] , $from['seconds'] ,

$from['month'] , $from['day'] , $from['year']
) -
mktime( $to['hour'], $to['minutes']   , $to['seconds']
,
$to['month']   , $to['day']   , $to['year']
);

$intDays= floor(  $dateDiff / (60*60*24) );

$intHours   = floor( ($dateDiff - ($intDays*60*60*24) ) / (60*60) );

$intMinutes = floor( ($dateDiff - ($intDays*60*60*24) -
($intHours*60*60) ) /60 );



-- 
Edit bug report at http://bugs.php.net/?id=46009&edit=1
-- 
Try a CVS snapshot (PHP 5.2): 
http://bugs.php.net/fix.php?id=46009&r=trysnapshot52
Try a CVS snapshot (PHP 5.3): 
http://bugs.php.net/fix.php?id=46009&r=trysnapshot53
Try a CVS snapshot (PHP 6.0): 
http://bugs.php.net/fix.php?id=46009&r=trysnapshot60
Fixed in CVS: http://bugs.php.net/fix.php?id=46009&r=fixedcvs
Fixed in release: 
http://bugs.php.net/fix.php?id=46009&r=alreadyfixed
Need backtrace:   http://bugs.php.net/fix.php?id=46009&r=needtrace
Need Reproduce Script:http://bugs.php.net/fix.php?id=46009&r=needscript
Try newer version:http://bugs.php.net/fix.php?id=46009&r=oldversion
Not developer issue:  http://bugs.php.net/fix.php?id=46009&r=support
Expected behavior:http://bugs.php.net/fix.php?id=46009&r=notwrong
Not enough info:  
http://bugs.php.net/fix.php?id=46009&r=notenoughinfo
Submitted twice:  
http://bugs.php.net/fix.php?id=46009&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=46009&r=globals
PHP 4 support discontinued:   http://bugs.php.net/fix.php?id=46009&r=php4
Daylight Savings: http://bugs.php.net/fix.php?id=46009&r=dst
IIS Stability:http://bugs.php.net/fix.php?id=46009&r=isapi
Install GNU Sed:  http://bugs.php.net/fix.php?id=46009&r=gnused
Floating point limitations:   http://bugs.php.net/fix.php?id=46009&r=float
No Zend Extensions:   http://bugs.php.net/fix.php?id=46009&r=nozend
MySQL Configuration Error:http://bugs.php.net/fix.php?id=46009&r=mysqlcfg



#46008 [NEW]: odbc_execute throws sql error code 01S02.

2008-09-06 Thread jiunarayan at gmail dot com
From: jiunarayan at gmail dot com
Operating system: linux
PHP version:  5.2.6
PHP Bug Type: ODBC related
Bug description:  odbc_execute throws sql error code 01S02.

Description:

I wanted to get the stored procedure of SQL Server2000 using odbc
driver.My system configuration is Linux where I used freeTDS to connect to
odbc, PHP version 5.2. I used the odbc_prepare() and odbc_execute() method
to access the stored procedure but it throws the SQL error code 01S02.  I
have tried in many ways to solve this out but I failed. Can anyone help me
out? Has any one called the stored procedures of SQL Server2000 using
odbc, in Linux 

Reproduce code:
---


Expected result:

The stored procedure in SQL Server2000-[ phptestproc =ALTER  procedure
phptestprocnew @name varchar(20),@age int
as insert into phptest values(@name,@age)  ] gets successfully updated


Actual result:
--
connected TO DB  ***
odbc_prepare ***Resource id #2
Warning:  SQL error: [unixODBC][Driver Manager]Option value
changed, SQL state 01S02 in SQLExecute in
/home/projects/php_project/aphp.php on line 18


-- 
Edit bug report at http://bugs.php.net/?id=46008&edit=1
-- 
Try a CVS snapshot (PHP 5.2): 
http://bugs.php.net/fix.php?id=46008&r=trysnapshot52
Try a CVS snapshot (PHP 5.3): 
http://bugs.php.net/fix.php?id=46008&r=trysnapshot53
Try a CVS snapshot (PHP 6.0): 
http://bugs.php.net/fix.php?id=46008&r=trysnapshot60
Fixed in CVS: http://bugs.php.net/fix.php?id=46008&r=fixedcvs
Fixed in release: 
http://bugs.php.net/fix.php?id=46008&r=alreadyfixed
Need backtrace:   http://bugs.php.net/fix.php?id=46008&r=needtrace
Need Reproduce Script:http://bugs.php.net/fix.php?id=46008&r=needscript
Try newer version:http://bugs.php.net/fix.php?id=46008&r=oldversion
Not developer issue:  http://bugs.php.net/fix.php?id=46008&r=support
Expected behavior:http://bugs.php.net/fix.php?id=46008&r=notwrong
Not enough info:  
http://bugs.php.net/fix.php?id=46008&r=notenoughinfo
Submitted twice:  
http://bugs.php.net/fix.php?id=46008&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=46008&r=globals
PHP 4 support discontinued:   http://bugs.php.net/fix.php?id=46008&r=php4
Daylight Savings: http://bugs.php.net/fix.php?id=46008&r=dst
IIS Stability:http://bugs.php.net/fix.php?id=46008&r=isapi
Install GNU Sed:  http://bugs.php.net/fix.php?id=46008&r=gnused
Floating point limitations:   http://bugs.php.net/fix.php?id=46008&r=float
No Zend Extensions:   http://bugs.php.net/fix.php?id=46008&r=nozend
MySQL Configuration Error:http://bugs.php.net/fix.php?id=46008&r=mysqlcfg



#36013 [Com]: Segmentation fault

2008-09-06 Thread test at example dot com
 ID:   36013
 Comment by:   test at example dot com
 Reported By:  xenon54 at generationphp dot net
 Status:   No Feedback
 Bug Type: Session related
 Operating System: Centos 4.2
 PHP Version:  5.1.1
 New Comment:

I find it quite funny that this problem in connecting to MySQL leads to
a segmentation fault. I can reproduce any it by installing OpenSuSE 10.x
or OpenSuSE 11 and the 'cacti' package, and this has not changed for at
least a couple years.


Previous Comments:


[2006-03-12 17:40:54] alexdg at gmail dot com

I think I know what the issue is, bad user/passwd login configuration
for the cacti mysql account in include/config.php. When running thru
Apache the error_log will only output "segmentation fault" but if you
run the poller.php script on its own, you'll get the typical error msg
of a failed mysql login (some 10 times?), until it crashs.



[2006-01-23 01:00:03] php-bugs at lists dot php dot net

No feedback was provided for this bug for over a week, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".



[2006-01-15 00:38:19] xenon54 at generationphp dot net

Fixed without any reasons.
But still cause segmentation fault with cli.

Will come back if I can reproduce this bug.



[2006-01-14 22:48:50] [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 to avoid embedding huge scripts into the report.





[2006-01-14 20:58:24] xenon54 at generationphp dot net

It was initially on PHP5.1.1.
But the problem persists on PHP5.1.2



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

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



#45405 [Opn->Csd]: snmp extension memory leak

2008-09-06 Thread indeyets
 ID:   45405
 Updated by:   [EMAIL PROTECTED]
 Reported By:  Federico Cuello 
-Status:   Open
+Status:   Closed
 Bug Type: SNMP related
 Operating System: Linux
 PHP Version:  5.2.6
 New Comment:

This bug has been fixed in CVS.

Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
http://snaps.php.net/.
 
Thank you for the report, and for helping us make PHP better.




Previous Comments:


[2008-07-27 23:36:52] Rodrigo Campos variables; vars; vars = vars->next_variable) {

 if (st >= SNMP_CMD_WALK && st != SNMP_CMD_SET && vars->name_length <
rootlen || memcmp(root, vars->name, rootlen * sizeof(oid {

+ snmp_free_pdu(response);
   continue;   /* not part of this subtree */


So, if the for does more than one iteration, response is beeing freed
more than one time (the for does not change response). So I think that
adding that free is not correct.

Looking at the code, that "for" is inside an "if" statement. When that
if statement ends, the response it's beeing freed. So there's no need to
free it before.

The other "frees" added are before a return statement, that seems
correct, and before "goto retry". The first instruction executed in
retry is "status = snmp_synch_response(ss, pdu, &response);". So if we
dont free response before calling that, we lost the reference and we
have a leak.

We have done some basic tests to the code with this patch and seems to
be OK (test the reproduce-code published by Federico with valgrind and
using php apache module for a web-interface that uses php-snmp
extension)

Federico's patch modified (just removed that "free" inside the "for")
results in this (sorry, i didn't find a way to upload a file. If there's
any, please let me know ):

--- ext/snmp/snmp.c.orig2008-07-15 10:49:14.0 -0300
+++ ext/snmp/snmp.c 2008-07-15 15:01:48.0 -0300
@@ -417,13 +417,13 @@
while (keepwalking) {
keepwalking = 0;
if ((st == SNMP_CMD_GET) || (st == SNMP_CMD_GETNEXT))
{
-   pdu = snmp_pdu_create((st == SNMP_CMD_GET) ?
SNMP_MSG_GET : SNMP_MSG_GETNEXT);
name_length = MAX_OID_LEN;
if (!snmp_parse_oid(objid, name, &name_length))
{
php_error_docref(NULL TSRMLS_CC,
E_WARNING, "Invalid object identifier: %s", objid);
snmp_close(ss);
RETURN_FALSE;
}
+   pdu = snmp_pdu_create((st == SNMP_CMD_GET) ?
SNMP_MSG_GET : SNMP_MSG_GETNEXT);
snmp_add_null_var(pdu, name, name_length);
} else if (st == SNMP_CMD_SET) {
pdu = snmp_pdu_create(SNMP_MSG_SET);
@@ -434,6 +434,7 @@
sprint_objid(buf, name, name_length);
 #endif
php_error_docref(NULL TSRMLS_CC,
E_WARNING, "Could not add variable: %s %c %s", buf, type, value);
+   snmp_free_pdu(pdu);
snmp_close(ss);
RETURN_FALSE;
}
@@ -467,11 +468,13 @@
*return_value =
*snmpval;
   
zval_copy_ctor(return_value);
   
zval_ptr_dtor(&snmpval);
+  
snmp_free_pdu(response);
snmp_close(ss);
return;
} else if (st ==
SNMP_CMD_GETNEXT) {
*return_value =
*snmpval;
   
zval_copy_ctor(return_value);
+  
snmp_free_pdu(response);
snmp_close(ss);
return;
} else if (st == SNMP_CMD_WALK)
{
@@ -510,23 +513,28 @@
}
if (st == SNMP_CMD_GET) {
if ((pdu =
snmp_fix_pdu(response, SNMP_MSG_GET)) != NULL) {
+  
snmp_free_pdu(response);
goto retry;
}
} else if (st == SNMP_CMD_SET)
{
if ((pdu =
snmp_fix_pdu(response, SNMP_MSG_SET)) != NULL) {
+  
snmp_free_pdu(response);