Bug #65728 [Com]: \DateInterval-days turns from boolean to integer value

2013-09-20 Thread jason at fuzzystatic dot com
Edit report at https://bugs.php.net/bug.php?id=65728edit=1

 ID: 65728
 Comment by: jason at fuzzystatic dot com
 Reported by:sebastiankuhlmann at web dot de
 Summary:\DateInterval-days turns from boolean to integer
 value
 Status: Open
 Type:   Bug
 Package:Date/time related
 Operating System:   independant
 PHP Version:Irrelevant
 Block user comment: N
 Private report: N

 New Comment:

This seems to work as expected in PHP 5.5.4 (latest version of 5.5 at this time)


Previous Comments:

[2013-09-20 14:28:38] sebastiankuhlmann at web dot de

Description:

When creating a \DateInterval()-object according to the documentation the 
'days'-property should be false. A var_dump on the object confirms this.
Now if you do a var_dump directly on the 'days'-property the var-type and 
-value changes from FALSE to -9.
https://bugs.php.net/bug.php?id=65654 might be related to this.

Test script:
---
$test = new \DateInterval('P1D');

var_dump($test-days);

Expected result:

bool(false)

Actual result:
--
int(-9)






-- 
Edit this bug report at https://bugs.php.net/bug.php?id=65728edit=1


Req #37676 [Com]: using Array access operator [] on boolean variable does not show Notice

2013-02-01 Thread jason at fuzzystatic dot com
Edit report at https://bugs.php.net/bug.php?id=37676edit=1

 ID: 37676
 Comment by: jason at fuzzystatic dot com
 Reported by:tgross at m-s dot de
 Summary:using Array access operator [] on boolean variable
 does not show Notice
 Status: Open
 Type:   Feature/Change Request
 Package:Scripting Engine problem
 Operating System:   *
 PHP Version:*
 Block user comment: N
 Private report: N

 New Comment:

Bug still occurs on a 5.5-dev version.

example: http://codepad.viper-7.com/rn5kBm


Previous Comments:

[2012-09-30 01:06:20] larue...@php.net

yeah, I remembered there was a similar bug report of this behavior, and I seems 
made a fix for it.

if I remember correctlly, it was merged into master-branch already


[2012-09-29 12:20:33] svodev at gmail dot com

The same issue is with NULL values;

$a = NULL;

echo $a['b'];

...and nothing happen


[2006-06-02 11:25:00] tony2...@php.net

Reclassified as feature request.


[2006-06-02 11:21:51] tgross at m-s dot de

Description:

When trying to access an array using an undefined offset, PHP displays an 
Notice.

However, when you access a boolean variable with any combination of the array 
operator [], PHP just returns NULL and displays no error message.

Reproduce code:
---
error_reporting (E_ALL);
$a = false;

var_dump ($a[5]);
var_dump ($a['test'][-3]);


Expected result:

PHP should display a Notice or a Warning.

Actual result:
--
PHP displays
NULL NULL






-- 
Edit this bug report at https://bugs.php.net/bug.php?id=37676edit=1


Bug #62610 [Com]: date('l, F m, Y') function outputs wrong date

2012-07-20 Thread jason at jasonbutz dot info
Edit report at https://bugs.php.net/bug.php?id=62610edit=1

 ID: 62610
 Comment by: jason at jasonbutz dot info
 Reported by:jason at jasonbutz dot info
 Summary:date('l, F m, Y') function outputs wrong date
 Status: Feedback
 Type:   Bug
 Package:Date/time related
 Operating System:   Linux
 PHP Version:5.3.2-1ubuntu4.17 with Suhosin-Patch (cli) (built:
 Jun 19 2012 03:21:35)
 Block user comment: N
 Private report: N

 New Comment:

aharvey:
Both your examples show the bug. The second and third dates both shows July 7, 
when it is not July 7.


Previous Comments:

[2012-07-20 01:25:42] ahar...@php.net

I can't reproduce this at all on current versions of PHP 5.3 or 5.4. Is that 
really the output you're getting with that exact script?

Also, please see if you can replicate this without Suhosin on the current 
version of PHP 5.3; ie 5.3.15.

Pastebins of working code:

5.3: http://codepad.viper-7.com/DIzp07
5.4: http://codepad.viper-7.com/uXv3EY


[2012-07-19 13:32:30] jason at jasonbutz dot info

Correcting PHP version


[2012-07-19 13:31:04] jason at jasonbutz dot info

Description:

When I use the date function with the included arguments the date is always 
output 
as Thursday, July 07, 2012 when using the default timestamp.

Test script:
---
?php
echo Today is .date('m/d/Y').\n;
echo date('l, F m, Y').\n;
echo date('l, F m, Y', time()).\n;
echo date('l, F m, Y', strtotime(01/01/2012));
?

Expected result:

date('l, F m, Y') to show the current date, not Thursday, July 07, 2012







-- 
Edit this bug report at https://bugs.php.net/bug.php?id=62610edit=1


Bug #62610 [Fbk-Csd]: date('l, F m, Y') function outputs wrong date

2012-07-20 Thread jason at jasonbutz dot info
Edit report at https://bugs.php.net/bug.php?id=62610edit=1

 ID: 62610
 User updated by:jason at jasonbutz dot info
 Reported by:jason at jasonbutz dot info
 Summary:date('l, F m, Y') function outputs wrong date
-Status: Feedback
+Status: Closed
 Type:   Bug
 Package:Date/time related
 Operating System:   Linux
 PHP Version:5.3.2-1ubuntu4.17 with Suhosin-Patch (cli) (built:
 Jun 19 2012 03:21:35)
 Block user comment: N
 Private report: N

 New Comment:

Nevermind, I see what I did. Sorry.


Previous Comments:

[2012-07-20 14:29:52] jason at jasonbutz dot info

aharvey:
Both your examples show the bug. The second and third dates both shows July 7, 
when it is not July 7.


[2012-07-20 01:25:42] ahar...@php.net

I can't reproduce this at all on current versions of PHP 5.3 or 5.4. Is that 
really the output you're getting with that exact script?

Also, please see if you can replicate this without Suhosin on the current 
version of PHP 5.3; ie 5.3.15.

Pastebins of working code:

5.3: http://codepad.viper-7.com/DIzp07
5.4: http://codepad.viper-7.com/uXv3EY


[2012-07-19 13:32:30] jason at jasonbutz dot info

Correcting PHP version


[2012-07-19 13:31:04] jason at jasonbutz dot info

Description:

When I use the date function with the included arguments the date is always 
output 
as Thursday, July 07, 2012 when using the default timestamp.

Test script:
---
?php
echo Today is .date('m/d/Y').\n;
echo date('l, F m, Y').\n;
echo date('l, F m, Y', time()).\n;
echo date('l, F m, Y', strtotime(01/01/2012));
?

Expected result:

date('l, F m, Y') to show the current date, not Thursday, July 07, 2012







-- 
Edit this bug report at https://bugs.php.net/bug.php?id=62610edit=1


[PHP-BUG] Bug #62610 [NEW]: date('l, F m, Y') function outputs wrong date

2012-07-19 Thread jason at jasonbutz dot info
From: jason at jasonbutz dot info
Operating system: Linux
PHP version:  5.3Git-2012-07-19 (Git)
Package:  *General Issues
Bug Type: Bug
Bug description:date('l, F m, Y') function outputs wrong date

Description:

When I use the date function with the included arguments the date is always
output 
as Thursday, July 07, 2012 when using the default timestamp.

Test script:
---
?php
echo Today is .date('m/d/Y').\n;
echo date('l, F m, Y').\n;
echo date('l, F m, Y', time()).\n;
echo date('l, F m, Y', strtotime(01/01/2012));
?

Expected result:

date('l, F m, Y') to show the current date, not Thursday, July 07, 2012


-- 
Edit bug report at https://bugs.php.net/bug.php?id=62610edit=1
-- 
Try a snapshot (PHP 5.4):
https://bugs.php.net/fix.php?id=62610r=trysnapshot54
Try a snapshot (PHP 5.3):
https://bugs.php.net/fix.php?id=62610r=trysnapshot53
Try a snapshot (trunk):  
https://bugs.php.net/fix.php?id=62610r=trysnapshottrunk
Fixed in SVN:
https://bugs.php.net/fix.php?id=62610r=fixed
Fixed in SVN and need be documented: 
https://bugs.php.net/fix.php?id=62610r=needdocs
Fixed in release:
https://bugs.php.net/fix.php?id=62610r=alreadyfixed
Need backtrace:  
https://bugs.php.net/fix.php?id=62610r=needtrace
Need Reproduce Script:   
https://bugs.php.net/fix.php?id=62610r=needscript
Try newer version:   
https://bugs.php.net/fix.php?id=62610r=oldversion
Not developer issue: 
https://bugs.php.net/fix.php?id=62610r=support
Expected behavior:   
https://bugs.php.net/fix.php?id=62610r=notwrong
Not enough info: 
https://bugs.php.net/fix.php?id=62610r=notenoughinfo
Submitted twice: 
https://bugs.php.net/fix.php?id=62610r=submittedtwice
register_globals:
https://bugs.php.net/fix.php?id=62610r=globals
PHP 4 support discontinued:  
https://bugs.php.net/fix.php?id=62610r=php4
Daylight Savings:https://bugs.php.net/fix.php?id=62610r=dst
IIS Stability:   
https://bugs.php.net/fix.php?id=62610r=isapi
Install GNU Sed: 
https://bugs.php.net/fix.php?id=62610r=gnused
Floating point limitations:  
https://bugs.php.net/fix.php?id=62610r=float
No Zend Extensions:  
https://bugs.php.net/fix.php?id=62610r=nozend
MySQL Configuration Error:   
https://bugs.php.net/fix.php?id=62610r=mysqlcfg



Bug #62610 [Opn]: date('l, F m, Y') function outputs wrong date

2012-07-19 Thread jason at jasonbutz dot info
Edit report at https://bugs.php.net/bug.php?id=62610edit=1

 ID: 62610
 User updated by:jason at jasonbutz dot info
 Reported by:jason at jasonbutz dot info
 Summary:date('l, F m, Y') function outputs wrong date
 Status: Open
 Type:   Bug
 Package:*General Issues
 Operating System:   Linux
-PHP Version:5.3Git-2012-07-19 (Git)
+PHP Version:5.3.2-1ubuntu4.17 with Suhosin-Patch (cli) (built:
 Jun 19 2012 03:21:35)
 Block user comment: N
 Private report: N

 New Comment:

Correcting PHP version


Previous Comments:

[2012-07-19 13:31:04] jason at jasonbutz dot info

Description:

When I use the date function with the included arguments the date is always 
output 
as Thursday, July 07, 2012 when using the default timestamp.

Test script:
---
?php
echo Today is .date('m/d/Y').\n;
echo date('l, F m, Y').\n;
echo date('l, F m, Y', time()).\n;
echo date('l, F m, Y', strtotime(01/01/2012));
?

Expected result:

date('l, F m, Y') to show the current date, not Thursday, July 07, 2012







-- 
Edit this bug report at https://bugs.php.net/bug.php?id=62610edit=1


Req #44522 [Com]: http upload max_limits and file above 2GB

2012-03-25 Thread jason at infininull dot com
Edit report at https://bugs.php.net/bug.php?id=44522edit=1

 ID: 44522
 Comment by: jason at infininull dot com
 Reported by:mail2lv at yahoo dot com
 Summary:http upload max_limits and file above 2GB
 Status: Open
 Type:   Feature/Change Request
 Package:*Web Server problem
 Operating System:   All
 PHP Version:5.2.5
 Block user comment: N
 Private report: N

 New Comment:

I have re-rolled the patch against HEAD 
(b4d078f18c950a4bf7e136443586e348bd54f40c) 
and attached it to this request.


Previous Comments:

[2012-03-24 18:42:45] jason at infininull dot com

I was recently bitten by this bug too.  The patch needed a little updating for 
11.04 and I also found a couple of other issues.  1) Uploads only work if 
upload_max_filesize = 0 and 2) The $_FILES[*]['size'] value is an overflowed 
integer.  The attached patch fixes these issues.  I am currently in the process 
of 
re-rolling the patch against HEAD on master to get this in to upstream.


[2012-02-23 19:14:51] s...@php.net

It's probably too late for 5.4, but would be OK for trunk. The patch however 
needs to be cleaned up (no IGNORE vars, etc.) and changing signature for 
zend_atoi may not be safe if any code out there presumes it returns int 
(integer 
overflow). Also, no reason to use signed long there where we used unsigned long.


[2012-02-23 10:14:23] jcabillot at gmail dot com

Do you plan to apply this patch ?
5.3 doesn't support file upload if the file is bigger than 2Gb.
It seem that 5.4 have the same limit.


[2012-02-22 09:30:11] noxxim at mail dot ru

Can someone add a patch for debian squeeze?


[2010-02-15 19:52:50] zaulychny at yahoo dot com

The same problem was faced by me. It seems that PHP stops if size of file is 
above 2Gb (i.e. signed int). 
Will someone fix this issue?




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

https://bugs.php.net/bug.php?id=44522


-- 
Edit this bug report at https://bugs.php.net/bug.php?id=44522edit=1


Req #44522 [Com]: http upload max_limits and file above 2GB

2012-03-24 Thread jason at infininull dot com
Edit report at https://bugs.php.net/bug.php?id=44522edit=1

 ID: 44522
 Comment by: jason at infininull dot com
 Reported by:mail2lv at yahoo dot com
 Summary:http upload max_limits and file above 2GB
 Status: Open
 Type:   Feature/Change Request
 Package:*Web Server problem
 Operating System:   All
 PHP Version:5.2.5
 Block user comment: N
 Private report: N

 New Comment:

I was recently bitten by this bug too.  The patch needed a little updating for 
11.04 and I also found a couple of other issues.  1) Uploads only work if 
upload_max_filesize = 0 and 2) The $_FILES[*]['size'] value is an overflowed 
integer.  The attached patch fixes these issues.  I am currently in the process 
of 
re-rolling the patch against HEAD on master to get this in to upstream.


Previous Comments:

[2012-02-23 19:14:51] s...@php.net

It's probably too late for 5.4, but would be OK for trunk. The patch however 
needs to be cleaned up (no IGNORE vars, etc.) and changing signature for 
zend_atoi may not be safe if any code out there presumes it returns int 
(integer 
overflow). Also, no reason to use signed long there where we used unsigned long.


[2012-02-23 10:14:23] jcabillot at gmail dot com

Do you plan to apply this patch ?
5.3 doesn't support file upload if the file is bigger than 2Gb.
It seem that 5.4 have the same limit.


[2012-02-22 09:30:11] noxxim at mail dot ru

Can someone add a patch for debian squeeze?


[2010-02-15 19:52:50] zaulychny at yahoo dot com

The same problem was faced by me. It seems that PHP stops if size of file is 
above 2Gb (i.e. signed int). 
Will someone fix this issue?


[2009-12-09 20:40:19] tracey at archive dot org

we are using 64-bit ubuntu (jaunty and karmic) at archive.org, and php
v5.2.6 and v5.2.10 (respectively).  we are using fastcgi php-cgi
with nginx.

for us, with these 2 patches, we can get up to 8G posting to work
(haven't tried over 8GB 8-).

basically, they are about tracking the config setting/reading vars 
that are 32bits wide when they'd need 64bits, and similar for upload 
limit checking and reading.  

they prolly will not work with 32bit ubuntu immediately without some 
minor tweaking (since i started using long (8B on 64bit; 4B on 32bit) 
datatype and stuck with it instead of long long (8B on both)).  i'd 
be happy to try to extend the patches  to work on both 32bit and 64bit 
if there is interest.  (basically it took me awhile to figure these 
out and we are only running on 64bit so  i'd want an 
incentive/encouragement to do the extra work 8-)

http://www.archive.org/~tracey/downloads/patches/jaunty-64bit-post-
large-files.patch

http://www.archive.org/~tracey/downloads/patches/karmic-64bit-post-
large-files.patch

http://www.archive.org/~tracey/downloads/patches/jaunty-64bit-post-
large-files.patch-README.txt




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

https://bugs.php.net/bug.php?id=44522


-- 
Edit this bug report at https://bugs.php.net/bug.php?id=44522edit=1


Req #38917 [Com]: OpenSSL: signing function for spkac

2012-01-10 Thread jason dot gerfen at gmail dot com
Edit report at https://bugs.php.net/bug.php?id=38917edit=1

 ID: 38917
 Comment by: jason dot gerfen at gmail dot com
 Reported by:zeph at purotesto dot it
 Summary:OpenSSL: signing function for spkac
 Status: Feedback
 Type:   Feature/Change Request
 Package:OpenSSL related
 Operating System:   Irrilevant
 PHP Version:trunk
 Block user comment: N
 Private report: N

 New Comment:

I have added the requested test case and it is included in the patch
as 026.phpt. I have also performed the required testing against the
Openssl 0.9.8x and 1.0.0x. It is attached to the original bug report
#38917. In addition to attaching the proposed patch I have created a
github repo to make maintenance on the patch simple for myself. The
URL is https://github.com/jas-/SPKAC-PHP-OpenSSL.


Previous Comments:

[2011-12-21 10:49:08] jason dot gerfen at gmail dot com

Once again, please disregard the last message. After researching the 
documentation I found that where I had been using NULL with the 
openssl_csr_sign() function allows for a CA option as well as the SPKAC 
addition to the configargs optional array.

The patch was updated last night to include the 026.phpt test script, as well 
as the five new functions to work with the SPKI provided by keygen tags.

How do patch inclusions work besides posting them to the php internals list?


[2011-12-14 22:10:52] jason dot gerfen at gmail dot com

Please disregard my previous comment. I did a little more digging and am under 
the impression that adding the following to php_openssl_make_REQ() function 
should allow me to create a self signed certificate using the SPKAC NID like so?

if (strcmp(strindex, SPKAC) == 0) {
 if (!X509_NAME_add_entry_by_txt(subj, strindex, MBSTRING_ASC, (unsigned 
char*)Z_STRVAL_PP(item), -1, -1, 0)){
  php_error_docref(NULL TSRMLS_CC, E_WARNING, dn: add_entry_by_txt %s - %s 
(failed), strindex, Z_STRVAL_PP(item));
  return FAILURE;
 }
}

Would you recommend another method? Please advise.


[2011-12-14 19:40:20] jason dot gerfen at gmail dot com

One other question about using SPKAC's when creating a x509. It seems the 
current method using openssl_csr_new() which in turn calls the 
php_openssl_make_REQ() to assign the specified DN attributes has no method of 
adding the SPKAC field.

After digging around it seems logical to use the OBJ_create() and OBJ_* family 
of functions to add NID. Please forgive me if I am way off here but any 
direction you could point me in using the existing functions to output and sign 
a certificate similar to the following command?

openssl ca -config /path/to/openssl.conf -days 180 -notext -batch \
  -spkac /path/to/cert.pem -out /path/to/signed.pem -passin pass:'random'

My assumption is that I will need to create one specifically for this purpose 
but would like your insight.


[2011-12-14 13:51:42] jason dot gerfen at gmail dot com

This will test all five new functions unless you would like one test case per 
function?

--TEST--
openssl_spki_new(), openssl_spki_verify(), openssl_spki_export(), 
openssl_spki_export_challenge(), openssl_spki_details()
--SKIPIF--
?php
if (!extension_loaded(openssl)) die(skip);
if (!@openssl_pkey_new()) die(skip cannot create private key);
?
--FILE--
?php

echo Creating private key\n;
$key = openssl_pkey_new();
if ($key === false)
 die(failed to create private key\n);

echo Creating new SPKAC\n;
if (!function_exists(openssl_spki_new))
 die(openssl_spki_new() does not exist\n);

$spki = openssl_spki_new($key, sample_challenge_string);
if ($spki === false)
 die(could not create spkac\n);

echo Verifying SPKAC\n;
if (!function_exists(openssl_spki_verify))
 die(openssl_spki_verify() does not exist\n);

$x = openssl_spki_verify(preg_replace(/SPKAC=/, , $spki));
if ($x === false)
 die(could not verify spkac\n);

echo Exporting challenge\n;
if (!function_exists(openssl_spki_export_challenge))
 die(openssl_spki_export_challenge() does not exist\n);

$y = openssl_spki_export_challenge(preg_replace(/SPKAC=/, , $spki));
if ($y !== sample_challenge_string)
 die(could not verify challenge string from spkac\n);

echo Exporting public key from SPKAC\n;
if (!function_exists(openssl_spki_export))
 die(openssl_spki_export() does not exist\n);

$z = openssl_spki_export(preg_replace(/SPKAC=/, '', $spki));
if ($z === )
 die(could not export public key from spkac\n);

echo Generating details of SPKAC structure\n;
if (!function_exists(openssl_spki_details))
 die(openssl_spki_details() does not exist\n);

$w = openssl_spki_details(preg_replace('/SPKAC=/', '', $spki));
if ($w === )
 die(could not obtain details from spkac\n);

echo OK!\n

Req #46240 [Com]: Build in foreach else support

2011-12-22 Thread jason at valdron dot ca
Edit report at https://bugs.php.net/bug.php?id=46240edit=1

 ID: 46240
 Comment by: jason at valdron dot ca
 Reported by:kjarli at gmail dot com
 Summary:Build in foreach else support
 Status: Open
 Type:   Feature/Change Request
 Package:Scripting Engine problem
 Operating System:   *
 PHP Version:5.2.6
 Block user comment: N
 Private report: N

 New Comment:

I completely disagree about the onFail section.

The foreach else would be useful if there is no item. As a shortcut to 
if(count($elements) == 0).


Previous Comments:

[2011-07-12 12:13:44] dinumarina at yahoo dot com

Opposing general consensus, I think adding such feature would be semantically 
ambiguous. The foreach function does not fail, it has types it can handle 
(assoc 
array, object) and that it can't handle (scalar). A function can always return 
a 
result that may be valid for foreach but not the expected format, so I think 
data sanitizing is best done dilligently. This is just a lazy-man's hack for a 
non-issue. For the function completion status (onFail), there is already such a 
construct: try {throw()} catch(){} which already supersets the imagined onFail 
implementation. Only thing I would hindsight: it would have been SOOO nice if 
php had a false/null/na result convention, as well as an error/exception 
convention and it would actually stick by it. Each module signals completion, 
computability, singular cases and errors as it well pleases.


[2011-02-18 01:20:24] ijrbiz at gmail dot com

Highly agreed with adding a foreach :: else statement, this request would be 
very 
practical for improved coding structure and follows logical language syntax 
nicely.

foreach ($items as $item) {
echo $item; // Manage each item, ...
} else {
echo 'No items present.'; // Manage no items found, ...
}


[2011-02-04 02:30:00] pedro at worcel dot com

foreachelse seems ok to me. Onfail is... weird. :)


[2010-12-20 13:40:54] rick dot sketchy at gmail dot com

I have to agree with the OP. foreachelse (or something similar) is really 
needed. I do like the suggestion posted by cerlestes at googlemail dot com:

foreach($arr as $var)
{
doCode();
}
onFail
{
failHandling();
}

A fail handler would prove useful,however I can see it may have some 
limitations, in which case an else option on the foreach would be satisfactory. 
Whilst we're at it, it may as well be added to while statements too.


[2010-02-13 19:44:15] cerlestes at googlemail dot com

ADDITION:

Why I would like to have this is because of the following situation:


$test = (float)0; // This would be the return of a function.

// Failhandling
if(!$test)
{
doFailhandling();
}else ...


This method has room for misinterpretations.
Ofc, you could test for $test === false, but I think a general onFail-handler 
would be way nicer.

Thanks for reading




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

https://bugs.php.net/bug.php?id=46240


-- 
Edit this bug report at https://bugs.php.net/bug.php?id=46240edit=1


Req #38917 [Com]: OpenSSL: signing function for spkac

2011-12-21 Thread jason dot gerfen at gmail dot com
Edit report at https://bugs.php.net/bug.php?id=38917edit=1

 ID: 38917
 Comment by: jason dot gerfen at gmail dot com
 Reported by:zeph at purotesto dot it
 Summary:OpenSSL: signing function for spkac
 Status: Feedback
 Type:   Feature/Change Request
 Package:OpenSSL related
 Operating System:   Irrilevant
 PHP Version:trunk
 Block user comment: N
 Private report: N

 New Comment:

Once again, please disregard the last message. After researching the 
documentation I found that where I had been using NULL with the 
openssl_csr_sign() function allows for a CA option as well as the SPKAC 
addition to the configargs optional array.

The patch was updated last night to include the 026.phpt test script, as well 
as the five new functions to work with the SPKI provided by keygen tags.

How do patch inclusions work besides posting them to the php internals list?


Previous Comments:

[2011-12-14 22:10:52] jason dot gerfen at gmail dot com

Please disregard my previous comment. I did a little more digging and am under 
the impression that adding the following to php_openssl_make_REQ() function 
should allow me to create a self signed certificate using the SPKAC NID like so?

if (strcmp(strindex, SPKAC) == 0) {
 if (!X509_NAME_add_entry_by_txt(subj, strindex, MBSTRING_ASC, (unsigned 
char*)Z_STRVAL_PP(item), -1, -1, 0)){
  php_error_docref(NULL TSRMLS_CC, E_WARNING, dn: add_entry_by_txt %s - %s 
(failed), strindex, Z_STRVAL_PP(item));
  return FAILURE;
 }
}

Would you recommend another method? Please advise.


[2011-12-14 19:40:20] jason dot gerfen at gmail dot com

One other question about using SPKAC's when creating a x509. It seems the 
current method using openssl_csr_new() which in turn calls the 
php_openssl_make_REQ() to assign the specified DN attributes has no method of 
adding the SPKAC field.

After digging around it seems logical to use the OBJ_create() and OBJ_* family 
of functions to add NID. Please forgive me if I am way off here but any 
direction you could point me in using the existing functions to output and sign 
a certificate similar to the following command?

openssl ca -config /path/to/openssl.conf -days 180 -notext -batch \
  -spkac /path/to/cert.pem -out /path/to/signed.pem -passin pass:'random'

My assumption is that I will need to create one specifically for this purpose 
but would like your insight.


[2011-12-14 13:51:42] jason dot gerfen at gmail dot com

This will test all five new functions unless you would like one test case per 
function?

--TEST--
openssl_spki_new(), openssl_spki_verify(), openssl_spki_export(), 
openssl_spki_export_challenge(), openssl_spki_details()
--SKIPIF--
?php
if (!extension_loaded(openssl)) die(skip);
if (!@openssl_pkey_new()) die(skip cannot create private key);
?
--FILE--
?php

echo Creating private key\n;
$key = openssl_pkey_new();
if ($key === false)
 die(failed to create private key\n);

echo Creating new SPKAC\n;
if (!function_exists(openssl_spki_new))
 die(openssl_spki_new() does not exist\n);

$spki = openssl_spki_new($key, sample_challenge_string);
if ($spki === false)
 die(could not create spkac\n);

echo Verifying SPKAC\n;
if (!function_exists(openssl_spki_verify))
 die(openssl_spki_verify() does not exist\n);

$x = openssl_spki_verify(preg_replace(/SPKAC=/, , $spki));
if ($x === false)
 die(could not verify spkac\n);

echo Exporting challenge\n;
if (!function_exists(openssl_spki_export_challenge))
 die(openssl_spki_export_challenge() does not exist\n);

$y = openssl_spki_export_challenge(preg_replace(/SPKAC=/, , $spki));
if ($y !== sample_challenge_string)
 die(could not verify challenge string from spkac\n);

echo Exporting public key from SPKAC\n;
if (!function_exists(openssl_spki_export))
 die(openssl_spki_export() does not exist\n);

$z = openssl_spki_export(preg_replace(/SPKAC=/, '', $spki));
if ($z === )
 die(could not export public key from spkac\n);

echo Generating details of SPKAC structure\n;
if (!function_exists(openssl_spki_details))
 die(openssl_spki_details() does not exist\n);

$w = openssl_spki_details(preg_replace('/SPKAC=/', '', $spki));
if ($w === )
 die(could not obtain details from spkac\n);

echo OK!\n;

openssl_free_key($key);
?
--EXPECT--
Creating private key
Creating new SPKAC
Verifying SPKAC
Exporting challenge
Exporting public key from SPKAC
Generating details of SPKAC structure
OK!


[2011-12-14 12:02:35] paj...@php.net

Please see the phpt files in ext/openssl/tests/

this is how tests should be written.

Further explanations are available here: http://qa.php.net/

Thanks

Req #38917 [Com]: OpenSSL: signing function for spkac

2011-12-14 Thread jason dot gerfen at gmail dot com
Edit report at https://bugs.php.net/bug.php?id=38917edit=1

 ID: 38917
 Comment by: jason dot gerfen at gmail dot com
 Reported by:zeph at purotesto dot it
 Summary:OpenSSL: signing function for spkac
 Status: Open
 Type:   Feature/Change Request
 Package:OpenSSL related
 Operating System:   Irrilevant
 PHP Version:trunk
 Block user comment: N
 Private report: N

 New Comment:

form id=spkac name=spkac method=post action=openssl-spki.php
 keygen name=spki-key keytype=rsa challenge=testing/keygen
 input type=submit
/form

?php

if (!empty($_POST['spki-key'])) {
 echo 'pre'; print_r($_POST['spki-key']); echo '/pre';


}

if (empty($_POST['spki-key'])){

 echo Generating private key...;

 $key = openssl_pkey_new(array('digest_alg' = 'sha1',

   'private_key_type' = OPENSSL_KEYTYPE_RSA,

   'private_key_bits' = 2048));

 echo donebr/;

 echo br/;

}



if (empty($_POST['spki-key'])){

 echo Creating SPKAC...br/;

 if (function_exists('openssl_spki_new')){

  $spki = openssl_spki_new($key, 'wtfd00d');

  echo pre.$spki./pre;

 }

 echo br/donebr/;

 echo br/;

}



echo Verifying SPKAC...br/;

if (function_exists('openssl_spki_verify')){

 $y = (empty($_POST['spki-key'])) ?

  openssl_spki_verify(preg_replace('/SPKAC=/', '', $spki)) :

  openssl_spki_verify($_POST['spki-key']);

 var_dump($y);

}

echo br/br/;



echo Exporting challenge from SPKAC...br/;

if (function_exists('openssl_spki_export_challenge')){

 $x = (empty($_POST['spki-key'])) ?

  openssl_spki_export_challenge(preg_replace('/SPKAC=/', '', $spki)) :

  openssl_spki_export_challenge($_POST['spki-key']);

 echo $x;

}

echo br/donebr/;

echo br/;



echo Exporting public key from SPKAC...br/;

if (function_exists('openssl_spki_export')){

 $z = (empty($_POST['spki-key'])) ?

  openssl_spki_export(preg_replace('/SPKAC=/', '', $spki)) :

  openssl_spki_export($_POST['spki-key']);

 echo 'pre'; print_r($z); echo '/pre';

}

echo br/br/;



echo SPKAC details...br/;

if (function_exists('openssl_spki_details')){

 $w = (empty($_POST['spki-key'])) ?

  openssl_spki_details(preg_replace('/SPKAC=/', '', $spki)) :

  openssl_spki_details($_POST['spki-key']);

 echo 'pre'; print_r($w); echo '/pre';

}

echo donebr/;

echo br/;



if (empty($_POST['spki-key'])){

 openssl_free_key($key);

}



?


Previous Comments:

[2011-12-13 17:04:07] paj...@php.net

Hi!

Thanks for the patch, please add some test cases as well (phpt format) so we 
can 
easily valid the new functions.

Also be sure that the patched ssl can still be built against older openssl 
version 
as we still support them (0.9.x serie for trunk and 5.4).


[2011-12-13 16:56:43] jason dot gerfen at gmail dot com

Since I have not seen any changes on this I am going to post the patch to php-
internals list.


[2011-12-08 10:57:03] jason dot gerfen at gmail dot com

I modified the test case and fixed a slight memory problem that would 
occasionally take place when allocating memory for the openssl_spki_new() 
return value.

echo Generating private key...;
$key = openssl_pkey_new(array('digest_alg' = 'sha1',
  'private_key_type' = OPENSSL_KEYTYPE_RSA,
  'private_key_bits' = 2048));
echo done\n;
echo \n;

echo Creating SPKAC...\n;
if (function_exists('openssl_spki_new')){
 $spki = openssl_spki_new($key, 'wtfd00d');
 echo $spki;
}
echo done\n;
echo \n;

echo SPKAC details...\n;
if (function_exists('openssl_spki_details')){
 $x = (empty($_POST['spki-key'])) ?
  openssl_spki_details(preg_replace('/SPKAC=/', '', $spki)) :
  openssl_spki_details($_POST['spki-key']);
 var_dump($x);
}
echo done\n;
echo \n;

echo Verifying SPKAC...\n;
if (function_exists('openssl_spki_verify')){
 $y = (empty($_POST['spki-key'])) ?
  openssl_spki_verify(preg_replace('/SPKAC=/', '', $spki)) :
  openssl_spki_verify($_POST['spki-key']);
 var_dump($y);
}
echo \n\n;

echo Exporting public key from SPKAC...\n;
if (function_exists('openssl_spki_export')){
 $z = (empty($_POST['spki-key'])) ?
  openssl_spki_export(preg_replace('/SPKAC=/', '', $spki)) :
  openssl_spki_export($_POST['spki-key']);
 var_dump($z);
}


[2011-12-06 11:28:50] jason dot gerfen at gmail dot com

Here is a patch to implement three new functions to help with verification of 
the SPKAC HTML keygen element

Req #38917 [Com]: OpenSSL: signing function for spkac

2011-12-14 Thread jason dot gerfen at gmail dot com
Edit report at https://bugs.php.net/bug.php?id=38917edit=1

 ID: 38917
 Comment by: jason dot gerfen at gmail dot com
 Reported by:zeph at purotesto dot it
 Summary:OpenSSL: signing function for spkac
 Status: Feedback
 Type:   Feature/Change Request
 Package:OpenSSL related
 Operating System:   Irrilevant
 PHP Version:trunk
 Block user comment: N
 Private report: N

 New Comment:

This will test all five new functions unless you would like one test case per 
function?

--TEST--
openssl_spki_new(), openssl_spki_verify(), openssl_spki_export(), 
openssl_spki_export_challenge(), openssl_spki_details()
--SKIPIF--
?php
if (!extension_loaded(openssl)) die(skip);
if (!@openssl_pkey_new()) die(skip cannot create private key);
?
--FILE--
?php

echo Creating private key\n;
$key = openssl_pkey_new();
if ($key === false)
 die(failed to create private key\n);

echo Creating new SPKAC\n;
if (!function_exists(openssl_spki_new))
 die(openssl_spki_new() does not exist\n);

$spki = openssl_spki_new($key, sample_challenge_string);
if ($spki === false)
 die(could not create spkac\n);

echo Verifying SPKAC\n;
if (!function_exists(openssl_spki_verify))
 die(openssl_spki_verify() does not exist\n);

$x = openssl_spki_verify(preg_replace(/SPKAC=/, , $spki));
if ($x === false)
 die(could not verify spkac\n);

echo Exporting challenge\n;
if (!function_exists(openssl_spki_export_challenge))
 die(openssl_spki_export_challenge() does not exist\n);

$y = openssl_spki_export_challenge(preg_replace(/SPKAC=/, , $spki));
if ($y !== sample_challenge_string)
 die(could not verify challenge string from spkac\n);

echo Exporting public key from SPKAC\n;
if (!function_exists(openssl_spki_export))
 die(openssl_spki_export() does not exist\n);

$z = openssl_spki_export(preg_replace(/SPKAC=/, '', $spki));
if ($z === )
 die(could not export public key from spkac\n);

echo Generating details of SPKAC structure\n;
if (!function_exists(openssl_spki_details))
 die(openssl_spki_details() does not exist\n);

$w = openssl_spki_details(preg_replace('/SPKAC=/', '', $spki));
if ($w === )
 die(could not obtain details from spkac\n);

echo OK!\n;

openssl_free_key($key);
?
--EXPECT--
Creating private key
Creating new SPKAC
Verifying SPKAC
Exporting challenge
Exporting public key from SPKAC
Generating details of SPKAC structure
OK!


Previous Comments:

[2011-12-14 12:02:35] paj...@php.net

Please see the phpt files in ext/openssl/tests/

this is how tests should be written.

Further explanations are available here: http://qa.php.net/

Thanks!


[2011-12-14 11:40:42] jason dot gerfen at gmail dot com

form id=spkac name=spkac method=post action=openssl-spki.php
 keygen name=spki-key keytype=rsa challenge=testing/keygen
 input type=submit
/form

?php

if (!empty($_POST['spki-key'])) {
 echo 'pre'; print_r($_POST['spki-key']); echo '/pre';


}

if (empty($_POST['spki-key'])){

 echo Generating private key...;

 $key = openssl_pkey_new(array('digest_alg' = 'sha1',

   'private_key_type' = OPENSSL_KEYTYPE_RSA,

   'private_key_bits' = 2048));

 echo donebr/;

 echo br/;

}



if (empty($_POST['spki-key'])){

 echo Creating SPKAC...br/;

 if (function_exists('openssl_spki_new')){

  $spki = openssl_spki_new($key, 'wtfd00d');

  echo pre.$spki./pre;

 }

 echo br/donebr/;

 echo br/;

}



echo Verifying SPKAC...br/;

if (function_exists('openssl_spki_verify')){

 $y = (empty($_POST['spki-key'])) ?

  openssl_spki_verify(preg_replace('/SPKAC=/', '', $spki)) :

  openssl_spki_verify($_POST['spki-key']);

 var_dump($y);

}

echo br/br/;



echo Exporting challenge from SPKAC...br/;

if (function_exists('openssl_spki_export_challenge')){

 $x = (empty($_POST['spki-key'])) ?

  openssl_spki_export_challenge(preg_replace('/SPKAC=/', '', $spki)) :

  openssl_spki_export_challenge($_POST['spki-key']);

 echo $x;

}

echo br/donebr/;

echo br/;



echo Exporting public key from SPKAC...br/;

if (function_exists('openssl_spki_export')){

 $z = (empty($_POST['spki-key'])) ?

  openssl_spki_export(preg_replace('/SPKAC=/', '', $spki)) :

  openssl_spki_export($_POST['spki-key']);

 echo 'pre'; print_r($z); echo '/pre';

}

echo br/br/;



echo SPKAC details...br/;

if (function_exists('openssl_spki_details')){

 $w = (empty($_POST['spki-key'])) ?

  openssl_spki_details(preg_replace('/SPKAC=/', '', $spki)) :

  openssl_spki_details($_POST['spki-key']);

 echo 'pre'; print_r($w); echo '/pre';

}

echo donebr/;

echo br/;



if (empty($_POST['spki-key'])){

 openssl_free_key($key

Req #38917 [Com]: OpenSSL: signing function for spkac

2011-12-14 Thread jason dot gerfen at gmail dot com
Edit report at https://bugs.php.net/bug.php?id=38917edit=1

 ID: 38917
 Comment by: jason dot gerfen at gmail dot com
 Reported by:zeph at purotesto dot it
 Summary:OpenSSL: signing function for spkac
 Status: Feedback
 Type:   Feature/Change Request
 Package:OpenSSL related
 Operating System:   Irrilevant
 PHP Version:trunk
 Block user comment: N
 Private report: N

 New Comment:

One other question about using SPKAC's when creating a x509. It seems the 
current method using openssl_csr_new() which in turn calls the 
php_openssl_make_REQ() to assign the specified DN attributes has no method of 
adding the SPKAC field.

After digging around it seems logical to use the OBJ_create() and OBJ_* family 
of functions to add NID. Please forgive me if I am way off here but any 
direction you could point me in using the existing functions to output and sign 
a certificate similar to the following command?

openssl ca -config /path/to/openssl.conf -days 180 -notext -batch \
  -spkac /path/to/cert.pem -out /path/to/signed.pem -passin pass:'random'

My assumption is that I will need to create one specifically for this purpose 
but would like your insight.


Previous Comments:

[2011-12-14 13:51:42] jason dot gerfen at gmail dot com

This will test all five new functions unless you would like one test case per 
function?

--TEST--
openssl_spki_new(), openssl_spki_verify(), openssl_spki_export(), 
openssl_spki_export_challenge(), openssl_spki_details()
--SKIPIF--
?php
if (!extension_loaded(openssl)) die(skip);
if (!@openssl_pkey_new()) die(skip cannot create private key);
?
--FILE--
?php

echo Creating private key\n;
$key = openssl_pkey_new();
if ($key === false)
 die(failed to create private key\n);

echo Creating new SPKAC\n;
if (!function_exists(openssl_spki_new))
 die(openssl_spki_new() does not exist\n);

$spki = openssl_spki_new($key, sample_challenge_string);
if ($spki === false)
 die(could not create spkac\n);

echo Verifying SPKAC\n;
if (!function_exists(openssl_spki_verify))
 die(openssl_spki_verify() does not exist\n);

$x = openssl_spki_verify(preg_replace(/SPKAC=/, , $spki));
if ($x === false)
 die(could not verify spkac\n);

echo Exporting challenge\n;
if (!function_exists(openssl_spki_export_challenge))
 die(openssl_spki_export_challenge() does not exist\n);

$y = openssl_spki_export_challenge(preg_replace(/SPKAC=/, , $spki));
if ($y !== sample_challenge_string)
 die(could not verify challenge string from spkac\n);

echo Exporting public key from SPKAC\n;
if (!function_exists(openssl_spki_export))
 die(openssl_spki_export() does not exist\n);

$z = openssl_spki_export(preg_replace(/SPKAC=/, '', $spki));
if ($z === )
 die(could not export public key from spkac\n);

echo Generating details of SPKAC structure\n;
if (!function_exists(openssl_spki_details))
 die(openssl_spki_details() does not exist\n);

$w = openssl_spki_details(preg_replace('/SPKAC=/', '', $spki));
if ($w === )
 die(could not obtain details from spkac\n);

echo OK!\n;

openssl_free_key($key);
?
--EXPECT--
Creating private key
Creating new SPKAC
Verifying SPKAC
Exporting challenge
Exporting public key from SPKAC
Generating details of SPKAC structure
OK!


[2011-12-14 12:02:35] paj...@php.net

Please see the phpt files in ext/openssl/tests/

this is how tests should be written.

Further explanations are available here: http://qa.php.net/

Thanks!


[2011-12-14 11:40:42] jason dot gerfen at gmail dot com

form id=spkac name=spkac method=post action=openssl-spki.php
 keygen name=spki-key keytype=rsa challenge=testing/keygen
 input type=submit
/form

?php

if (!empty($_POST['spki-key'])) {
 echo 'pre'; print_r($_POST['spki-key']); echo '/pre';


}

if (empty($_POST['spki-key'])){

 echo Generating private key...;

 $key = openssl_pkey_new(array('digest_alg' = 'sha1',

   'private_key_type' = OPENSSL_KEYTYPE_RSA,

   'private_key_bits' = 2048));

 echo donebr/;

 echo br/;

}



if (empty($_POST['spki-key'])){

 echo Creating SPKAC...br/;

 if (function_exists('openssl_spki_new')){

  $spki = openssl_spki_new($key, 'wtfd00d');

  echo pre.$spki./pre;

 }

 echo br/donebr/;

 echo br/;

}



echo Verifying SPKAC...br/;

if (function_exists('openssl_spki_verify')){

 $y = (empty($_POST['spki-key'])) ?

  openssl_spki_verify(preg_replace('/SPKAC=/', '', $spki)) :

  openssl_spki_verify($_POST['spki-key']);

 var_dump($y);

}

echo br/br/;



echo Exporting challenge from SPKAC...br/;

if (function_exists('openssl_spki_export_challenge')){

 $x = (empty($_POST['spki-key'])) ?

  openssl_spki_export_challenge

Req #38917 [Com]: OpenSSL: signing function for spkac

2011-12-14 Thread jason dot gerfen at gmail dot com
Edit report at https://bugs.php.net/bug.php?id=38917edit=1

 ID: 38917
 Comment by: jason dot gerfen at gmail dot com
 Reported by:zeph at purotesto dot it
 Summary:OpenSSL: signing function for spkac
 Status: Feedback
 Type:   Feature/Change Request
 Package:OpenSSL related
 Operating System:   Irrilevant
 PHP Version:trunk
 Block user comment: N
 Private report: N

 New Comment:

Please disregard my previous comment. I did a little more digging and am under 
the impression that adding the following to php_openssl_make_REQ() function 
should allow me to create a self signed certificate using the SPKAC NID like so?

if (strcmp(strindex, SPKAC) == 0) {
 if (!X509_NAME_add_entry_by_txt(subj, strindex, MBSTRING_ASC, (unsigned 
char*)Z_STRVAL_PP(item), -1, -1, 0)){
  php_error_docref(NULL TSRMLS_CC, E_WARNING, dn: add_entry_by_txt %s - %s 
(failed), strindex, Z_STRVAL_PP(item));
  return FAILURE;
 }
}

Would you recommend another method? Please advise.


Previous Comments:

[2011-12-14 19:40:20] jason dot gerfen at gmail dot com

One other question about using SPKAC's when creating a x509. It seems the 
current method using openssl_csr_new() which in turn calls the 
php_openssl_make_REQ() to assign the specified DN attributes has no method of 
adding the SPKAC field.

After digging around it seems logical to use the OBJ_create() and OBJ_* family 
of functions to add NID. Please forgive me if I am way off here but any 
direction you could point me in using the existing functions to output and sign 
a certificate similar to the following command?

openssl ca -config /path/to/openssl.conf -days 180 -notext -batch \
  -spkac /path/to/cert.pem -out /path/to/signed.pem -passin pass:'random'

My assumption is that I will need to create one specifically for this purpose 
but would like your insight.


[2011-12-14 13:51:42] jason dot gerfen at gmail dot com

This will test all five new functions unless you would like one test case per 
function?

--TEST--
openssl_spki_new(), openssl_spki_verify(), openssl_spki_export(), 
openssl_spki_export_challenge(), openssl_spki_details()
--SKIPIF--
?php
if (!extension_loaded(openssl)) die(skip);
if (!@openssl_pkey_new()) die(skip cannot create private key);
?
--FILE--
?php

echo Creating private key\n;
$key = openssl_pkey_new();
if ($key === false)
 die(failed to create private key\n);

echo Creating new SPKAC\n;
if (!function_exists(openssl_spki_new))
 die(openssl_spki_new() does not exist\n);

$spki = openssl_spki_new($key, sample_challenge_string);
if ($spki === false)
 die(could not create spkac\n);

echo Verifying SPKAC\n;
if (!function_exists(openssl_spki_verify))
 die(openssl_spki_verify() does not exist\n);

$x = openssl_spki_verify(preg_replace(/SPKAC=/, , $spki));
if ($x === false)
 die(could not verify spkac\n);

echo Exporting challenge\n;
if (!function_exists(openssl_spki_export_challenge))
 die(openssl_spki_export_challenge() does not exist\n);

$y = openssl_spki_export_challenge(preg_replace(/SPKAC=/, , $spki));
if ($y !== sample_challenge_string)
 die(could not verify challenge string from spkac\n);

echo Exporting public key from SPKAC\n;
if (!function_exists(openssl_spki_export))
 die(openssl_spki_export() does not exist\n);

$z = openssl_spki_export(preg_replace(/SPKAC=/, '', $spki));
if ($z === )
 die(could not export public key from spkac\n);

echo Generating details of SPKAC structure\n;
if (!function_exists(openssl_spki_details))
 die(openssl_spki_details() does not exist\n);

$w = openssl_spki_details(preg_replace('/SPKAC=/', '', $spki));
if ($w === )
 die(could not obtain details from spkac\n);

echo OK!\n;

openssl_free_key($key);
?
--EXPECT--
Creating private key
Creating new SPKAC
Verifying SPKAC
Exporting challenge
Exporting public key from SPKAC
Generating details of SPKAC structure
OK!


[2011-12-14 12:02:35] paj...@php.net

Please see the phpt files in ext/openssl/tests/

this is how tests should be written.

Further explanations are available here: http://qa.php.net/

Thanks!


[2011-12-14 11:40:42] jason dot gerfen at gmail dot com

form id=spkac name=spkac method=post action=openssl-spki.php
 keygen name=spki-key keytype=rsa challenge=testing/keygen
 input type=submit
/form

?php

if (!empty($_POST['spki-key'])) {
 echo 'pre'; print_r($_POST['spki-key']); echo '/pre';


}

if (empty($_POST['spki-key'])){

 echo Generating private key...;

 $key = openssl_pkey_new(array('digest_alg' = 'sha1',

   'private_key_type' = OPENSSL_KEYTYPE_RSA,

   'private_key_bits' = 2048));

 echo donebr/;

 echo

Req #38917 [Com]: OpenSSL: signing function for spkac

2011-12-13 Thread jason dot gerfen at gmail dot com
Edit report at https://bugs.php.net/bug.php?id=38917edit=1

 ID: 38917
 Comment by: jason dot gerfen at gmail dot com
 Reported by:zeph at purotesto dot it
 Summary:OpenSSL: signing function for spkac
 Status: Open
 Type:   Feature/Change Request
 Package:OpenSSL related
 Operating System:   Irrilevant
 PHP Version:4.4.4
 Block user comment: N
 Private report: N

 New Comment:

Since I have not seen any changes on this I am going to post the patch to php-
internals list.


Previous Comments:

[2011-12-08 10:57:03] jason dot gerfen at gmail dot com

I modified the test case and fixed a slight memory problem that would 
occasionally take place when allocating memory for the openssl_spki_new() 
return value.

echo Generating private key...;
$key = openssl_pkey_new(array('digest_alg' = 'sha1',
  'private_key_type' = OPENSSL_KEYTYPE_RSA,
  'private_key_bits' = 2048));
echo done\n;
echo \n;

echo Creating SPKAC...\n;
if (function_exists('openssl_spki_new')){
 $spki = openssl_spki_new($key, 'wtfd00d');
 echo $spki;
}
echo done\n;
echo \n;

echo SPKAC details...\n;
if (function_exists('openssl_spki_details')){
 $x = (empty($_POST['spki-key'])) ?
  openssl_spki_details(preg_replace('/SPKAC=/', '', $spki)) :
  openssl_spki_details($_POST['spki-key']);
 var_dump($x);
}
echo done\n;
echo \n;

echo Verifying SPKAC...\n;
if (function_exists('openssl_spki_verify')){
 $y = (empty($_POST['spki-key'])) ?
  openssl_spki_verify(preg_replace('/SPKAC=/', '', $spki)) :
  openssl_spki_verify($_POST['spki-key']);
 var_dump($y);
}
echo \n\n;

echo Exporting public key from SPKAC...\n;
if (function_exists('openssl_spki_export')){
 $z = (empty($_POST['spki-key'])) ?
  openssl_spki_export(preg_replace('/SPKAC=/', '', $spki)) :
  openssl_spki_export($_POST['spki-key']);
 var_dump($z);
}


[2011-12-06 11:28:50] jason dot gerfen at gmail dot com

Here is a patch to implement three new functions to help with verification of 
the SPKAC HTML keygen element.

To patch:

1. Download PHP-5.3.8
2. Download patch from here (spki.patch)
3. Apply patch
% patch -p0  spki.patch
4. Configure and compiled PHP
% ./configure --with-openssl=/path/to/openssl
% make  make install

Test script:
$key = openssl_pkey_new(array('digest_alg' = 'sha1',
  'private_key_type' = OPENSSL_KEYTYPE_RSA,
  'private_key_bits' = 2048));

if (function_exists('openssl_spki_new')){
 $spki = openssl_spki_new($key, 'password');
 echo $spki.'\n\r';
}

if (function_exists('openssl_spki_verify')){
 echo openssl_spki_verify(preg_replace('/SPKAC=/', '', $spki)).'\n\r';
}

if (function_exists('openssl_spki_export')){
 echo openssl_spki_export(preg_replace('/SPKAC=/', '', $spki)).'\n\r';
}


[2011-12-03 02:55:06] jason dot gerfen at gmail dot com

Not sure how to go about submitting a patch I am working on to address this.


[2006-09-21 23:45:19] zeph at purotesto dot it

Description:

i need openssl api support for spkac

now there's the possibility to sign a pkcs10 csr (created by explorer) but not 
an spkac created by firefox/mozilla/netscape/safary ...

check www.openca.org for more information... i need that api to create 
something similar but more usable on the GOsa project http://gosa.gonicus.de

by
Guido Serra

http://dev.purotesto.it/support/gosa
GOsa CA Management plugin







-- 
Edit this bug report at https://bugs.php.net/bug.php?id=38917edit=1


Req #38917 [Com]: OpenSSL: signing function for spkac

2011-12-08 Thread jason dot gerfen at gmail dot com
Edit report at https://bugs.php.net/bug.php?id=38917edit=1

 ID: 38917
 Comment by: jason dot gerfen at gmail dot com
 Reported by:zeph at purotesto dot it
 Summary:OpenSSL: signing function for spkac
 Status: Open
 Type:   Feature/Change Request
 Package:OpenSSL related
 Operating System:   Irrilevant
 PHP Version:4.4.4
 Block user comment: N
 Private report: N

 New Comment:

I modified the test case and fixed a slight memory problem that would 
occasionally take place when allocating memory for the openssl_spki_new() 
return value.

echo Generating private key...;
$key = openssl_pkey_new(array('digest_alg' = 'sha1',
  'private_key_type' = OPENSSL_KEYTYPE_RSA,
  'private_key_bits' = 2048));
echo done\n;
echo \n;

echo Creating SPKAC...\n;
if (function_exists('openssl_spki_new')){
 $spki = openssl_spki_new($key, 'wtfd00d');
 echo $spki;
}
echo done\n;
echo \n;

echo SPKAC details...\n;
if (function_exists('openssl_spki_details')){
 $x = (empty($_POST['spki-key'])) ?
  openssl_spki_details(preg_replace('/SPKAC=/', '', $spki)) :
  openssl_spki_details($_POST['spki-key']);
 var_dump($x);
}
echo done\n;
echo \n;

echo Verifying SPKAC...\n;
if (function_exists('openssl_spki_verify')){
 $y = (empty($_POST['spki-key'])) ?
  openssl_spki_verify(preg_replace('/SPKAC=/', '', $spki)) :
  openssl_spki_verify($_POST['spki-key']);
 var_dump($y);
}
echo \n\n;

echo Exporting public key from SPKAC...\n;
if (function_exists('openssl_spki_export')){
 $z = (empty($_POST['spki-key'])) ?
  openssl_spki_export(preg_replace('/SPKAC=/', '', $spki)) :
  openssl_spki_export($_POST['spki-key']);
 var_dump($z);
}


Previous Comments:

[2011-12-06 11:28:50] jason dot gerfen at gmail dot com

Here is a patch to implement three new functions to help with verification of 
the SPKAC HTML keygen element.

To patch:

1. Download PHP-5.3.8
2. Download patch from here (spki.patch)
3. Apply patch
% patch -p0  spki.patch
4. Configure and compiled PHP
% ./configure --with-openssl=/path/to/openssl
% make  make install

Test script:
$key = openssl_pkey_new(array('digest_alg' = 'sha1',
  'private_key_type' = OPENSSL_KEYTYPE_RSA,
  'private_key_bits' = 2048));

if (function_exists('openssl_spki_new')){
 $spki = openssl_spki_new($key, 'password');
 echo $spki.'\n\r';
}

if (function_exists('openssl_spki_verify')){
 echo openssl_spki_verify(preg_replace('/SPKAC=/', '', $spki)).'\n\r';
}

if (function_exists('openssl_spki_export')){
 echo openssl_spki_export(preg_replace('/SPKAC=/', '', $spki)).'\n\r';
}


[2011-12-03 02:55:06] jason dot gerfen at gmail dot com

Not sure how to go about submitting a patch I am working on to address this.


[2006-09-21 23:45:19] zeph at purotesto dot it

Description:

i need openssl api support for spkac

now there's the possibility to sign a pkcs10 csr (created by explorer) but not 
an spkac created by firefox/mozilla/netscape/safary ...

check www.openca.org for more information... i need that api to create 
something similar but more usable on the GOsa project http://gosa.gonicus.de

by
Guido Serra

http://dev.purotesto.it/support/gosa
GOsa CA Management plugin







-- 
Edit this bug report at https://bugs.php.net/bug.php?id=38917edit=1


Req #38917 [Com]: OpenSSL: signing function for spkac

2011-12-06 Thread jason dot gerfen at gmail dot com
Edit report at https://bugs.php.net/bug.php?id=38917edit=1

 ID: 38917
 Comment by: jason dot gerfen at gmail dot com
 Reported by:zeph at purotesto dot it
 Summary:OpenSSL: signing function for spkac
 Status: Open
 Type:   Feature/Change Request
 Package:OpenSSL related
 Operating System:   Irrilevant
 PHP Version:4.4.4
 Block user comment: N
 Private report: N

 New Comment:

Here is a patch to implement three new functions to help with verification of 
the SPKAC HTML keygen element.

To patch:

1. Download PHP-5.3.8
2. Download patch from here (spki.patch)
3. Apply patch
% patch -p0  spki.patch
4. Configure and compiled PHP
% ./configure --with-openssl=/path/to/openssl
% make  make install

Test script:
$key = openssl_pkey_new(array('digest_alg' = 'sha1',
  'private_key_type' = OPENSSL_KEYTYPE_RSA,
  'private_key_bits' = 2048));

if (function_exists('openssl_spki_new')){
 $spki = openssl_spki_new($key, 'password');
 echo $spki.'\n\r';
}

if (function_exists('openssl_spki_verify')){
 echo openssl_spki_verify(preg_replace('/SPKAC=/', '', $spki)).'\n\r';
}

if (function_exists('openssl_spki_export')){
 echo openssl_spki_export(preg_replace('/SPKAC=/', '', $spki)).'\n\r';
}


Previous Comments:

[2011-12-03 02:55:06] jason dot gerfen at gmail dot com

Not sure how to go about submitting a patch I am working on to address this.


[2006-09-21 23:45:19] zeph at purotesto dot it

Description:

i need openssl api support for spkac

now there's the possibility to sign a pkcs10 csr (created by explorer) but not 
an spkac created by firefox/mozilla/netscape/safary ...

check www.openca.org for more information... i need that api to create 
something similar but more usable on the GOsa project http://gosa.gonicus.de

by
Guido Serra

http://dev.purotesto.it/support/gosa
GOsa CA Management plugin







-- 
Edit this bug report at https://bugs.php.net/bug.php?id=38917edit=1


Req #38917 [Com]: OpenSSL: signing function for spkac

2011-12-02 Thread jason dot gerfen at gmail dot com
Edit report at https://bugs.php.net/bug.php?id=38917edit=1

 ID: 38917
 Comment by: jason dot gerfen at gmail dot com
 Reported by:zeph at purotesto dot it
 Summary:OpenSSL: signing function for spkac
 Status: Open
 Type:   Feature/Change Request
 Package:OpenSSL related
 Operating System:   Irrilevant
 PHP Version:4.4.4
 Block user comment: N
 Private report: N

 New Comment:

Not sure how to go about submitting a patch I am working on to address this.


Previous Comments:

[2006-09-21 23:45:19] zeph at purotesto dot it

Description:

i need openssl api support for spkac

now there's the possibility to sign a pkcs10 csr (created by explorer) but not 
an spkac created by firefox/mozilla/netscape/safary ...

check www.openca.org for more information... i need that api to create 
something similar but more usable on the GOsa project http://gosa.gonicus.de

by
Guido Serra

http://dev.purotesto.it/support/gosa
GOsa CA Management plugin







-- 
Edit this bug report at https://bugs.php.net/bug.php?id=38917edit=1


Bug #55787 [Opn]: session_id() - Limits on amount session_regenerate_id() can be used with sha512

2011-09-29 Thread jason dot gerfen at gmail dot com
Edit report at https://bugs.php.net/bug.php?id=55787edit=1

 ID: 55787
 User updated by:jason dot gerfen at gmail dot com
 Reported by:jason dot gerfen at gmail dot com
 Summary:session_id() - Limits on amount
 session_regenerate_id() can be used with sha512
 Status: Open
 Type:   Bug
 Package:Session related
 Operating System:   Linux
 PHP Version:5.3.8
 Block user comment: N
 Private report: N

 New Comment:

I am familiar with the error and the thing that I find the strangest is that 
the use of echo on a session variable would prevent the second echo statement 
by producing errors.

Here in every instance any warnings and/or errors regarding the headers sent 
occurs at iteration 39 (default md5() session_id()) or iteration 19 (using 
sha512() session_id()).

I suppose the use of the @session_id() should be used while testing entropy of 
custom session_id()'s vs. the internal session.entropy_file, 
session.entropy_length and session.hash_function options?


Previous Comments:

[2011-09-29 10:59:23] matty at mattyasia dot com

This is a coding problem, not a bug. Perhaps an omission in the documentation 
though.

You can not use this function after you have sent any data to the browser.

So your problem here is that you have used echo before calling 
session_regenerate_id(), causing this error.

echo 'bTesting with PHP defaults/bbr/';
_loop(session_id(), 40, 'a');


[2011-09-26 18:29:57] jason dot gerfen at gmail dot com

Description:

I am not sure if this is a bug or a feature in terms of limits due to a test 
case exceeding internal limits.

Scenario #1.
Using session_regenerate_id() over 39 times results in the following errors:
Warning: session_regenerate_id() [function.session-regenerate-id]: Cannot 
regenerate session id - headers already sent

Scenario #2.
Using session_regenerate_id() over 19 times results in the following errors:
Warning: session_regenerate_id() [function.session-regenerate-id]: Cannot 
regenerate session id - headers already sent; when the following parameters are 
modified:
ini_set(session.entropy_file, /dev/urandom);
ini_set(session.entropy_length, 512);
ini_set(session.hash_function, sha512);


Test script:
---
session_start();

function _regenIDdef($old){
 session_regenerate_id(true);
 $_SESSION = $old;
}

function _prettyPrint($id, $i){
 echo sprintf('Iteration: %d : ID: %s = Length: %dbr/', $i, $id, 
strlen((string)$id));
}

function _collide($array){
 $x=0;
 foreach($array as $k = $v){
  if (count(in_array($v, $array))1){
   $x = $x++;
   echo sprintf('Collision found at %d session id %sbr/', $k, $v);
  }
 }
 echo sprintf('Total collisions found %dbr/', $x);
}

function _loop($id, $int){
 $a = array();
 for($i=0; $i$int; $i++){
  _regenIDdef($id);
  _prettyPrint(session_id(), $i);
  $a[$i]=session_id();
 }
 _collide($a);
}

echo 'bTesting with PHP defaults/bbr/';
_loop(session_id(), 40, 'a');

echo 'bTesting with /dev/urandom  entropy 32/bbr/';
ini_set(session.entropy_file, /dev/urandom);
ini_set(session.entropy_length, 512);
ini_set(session.hash_function, sha512);
_loop(session_id(), 20, 'a');

?

Expected result:

No errors returning about not being able to regenerate a new session_id

Actual result:
--
Warning: session_regenerate_id() [function.session-regenerate-id]: Cannot 
regenerate session id - headers already sent






-- 
Edit this bug report at https://bugs.php.net/bug.php?id=55787edit=1


[PHP-BUG] Bug #55787 [NEW]: session_id() - Limits on amount session_regenerate_id() can be used with sha512

2011-09-26 Thread jason dot gerfen at gmail dot com
From: 
Operating system: Linux
PHP version:  5.3.8
Package:  Session related
Bug Type: Bug
Bug description:session_id() - Limits on amount session_regenerate_id() can be 
used with sha512

Description:

I am not sure if this is a bug or a feature in terms of limits due to a
test case exceeding internal limits.

Scenario #1.
Using session_regenerate_id() over 39 times results in the following
errors:
Warning: session_regenerate_id() [function.session-regenerate-id]: Cannot
regenerate session id - headers already sent

Scenario #2.
Using session_regenerate_id() over 19 times results in the following
errors:
Warning: session_regenerate_id() [function.session-regenerate-id]: Cannot
regenerate session id - headers already sent; when the following parameters
are modified:
ini_set(session.entropy_file, /dev/urandom);
ini_set(session.entropy_length, 512);
ini_set(session.hash_function, sha512);


Test script:
---
session_start();

function _regenIDdef($old){
 session_regenerate_id(true);
 $_SESSION = $old;
}

function _prettyPrint($id, $i){
 echo sprintf('Iteration: %d : ID: %s = Length: %dbr/', $i, $id,
strlen((string)$id));
}

function _collide($array){
 $x=0;
 foreach($array as $k = $v){
  if (count(in_array($v, $array))1){
   $x = $x++;
   echo sprintf('Collision found at %d session id %sbr/', $k, $v);
  }
 }
 echo sprintf('Total collisions found %dbr/', $x);
}

function _loop($id, $int){
 $a = array();
 for($i=0; $i$int; $i++){
  _regenIDdef($id);
  _prettyPrint(session_id(), $i);
  $a[$i]=session_id();
 }
 _collide($a);
}

echo 'bTesting with PHP defaults/bbr/';
_loop(session_id(), 40, 'a');

echo 'bTesting with /dev/urandom  entropy 32/bbr/';
ini_set(session.entropy_file, /dev/urandom);
ini_set(session.entropy_length, 512);
ini_set(session.hash_function, sha512);
_loop(session_id(), 20, 'a');

?

Expected result:

No errors returning about not being able to regenerate a new session_id

Actual result:
--
Warning: session_regenerate_id() [function.session-regenerate-id]: Cannot
regenerate session id - headers already sent

-- 
Edit bug report at https://bugs.php.net/bug.php?id=55787edit=1
-- 
Try a snapshot (PHP 5.4):
https://bugs.php.net/fix.php?id=55787r=trysnapshot54
Try a snapshot (PHP 5.3):
https://bugs.php.net/fix.php?id=55787r=trysnapshot53
Try a snapshot (trunk):  
https://bugs.php.net/fix.php?id=55787r=trysnapshottrunk
Fixed in SVN:
https://bugs.php.net/fix.php?id=55787r=fixed
Fixed in SVN and need be documented: 
https://bugs.php.net/fix.php?id=55787r=needdocs
Fixed in release:
https://bugs.php.net/fix.php?id=55787r=alreadyfixed
Need backtrace:  
https://bugs.php.net/fix.php?id=55787r=needtrace
Need Reproduce Script:   
https://bugs.php.net/fix.php?id=55787r=needscript
Try newer version:   
https://bugs.php.net/fix.php?id=55787r=oldversion
Not developer issue: 
https://bugs.php.net/fix.php?id=55787r=support
Expected behavior:   
https://bugs.php.net/fix.php?id=55787r=notwrong
Not enough info: 
https://bugs.php.net/fix.php?id=55787r=notenoughinfo
Submitted twice: 
https://bugs.php.net/fix.php?id=55787r=submittedtwice
register_globals:
https://bugs.php.net/fix.php?id=55787r=globals
PHP 4 support discontinued:  
https://bugs.php.net/fix.php?id=55787r=php4
Daylight Savings:https://bugs.php.net/fix.php?id=55787r=dst
IIS Stability:   
https://bugs.php.net/fix.php?id=55787r=isapi
Install GNU Sed: 
https://bugs.php.net/fix.php?id=55787r=gnused
Floating point limitations:  
https://bugs.php.net/fix.php?id=55787r=float
No Zend Extensions:  
https://bugs.php.net/fix.php?id=55787r=nozend
MySQL Configuration Error:   
https://bugs.php.net/fix.php?id=55787r=mysqlcfg



Bug #29026 [Com]: Error reporting not working

2011-07-17 Thread jason at blst dot com
Edit report at https://bugs.php.net/bug.php?id=29026edit=1

 ID: 29026
 Comment by: jason at blst dot com
 Reported by:torr0101 at hotmail dot com
 Summary:Error reporting not working
 Status: Bogus
 Type:   Bug
 Package:Unknown/Other Function
 Operating System:   Windows 2003 Standard
 PHP Version:5.0.0RC3
 Block user comment: N
 Private report: N

 New Comment:

display_errors = On in php.ini


Previous Comments:

[2004-07-07 09:18:48] der...@php.net

Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at
http://www.php.net/manual/ and the instructions on how to report
a bug at http://bugs.php.net/how-to-report.php

Use error_reporting(E_ALL) and you see that it\'s not broken at all.


[2004-07-07 03:34:45] torr0101 at hotmail dot com

I switched to the mysqli extension and everything works. Still, it's strange...


[2004-07-06 02:07:51] torr0101 at hotmail dot com

Description:

I've set error_reporting to E_ALL in php.ini.  I've set the log to error_log = 
C:\Windows\php_errors.log.  Nothing happens even if I force an error.  No 
response in the browser, and no log created. phpinfo() works fine. Good code 
works. Impossible to debug without error reports, though.

Reproduce code:
---
?php 
  echo Hey;
  ougiygyug
?


Expected result:

an error

Actual result:
--
outputs Hey to the browser.






-- 
Edit this bug report at https://bugs.php.net/bug.php?id=29026edit=1


[PHP-BUG] Req #55045 [NEW]: openssl_pkcs7_sign() openssl_pkcs7_encrypt()

2011-06-13 Thread jason dot gerfen at gmail dot com
From: 
Operating system: arch linux x86_64
PHP version:  5.3.6
Package:  OpenSSL related
Bug Type: Feature/Change Request
Bug description:openssl_pkcs7_sign()  openssl_pkcs7_encrypt()

Description:

---

From manual page:
http://www.php.net/function.openssl-pkcs7-sign#Description

---

I would like to see the openssl_pkcs7_sign(), openssl_pkcs7_verify(),
openssl_pkcs7_encrypt(), openssl_pkcs7_decrypt() functions use either a
file for input  output or a string variable.



When it comes to shared hosting environments writing files is not always
available. Thanks.


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



Bug #53850 [Com]: openssl_pkey_export() with password not protecting private key

2011-03-08 Thread jason dot gerfen at gmail dot com
Edit report at http://bugs.php.net/bug.php?id=53850edit=1

 ID: 53850
 Comment by: jason dot gerfen at gmail dot com
 Reported by:jason dot gerfen at gmail dot com
 Summary:openssl_pkey_export() with password not protecting
 private key
 Status: Open
 Type:   Bug
 Package:OpenSSL related
 Operating System:   arch linux x86_64
 PHP Version:5.3.5
 Block user comment: N
 Private report: N

 New Comment:

On another note. Using strictly SSL commands to generate a new private
key using both openssl-0.9.8x  openssl-1.0.0x (installed from source)
produce a valid password protected private key.


Previous Comments:

[2011-02-16 17:19:54] jason dot gerfen at gmail dot com

Can I get an update on this status?


[2011-01-31 15:18:56] jason dot gerfen at gmail dot com

Since I have not heard anything else about this I did some digging to
try and identify the problem.



I have been adding some warning output in the
'openssl-1.0.0c/crypto/pem/pem_pkey.c' file after reviewing the the
'php-5.3.5/ext/openssl/openssl.c' file and noticing and focusing on the
calls to the OpenSSL shared objects for 'PEM_write_bio_PrivateKey()'.



When adding the warning output flags in the
'OpenSSL-1.0.0c/crypt/pem/pem_pkey.c' the password argument would always
display as '(null)'.



Correct me if I am looking the wrong spot in helping identify the
problem.


[2011-01-28 19:42:32] jason dot gerfen at gmail dot com

I have verified this under the following conditions.



Arch Linux x86_64 installation



This configuration returns a password protected private key

Apache 2.2 [./configure]

OpenSSL 0.9.8q [./config --openssldir=/usr/local/openssl-0.9.8q
--shared]

PHP 5.3.5 [./configure --with-apxs2=/usr/local/apache2/bin/apxs
--disable-cli --with-openssl=/usr/local/openssl-0.9.8q]



This configuration however does not return a password protected key

Apache 2.2 [./configure]

OpenSSL 0.9.8q [./config --openssldir=/usr/local/openssl-1.0.0c
--shared]

PHP 5.3.5 [./configure --with-apxs2=/usr/local/apache2/bin/apxs
--disable-cli --with-openssl=/usr/local/openssl-1.0.0c]



Anything else you might find pertinent?


[2011-01-26 20:12:04] paj...@php.net

There is no different code in php to deal with this function.



If two versions of openssl give you two different results then it is a
openssl 

problem, not php.



Also I would like you to test using the same PHP versions vs two
openssl, then we 

can begin to discuss a possible issue. Be sure to use the latest
versions 

available at php.net, not the centos (or any other distro) you use.


[2011-01-26 20:04:50] jason dot gerfen at gmail dot com

Description:

I have tested this against php5.3.5 with OpenSSL 1.0.0c (arch linux) vs
an older server running php5.2.14 with OpenSSL 0.9.8e (centos linux).



Test script:
---
$opts = array('config'='openssl.cnf',

  'encrypt_key'=true,

  'private_key_type'=OPENSSL_KEYTYPE_RSA,

  'digest_alg'='sha256',

  'private_key_bits'=2048,

  'x509_extensions'='usr_cert');



$handle = openssl_pkey_new($opts);

openssl_pkey_export($handle, $privatekey, sha1($_SERVER['REMOTE_ADDR']),
$opts);

echo $privatekey;



Expected result:

CentOS example output

-BEGIN RSA PRIVATE KEY-

Proc-Type: 4,ENCRYPTED

DEK-Info: DES-EDE3-CBC,C93B386451093918



buV1Kuaiu8QXhSeBdAF9Le2u+SSzaEtrHw6rLq19xL+9lWuwf4dFtrMPRI/PPvA5

HwBB7ZzT1AAzOAK2AnDiND3+n6IyqrkQjD7R0bGY6VLXdMr3qgGiJOkmsroF5t/H

LQEFGn9F8eOfEQTjkz4h9KYF/traXZSayBjNQ37fL42HO4M5WY0Ehms6bfeU5BN5

1d+NdENKLK0KVIJDNM3clQoHCc2KJwq70CeZmKq+tIG7UdigxmW0f9B/BMSM8PFx

3cFzt1eZVj23jPO65icEfqLWvdYUpOqFfZc17Si87LW8ExvO8yu4UPrk8iRR8eFH

LeOCPobR446Ehq8XBgFiFp8kzus5vDbqRLbMaBqul/mVWDmkpcyrnWJVAfginUar

FDTji8Ge8Zv5GgpuS2tjYkQpykthA17SKxDGe8s26feaHkErEanTWg5o50RP1oUo

1e2rrX+PVFoukN9f+j5OiScC8QDVfBcSZZYvfRmkE1SnF3S3CAVdtDIcqmy33WY+

Icx/n2uh3Y4tYafzSu/5O8ZeBzGUz3eKWMIAL66mxOclPAceWsQ6Ry22IBdjr+7p

Af3IKo4sWVtj3mOlrwNdNX9JtdHYiskNTVJ7+7DBlmbM+lfQlvb7wBsVek9ex6k2

qxWv250S+rdWuXBx3WuleQsQ14gBtX7Rf0Sk3DvOTinaU9C5n8xwaO9GWS0CJtjA

AkDTLZ0rylVjfdd3W7fjxfYtQEwnbKeIC1SEKuNR8tv6GXGuubU5Nt8Q5TIhZIYL

p2H027lafTE1Ky+KIRD0qZWfSEAujrxJVnH1n62edYxzWXfr+onS0g==

-END RSA PRIVATE KEY-

Actual result:
--
Arch linux sample output

-BEGIN ENCRYPTED PRIVATE KEY-

MIICxjBABgkqhkiG9w0BBQ0wMzAbBgkqhkiG9w0BBQwwDgQIkd4I9LadOsYCAggA

MBQGCCqGSIb3DQMHBAhqJEWqm0xA9ASCAoDgWeRhfyKrCqfW7aSW1rYs8LVjN3ug

p9Kn6U7YZydHwxYdwNSK80i0yw+yU

Bug #53850 [Com]: openssl_pkey_export() with password not protecting private key

2011-02-16 Thread jason dot gerfen at gmail dot com
Edit report at http://bugs.php.net/bug.php?id=53850edit=1

 ID: 53850
 Comment by: jason dot gerfen at gmail dot com
 Reported by:jason dot gerfen at gmail dot com
 Summary:openssl_pkey_export() with password not protecting
 private key
 Status: Open
 Type:   Bug
 Package:OpenSSL related
 Operating System:   arch linux x86_64
 PHP Version:5.3.5
 Block user comment: N
 Private report: N

 New Comment:

Can I get an update on this status?


Previous Comments:

[2011-01-31 15:18:56] jason dot gerfen at gmail dot com

Since I have not heard anything else about this I did some digging to
try and identify the problem.



I have been adding some warning output in the
'openssl-1.0.0c/crypto/pem/pem_pkey.c' file after reviewing the the
'php-5.3.5/ext/openssl/openssl.c' file and noticing and focusing on the
calls to the OpenSSL shared objects for 'PEM_write_bio_PrivateKey()'.



When adding the warning output flags in the
'OpenSSL-1.0.0c/crypt/pem/pem_pkey.c' the password argument would always
display as '(null)'.



Correct me if I am looking the wrong spot in helping identify the
problem.


[2011-01-28 19:42:32] jason dot gerfen at gmail dot com

I have verified this under the following conditions.



Arch Linux x86_64 installation



This configuration returns a password protected private key

Apache 2.2 [./configure]

OpenSSL 0.9.8q [./config --openssldir=/usr/local/openssl-0.9.8q
--shared]

PHP 5.3.5 [./configure --with-apxs2=/usr/local/apache2/bin/apxs
--disable-cli --with-openssl=/usr/local/openssl-0.9.8q]



This configuration however does not return a password protected key

Apache 2.2 [./configure]

OpenSSL 0.9.8q [./config --openssldir=/usr/local/openssl-1.0.0c
--shared]

PHP 5.3.5 [./configure --with-apxs2=/usr/local/apache2/bin/apxs
--disable-cli --with-openssl=/usr/local/openssl-1.0.0c]



Anything else you might find pertinent?


[2011-01-26 20:12:04] paj...@php.net

There is no different code in php to deal with this function.



If two versions of openssl give you two different results then it is a
openssl 

problem, not php.



Also I would like you to test using the same PHP versions vs two
openssl, then we 

can begin to discuss a possible issue. Be sure to use the latest
versions 

available at php.net, not the centos (or any other distro) you use.


[2011-01-26 20:04:50] jason dot gerfen at gmail dot com

Description:

I have tested this against php5.3.5 with OpenSSL 1.0.0c (arch linux) vs
an older server running php5.2.14 with OpenSSL 0.9.8e (centos linux).



Test script:
---
$opts = array('config'='openssl.cnf',

  'encrypt_key'=true,

  'private_key_type'=OPENSSL_KEYTYPE_RSA,

  'digest_alg'='sha256',

  'private_key_bits'=2048,

  'x509_extensions'='usr_cert');



$handle = openssl_pkey_new($opts);

openssl_pkey_export($handle, $privatekey, sha1($_SERVER['REMOTE_ADDR']),
$opts);

echo $privatekey;



Expected result:

CentOS example output

-BEGIN RSA PRIVATE KEY-

Proc-Type: 4,ENCRYPTED

DEK-Info: DES-EDE3-CBC,C93B386451093918



buV1Kuaiu8QXhSeBdAF9Le2u+SSzaEtrHw6rLq19xL+9lWuwf4dFtrMPRI/PPvA5

HwBB7ZzT1AAzOAK2AnDiND3+n6IyqrkQjD7R0bGY6VLXdMr3qgGiJOkmsroF5t/H

LQEFGn9F8eOfEQTjkz4h9KYF/traXZSayBjNQ37fL42HO4M5WY0Ehms6bfeU5BN5

1d+NdENKLK0KVIJDNM3clQoHCc2KJwq70CeZmKq+tIG7UdigxmW0f9B/BMSM8PFx

3cFzt1eZVj23jPO65icEfqLWvdYUpOqFfZc17Si87LW8ExvO8yu4UPrk8iRR8eFH

LeOCPobR446Ehq8XBgFiFp8kzus5vDbqRLbMaBqul/mVWDmkpcyrnWJVAfginUar

FDTji8Ge8Zv5GgpuS2tjYkQpykthA17SKxDGe8s26feaHkErEanTWg5o50RP1oUo

1e2rrX+PVFoukN9f+j5OiScC8QDVfBcSZZYvfRmkE1SnF3S3CAVdtDIcqmy33WY+

Icx/n2uh3Y4tYafzSu/5O8ZeBzGUz3eKWMIAL66mxOclPAceWsQ6Ry22IBdjr+7p

Af3IKo4sWVtj3mOlrwNdNX9JtdHYiskNTVJ7+7DBlmbM+lfQlvb7wBsVek9ex6k2

qxWv250S+rdWuXBx3WuleQsQ14gBtX7Rf0Sk3DvOTinaU9C5n8xwaO9GWS0CJtjA

AkDTLZ0rylVjfdd3W7fjxfYtQEwnbKeIC1SEKuNR8tv6GXGuubU5Nt8Q5TIhZIYL

p2H027lafTE1Ky+KIRD0qZWfSEAujrxJVnH1n62edYxzWXfr+onS0g==

-END RSA PRIVATE KEY-

Actual result:
--
Arch linux sample output

-BEGIN ENCRYPTED PRIVATE KEY-

MIICxjBABgkqhkiG9w0BBQ0wMzAbBgkqhkiG9w0BBQwwDgQIkd4I9LadOsYCAggA

MBQGCCqGSIb3DQMHBAhqJEWqm0xA9ASCAoDgWeRhfyKrCqfW7aSW1rYs8LVjN3ug

p9Kn6U7YZydHwxYdwNSK80i0yw+yU+ovVck2BdCBnm8ggdyXgS5UVTt5bnJHIHls

rEe4spLl8hkc0sOcL/ZseVBoxKIan7ZY1c0AysAwmrniFXKehSTCByDMUC58rl6H

gejVJk4+yebHuLqeq7z9d9dIvEuAFI9qjZjqUhq8wsCdN2+scFi/3/DXDp1V5/AS

SCeIsVsvcBNPaI8CYP48R13+mQJ+AGAWewcoHtwu8IQGuG46vlqOaYULCfInr/w7

/Y+Ttd2Hd6RHcnE9vTW7bhOn49v6KCtcwpcAtSz2kHrAufGxjAMzFV2oEVZPsDGM

4Rf3H1JtlJKIFYktTLoz9/07kQR0c6S1UkBa2oG

Bug #53850 [Opn]: openssl_pkey_export() with password not protecting private key

2011-01-31 Thread jason dot gerfen at gmail dot com
Edit report at http://bugs.php.net/bug.php?id=53850edit=1

 ID: 53850
 User updated by:jason dot gerfen at gmail dot com
 Reported by:jason dot gerfen at gmail dot com
 Summary:openssl_pkey_export() with password not protecting
 private key
 Status: Open
 Type:   Bug
 Package:OpenSSL related
 Operating System:   arch linux x86_64
 PHP Version:5.3.5
 Block user comment: N
 Private report: N

 New Comment:

Since I have not heard anything else about this I did some digging to
try and identify the problem.



I have been adding some warning output in the
'openssl-1.0.0c/crypto/pem/pem_pkey.c' file after reviewing the the
'php-5.3.5/ext/openssl/openssl.c' file and noticing and focusing on the
calls to the OpenSSL shared objects for 'PEM_write_bio_PrivateKey()'.



When adding the warning output flags in the
'OpenSSL-1.0.0c/crypt/pem/pem_pkey.c' the password argument would always
display as '(null)'.



Correct me if I am looking the wrong spot in helping identify the
problem.


Previous Comments:

[2011-01-28 19:42:32] jason dot gerfen at gmail dot com

I have verified this under the following conditions.



Arch Linux x86_64 installation



This configuration returns a password protected private key

Apache 2.2 [./configure]

OpenSSL 0.9.8q [./config --openssldir=/usr/local/openssl-0.9.8q
--shared]

PHP 5.3.5 [./configure --with-apxs2=/usr/local/apache2/bin/apxs
--disable-cli --with-openssl=/usr/local/openssl-0.9.8q]



This configuration however does not return a password protected key

Apache 2.2 [./configure]

OpenSSL 0.9.8q [./config --openssldir=/usr/local/openssl-1.0.0c
--shared]

PHP 5.3.5 [./configure --with-apxs2=/usr/local/apache2/bin/apxs
--disable-cli --with-openssl=/usr/local/openssl-1.0.0c]



Anything else you might find pertinent?


[2011-01-26 20:12:04] paj...@php.net

There is no different code in php to deal with this function.



If two versions of openssl give you two different results then it is a
openssl 

problem, not php.



Also I would like you to test using the same PHP versions vs two
openssl, then we 

can begin to discuss a possible issue. Be sure to use the latest
versions 

available at php.net, not the centos (or any other distro) you use.


[2011-01-26 20:04:50] jason dot gerfen at gmail dot com

Description:

I have tested this against php5.3.5 with OpenSSL 1.0.0c (arch linux) vs
an older server running php5.2.14 with OpenSSL 0.9.8e (centos linux).



Test script:
---
$opts = array('config'='openssl.cnf',

  'encrypt_key'=true,

  'private_key_type'=OPENSSL_KEYTYPE_RSA,

  'digest_alg'='sha256',

  'private_key_bits'=2048,

  'x509_extensions'='usr_cert');



$handle = openssl_pkey_new($opts);

openssl_pkey_export($handle, $privatekey, sha1($_SERVER['REMOTE_ADDR']),
$opts);

echo $privatekey;



Expected result:

CentOS example output

-BEGIN RSA PRIVATE KEY-

Proc-Type: 4,ENCRYPTED

DEK-Info: DES-EDE3-CBC,C93B386451093918



buV1Kuaiu8QXhSeBdAF9Le2u+SSzaEtrHw6rLq19xL+9lWuwf4dFtrMPRI/PPvA5

HwBB7ZzT1AAzOAK2AnDiND3+n6IyqrkQjD7R0bGY6VLXdMr3qgGiJOkmsroF5t/H

LQEFGn9F8eOfEQTjkz4h9KYF/traXZSayBjNQ37fL42HO4M5WY0Ehms6bfeU5BN5

1d+NdENKLK0KVIJDNM3clQoHCc2KJwq70CeZmKq+tIG7UdigxmW0f9B/BMSM8PFx

3cFzt1eZVj23jPO65icEfqLWvdYUpOqFfZc17Si87LW8ExvO8yu4UPrk8iRR8eFH

LeOCPobR446Ehq8XBgFiFp8kzus5vDbqRLbMaBqul/mVWDmkpcyrnWJVAfginUar

FDTji8Ge8Zv5GgpuS2tjYkQpykthA17SKxDGe8s26feaHkErEanTWg5o50RP1oUo

1e2rrX+PVFoukN9f+j5OiScC8QDVfBcSZZYvfRmkE1SnF3S3CAVdtDIcqmy33WY+

Icx/n2uh3Y4tYafzSu/5O8ZeBzGUz3eKWMIAL66mxOclPAceWsQ6Ry22IBdjr+7p

Af3IKo4sWVtj3mOlrwNdNX9JtdHYiskNTVJ7+7DBlmbM+lfQlvb7wBsVek9ex6k2

qxWv250S+rdWuXBx3WuleQsQ14gBtX7Rf0Sk3DvOTinaU9C5n8xwaO9GWS0CJtjA

AkDTLZ0rylVjfdd3W7fjxfYtQEwnbKeIC1SEKuNR8tv6GXGuubU5Nt8Q5TIhZIYL

p2H027lafTE1Ky+KIRD0qZWfSEAujrxJVnH1n62edYxzWXfr+onS0g==

-END RSA PRIVATE KEY-

Actual result:
--
Arch linux sample output

-BEGIN ENCRYPTED PRIVATE KEY-

MIICxjBABgkqhkiG9w0BBQ0wMzAbBgkqhkiG9w0BBQwwDgQIkd4I9LadOsYCAggA

MBQGCCqGSIb3DQMHBAhqJEWqm0xA9ASCAoDgWeRhfyKrCqfW7aSW1rYs8LVjN3ug

p9Kn6U7YZydHwxYdwNSK80i0yw+yU+ovVck2BdCBnm8ggdyXgS5UVTt5bnJHIHls

rEe4spLl8hkc0sOcL/ZseVBoxKIan7ZY1c0AysAwmrniFXKehSTCByDMUC58rl6H

gejVJk4+yebHuLqeq7z9d9dIvEuAFI9qjZjqUhq8wsCdN2+scFi/3/DXDp1V5/AS

SCeIsVsvcBNPaI8CYP48R13+mQJ+AGAWewcoHtwu8IQGuG46vlqOaYULCfInr/w7

/Y+Ttd2Hd6RHcnE9vTW7bhOn49v6KCtcwpcAtSz2kHrAufGxjAMzFV2oEVZPsDGM

4Rf3H1JtlJKIFYktTLoz9/07kQR0c6S1UkBa2oG/O7G0in7igzQEafKPKOMdOo3j

jP23He7kHJTTja5HE41DryUwa1JIB4L/BtbLDiYJA7KcrY7WoSROL675OmJEG1v6

vjLD0kcxIqc4rT0xesv4JEwVBxh8R/1qlqJjvLGJU8UQYWAzLqiMsg2rqrAy9XQy

Bug #53850 [Fbk-Opn]: openssl_pkey_export() with password not protecting private key

2011-01-28 Thread jason dot gerfen at gmail dot com
Edit report at http://bugs.php.net/bug.php?id=53850edit=1

 ID: 53850
 User updated by:jason dot gerfen at gmail dot com
 Reported by:jason dot gerfen at gmail dot com
 Summary:openssl_pkey_export() with password not protecting
 private key
-Status: Feedback
+Status: Open
 Type:   Bug
 Package:OpenSSL related
 Operating System:   arch linux x86_64
 PHP Version:5.3.5
 Block user comment: N
 Private report: N

 New Comment:

I have verified this under the following conditions.



Arch Linux x86_64 installation



This configuration returns a password protected private key

Apache 2.2 [./configure]

OpenSSL 0.9.8q [./config --openssldir=/usr/local/openssl-0.9.8q
--shared]

PHP 5.3.5 [./configure --with-apxs2=/usr/local/apache2/bin/apxs
--disable-cli --with-openssl=/usr/local/openssl-0.9.8q]



This configuration however does not return a password protected key

Apache 2.2 [./configure]

OpenSSL 0.9.8q [./config --openssldir=/usr/local/openssl-1.0.0c
--shared]

PHP 5.3.5 [./configure --with-apxs2=/usr/local/apache2/bin/apxs
--disable-cli --with-openssl=/usr/local/openssl-1.0.0c]



Anything else you might find pertinent?


Previous Comments:

[2011-01-26 20:12:04] paj...@php.net

There is no different code in php to deal with this function.



If two versions of openssl give you two different results then it is a
openssl 

problem, not php.



Also I would like you to test using the same PHP versions vs two
openssl, then we 

can begin to discuss a possible issue. Be sure to use the latest
versions 

available at php.net, not the centos (or any other distro) you use.


[2011-01-26 20:04:50] jason dot gerfen at gmail dot com

Description:

I have tested this against php5.3.5 with OpenSSL 1.0.0c (arch linux) vs
an older server running php5.2.14 with OpenSSL 0.9.8e (centos linux).



Test script:
---
$opts = array('config'='openssl.cnf',

  'encrypt_key'=true,

  'private_key_type'=OPENSSL_KEYTYPE_RSA,

  'digest_alg'='sha256',

  'private_key_bits'=2048,

  'x509_extensions'='usr_cert');



$handle = openssl_pkey_new($opts);

openssl_pkey_export($handle, $privatekey, sha1($_SERVER['REMOTE_ADDR']),
$opts);

echo $privatekey;



Expected result:

CentOS example output

-BEGIN RSA PRIVATE KEY-

Proc-Type: 4,ENCRYPTED

DEK-Info: DES-EDE3-CBC,C93B386451093918



buV1Kuaiu8QXhSeBdAF9Le2u+SSzaEtrHw6rLq19xL+9lWuwf4dFtrMPRI/PPvA5

HwBB7ZzT1AAzOAK2AnDiND3+n6IyqrkQjD7R0bGY6VLXdMr3qgGiJOkmsroF5t/H

LQEFGn9F8eOfEQTjkz4h9KYF/traXZSayBjNQ37fL42HO4M5WY0Ehms6bfeU5BN5

1d+NdENKLK0KVIJDNM3clQoHCc2KJwq70CeZmKq+tIG7UdigxmW0f9B/BMSM8PFx

3cFzt1eZVj23jPO65icEfqLWvdYUpOqFfZc17Si87LW8ExvO8yu4UPrk8iRR8eFH

LeOCPobR446Ehq8XBgFiFp8kzus5vDbqRLbMaBqul/mVWDmkpcyrnWJVAfginUar

FDTji8Ge8Zv5GgpuS2tjYkQpykthA17SKxDGe8s26feaHkErEanTWg5o50RP1oUo

1e2rrX+PVFoukN9f+j5OiScC8QDVfBcSZZYvfRmkE1SnF3S3CAVdtDIcqmy33WY+

Icx/n2uh3Y4tYafzSu/5O8ZeBzGUz3eKWMIAL66mxOclPAceWsQ6Ry22IBdjr+7p

Af3IKo4sWVtj3mOlrwNdNX9JtdHYiskNTVJ7+7DBlmbM+lfQlvb7wBsVek9ex6k2

qxWv250S+rdWuXBx3WuleQsQ14gBtX7Rf0Sk3DvOTinaU9C5n8xwaO9GWS0CJtjA

AkDTLZ0rylVjfdd3W7fjxfYtQEwnbKeIC1SEKuNR8tv6GXGuubU5Nt8Q5TIhZIYL

p2H027lafTE1Ky+KIRD0qZWfSEAujrxJVnH1n62edYxzWXfr+onS0g==

-END RSA PRIVATE KEY-

Actual result:
--
Arch linux sample output

-BEGIN ENCRYPTED PRIVATE KEY-

MIICxjBABgkqhkiG9w0BBQ0wMzAbBgkqhkiG9w0BBQwwDgQIkd4I9LadOsYCAggA

MBQGCCqGSIb3DQMHBAhqJEWqm0xA9ASCAoDgWeRhfyKrCqfW7aSW1rYs8LVjN3ug

p9Kn6U7YZydHwxYdwNSK80i0yw+yU+ovVck2BdCBnm8ggdyXgS5UVTt5bnJHIHls

rEe4spLl8hkc0sOcL/ZseVBoxKIan7ZY1c0AysAwmrniFXKehSTCByDMUC58rl6H

gejVJk4+yebHuLqeq7z9d9dIvEuAFI9qjZjqUhq8wsCdN2+scFi/3/DXDp1V5/AS

SCeIsVsvcBNPaI8CYP48R13+mQJ+AGAWewcoHtwu8IQGuG46vlqOaYULCfInr/w7

/Y+Ttd2Hd6RHcnE9vTW7bhOn49v6KCtcwpcAtSz2kHrAufGxjAMzFV2oEVZPsDGM

4Rf3H1JtlJKIFYktTLoz9/07kQR0c6S1UkBa2oG/O7G0in7igzQEafKPKOMdOo3j

jP23He7kHJTTja5HE41DryUwa1JIB4L/BtbLDiYJA7KcrY7WoSROL675OmJEG1v6

vjLD0kcxIqc4rT0xesv4JEwVBxh8R/1qlqJjvLGJU8UQYWAzLqiMsg2rqrAy9XQy

Eu53GLXKhKCV2NtuvVQMbvza3RajA77B2i/EEM/ORKGiDI9isHce2yM4hptggBU6

YZiqOzIcgYjo1Dv/IB069jUdxXUg874MD/MG9r1ERUsZrLX8UMyVVj7VmnH6tMsc

2S/YwCgvflRdubDEJdmTE8KUD6XSTUjhdy1Tqzzhfg3KZ8SI8Bknb4k1oV8pSAlC

9YezxiisH4FL041LpUGhj9lbvHtY+8ctxbAT35Jy6npK94rASmoOXt0TFcOJxoGn

xCZjstibMOzNSNFU8subS92Xsu9fWtEV+nCAgDOtJeMwqFNBE1g5e6JN

-END ENCRYPTED PRIVATE KEY-








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


[PHP-BUG] Bug #53850 [NEW]: openssl_pkey_export() with password not protecting private key

2011-01-26 Thread jason dot gerfen at gmail dot com
From: 
Operating system: arch linux x86_64
PHP version:  5.3.5
Package:  OpenSSL related
Bug Type: Bug
Bug description:openssl_pkey_export() with password not protecting private key

Description:

I have tested this against php5.3.5 with OpenSSL 1.0.0c (arch linux) vs an
older server running php5.2.14 with OpenSSL 0.9.8e (centos linux).



Test script:
---
$opts = array('config'='openssl.cnf',

  'encrypt_key'=true,

  'private_key_type'=OPENSSL_KEYTYPE_RSA,

  'digest_alg'='sha256',

  'private_key_bits'=2048,

  'x509_extensions'='usr_cert');



$handle = openssl_pkey_new($opts);

openssl_pkey_export($handle, $privatekey, sha1($_SERVER['REMOTE_ADDR']),
$opts);

echo $privatekey;



Expected result:

CentOS example output

-BEGIN RSA PRIVATE KEY-

Proc-Type: 4,ENCRYPTED

DEK-Info: DES-EDE3-CBC,C93B386451093918



buV1Kuaiu8QXhSeBdAF9Le2u+SSzaEtrHw6rLq19xL+9lWuwf4dFtrMPRI/PPvA5

HwBB7ZzT1AAzOAK2AnDiND3+n6IyqrkQjD7R0bGY6VLXdMr3qgGiJOkmsroF5t/H

LQEFGn9F8eOfEQTjkz4h9KYF/traXZSayBjNQ37fL42HO4M5WY0Ehms6bfeU5BN5

1d+NdENKLK0KVIJDNM3clQoHCc2KJwq70CeZmKq+tIG7UdigxmW0f9B/BMSM8PFx

3cFzt1eZVj23jPO65icEfqLWvdYUpOqFfZc17Si87LW8ExvO8yu4UPrk8iRR8eFH

LeOCPobR446Ehq8XBgFiFp8kzus5vDbqRLbMaBqul/mVWDmkpcyrnWJVAfginUar

FDTji8Ge8Zv5GgpuS2tjYkQpykthA17SKxDGe8s26feaHkErEanTWg5o50RP1oUo

1e2rrX+PVFoukN9f+j5OiScC8QDVfBcSZZYvfRmkE1SnF3S3CAVdtDIcqmy33WY+

Icx/n2uh3Y4tYafzSu/5O8ZeBzGUz3eKWMIAL66mxOclPAceWsQ6Ry22IBdjr+7p

Af3IKo4sWVtj3mOlrwNdNX9JtdHYiskNTVJ7+7DBlmbM+lfQlvb7wBsVek9ex6k2

qxWv250S+rdWuXBx3WuleQsQ14gBtX7Rf0Sk3DvOTinaU9C5n8xwaO9GWS0CJtjA

AkDTLZ0rylVjfdd3W7fjxfYtQEwnbKeIC1SEKuNR8tv6GXGuubU5Nt8Q5TIhZIYL

p2H027lafTE1Ky+KIRD0qZWfSEAujrxJVnH1n62edYxzWXfr+onS0g==

-END RSA PRIVATE KEY-

Actual result:
--
Arch linux sample output

-BEGIN ENCRYPTED PRIVATE KEY-

MIICxjBABgkqhkiG9w0BBQ0wMzAbBgkqhkiG9w0BBQwwDgQIkd4I9LadOsYCAggA

MBQGCCqGSIb3DQMHBAhqJEWqm0xA9ASCAoDgWeRhfyKrCqfW7aSW1rYs8LVjN3ug

p9Kn6U7YZydHwxYdwNSK80i0yw+yU+ovVck2BdCBnm8ggdyXgS5UVTt5bnJHIHls

rEe4spLl8hkc0sOcL/ZseVBoxKIan7ZY1c0AysAwmrniFXKehSTCByDMUC58rl6H

gejVJk4+yebHuLqeq7z9d9dIvEuAFI9qjZjqUhq8wsCdN2+scFi/3/DXDp1V5/AS

SCeIsVsvcBNPaI8CYP48R13+mQJ+AGAWewcoHtwu8IQGuG46vlqOaYULCfInr/w7

/Y+Ttd2Hd6RHcnE9vTW7bhOn49v6KCtcwpcAtSz2kHrAufGxjAMzFV2oEVZPsDGM

4Rf3H1JtlJKIFYktTLoz9/07kQR0c6S1UkBa2oG/O7G0in7igzQEafKPKOMdOo3j

jP23He7kHJTTja5HE41DryUwa1JIB4L/BtbLDiYJA7KcrY7WoSROL675OmJEG1v6

vjLD0kcxIqc4rT0xesv4JEwVBxh8R/1qlqJjvLGJU8UQYWAzLqiMsg2rqrAy9XQy

Eu53GLXKhKCV2NtuvVQMbvza3RajA77B2i/EEM/ORKGiDI9isHce2yM4hptggBU6

YZiqOzIcgYjo1Dv/IB069jUdxXUg874MD/MG9r1ERUsZrLX8UMyVVj7VmnH6tMsc

2S/YwCgvflRdubDEJdmTE8KUD6XSTUjhdy1Tqzzhfg3KZ8SI8Bknb4k1oV8pSAlC

9YezxiisH4FL041LpUGhj9lbvHtY+8ctxbAT35Jy6npK94rASmoOXt0TFcOJxoGn

xCZjstibMOzNSNFU8subS92Xsu9fWtEV+nCAgDOtJeMwqFNBE1g5e6JN

-END ENCRYPTED PRIVATE KEY-



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



Bug #40286 [Com]: PHP fastcgi with PHP_FCGI_CHILDREN don't kill children when parent is killed

2010-10-18 Thread jason at backup-technology dot co dot uk
Edit report at http://bugs.php.net/bug.php?id=40286edit=1

 ID: 40286
 Comment by: jason at backup-technology dot co dot uk
 Reported by:gabriel at oxeva dot fr
 Summary:PHP fastcgi with PHP_FCGI_CHILDREN don't kill
 children when parent is killed
 Status: No Feedback
 Type:   Bug
 Package:CGI related
 Operating System:   Linux 2.6
 PHP Version:5.2.0+
 Assigned To:dmitry
 Block user comment: N

 New Comment:

We're experiencing this issue with 5.2.14 and also 5.3.3.



On 5.2.14 the strace of the hanging processes with parent ID 1 left
behind show this:



Process 21330 attached - interrupt to quit

accept(0,  



It hangs on that and if we interrupt it shows:



Process 21330 attached - interrupt to quit

accept(0,  unfinished ...



Running a gdb (with debug symbols) and attaching to the process and
running bt we get:



(gdb) bt

#0  0x00320c8d4530 in __accept_nocancel () from /lib64/libc.so.6

#1  0x0062abe8 in fcgi_accept_request (req=0x7fff3cb385b0) at
/usr/src/debug/php-5.2.14/sapi/cgi/fastcgi.c:957

#2  0x0062c14f in main (argc=1, argv=0x7fff3cb3a758) at
/usr/src/debug/php-5.2.14/sapi/cgi/cgi_main.c:1703



On the 5.3.3 (with no debug symbols) we have the following:



(gdb) bt

#0  0x0038936d4530 in __accept_nocancel () from /lib64/libc.so.6

#1  0x0063e0c3 in ?? ()

#2  0x0063ad2a in ?? ()

#3  0x00389361d994 in __libc_start_main () from /lib64/libc.so.6

#4  0x00421ec9 in _start ()



Hope this helps.



Jason.


Previous Comments:

[2009-07-26 21:55:21] machochito at gmail dot com

I have the same problem on CentOS 5.3 with php 5.2.9.

Have someone solution to this problem?

Thanks.


[2009-07-22 20:45:21] bgross at mcw dot edu

... on second thought, after looking at my php.ini again, I think the 

major change was due to adding the line session.gc_probability = 1. I


believe this is set to session.gc_probability = 0 by default in Debian


[2009-07-22 20:14:41] bgross at mcw dot edu

I'm not familiar with the inner-workings PHP, so I'm sorry if this is 

not relevant.



I was experiencing a problem with php-cgi processes staying around and 

filling up my memory. After I added the line cgi.fix_pathinfo=1 to my


php.ini, the problem went away.



I'm using PHP FastCGI 5.2.6 with Lighttpd 1.4.19 on Debian 5.0.2



Hope that's helpful


[2009-07-02 03:41:27] porjo38 at yahoo dot com dot au

The php 5.3.0 changelog states the following:



Fixed bug #40286 (PHP fastcgi with PHP_FCGI_CHILDREN don't kill
children when parent is killed). (Dmitry)



I've just compiled php 5.3.0 under Centos5.3 with Apache2.2.3 +
mod_fcgid2.2-4.



The issue is still occuring for me. When I restart Apache, I usually end
up with a bunch of php-cgi process with ppid of 1 (init), although it
doesn't happen every time.


[2009-05-16 03:43:15] scripts at topducks dot com

I'm using php5.2.9 mod_fcgid, not using children method.

Whenever I restart apache I get orphaned php processes.

Without the cron job to check and kill them off they would waste a lot
of memory.




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/bug.php?id=40286


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


[PHP-BUG] Bug #52867 [NEW]: array_intersect_ukey does not check all keys

2010-09-16 Thread jason at linuxbox dot com
From: 
Operating system: Linux
PHP version:  5.3.3
Package:  Arrays related
Bug Type: Bug
Bug description:array_intersect_ukey does not check all keys

Description:

The array_intersect_ukey() function appears to have an invalid algorithm
for 

iterating over array keys to be passed to the user function.  A simple test
case 

that implements the same behavior as array_intersect_key() illustrates the
bug.

Test script:
---
?php

function func($key1, $key2) {

  if ($key1 == $key2) {

return 0;

  }

  return 1;

} 



$all = array('cat' = 'brown',

  'dog' = 'yellow',

  'mouse' = 'grey',

  'horse' = 'white'

);



$keep = array('dog' = 1, 'horse' = 1);



// Output of the following should be identical

print_r(array_intersect_key($all, $keep));

print_r(array_intersect_ukey($all, $keep, 'func'));

?

Expected result:

Array

(

[dog] = yellow

[horse] = white

)

Array

(

[dog] = yellow

[horse] = white

)

Actual result:
--
Array

(

[dog] = yellow

[horse] = white

)

Array

(

)

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



Bug #52500 [Bgs]: Using array_map, strip tags nested $_POST array

2010-07-31 Thread jason dot gerfen at gmail dot com
Edit report at http://bugs.php.net/bug.php?id=52500edit=1

 ID: 52500
 User updated by:jason dot gerfen at gmail dot com
 Reported by:jason dot gerfen at gmail dot com
 Summary:Using array_map, strip tags  nested $_POST array
 Status: Bogus
 Type:   Bug
 Package:Scripting Engine problem
 Operating System:   Ubuntu 10
 PHP Version:5.2.14
 Block user comment: N

 New Comment:

Thanks. I suppose I thought array_map should work recursively.


Previous Comments:

[2010-07-31 10:59:56] johan...@php.net

Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at
http://www.php.net/manual/ and the instructions on how to report
a bug at http://bugs.php.net/how-to-report.php

this call strip_tags in a way similar to this:





strip_tags(array('level-2-1', $var1,

  'level-2-2', $var2,

  'level-2-3', $var3));



which gives an unexpected result.



what you need is wrapper handling the recusrion similar to



function strip_tags_recursive($data) {

 if (is_array($data)) {

 return array_map('strip_tags_recursive', $data);

 } else {

 return strip_tags($data);

 }

}



$myget = strip_tags_recursive($_GET);



While all this isuntested but shouldgive you the idea.


[2010-07-30 15:33:55] jason dot gerfen at gmail dot com

Description:

When using a combination of array_map()  strip_tags to create a
localized copy of the $_POST superglobal array I am experiencing
problems if $_POST contains a nested array.



It seems to discard any secondary iteration of said nested array.

Test script:
---
$_POST = array('level-1-1', $var1,

   'level-1-2', $var2,

   'level-1-3', $var3,

   'level-1-4', array('level-2-1', $var1,

  'level-2-2', $var2,

  'level-2-3', $var3),

   'level-1-5', $var5);



$post = array_map(strip_tags, $_POST);



echo 'pre'; print_r($post); echo '/pre';



/* I am left with this?

level-1-1 = $var1

level-1-2 = $var2

level-1-3 = $var3

level-1-5 = $var5

*/

Expected result:

I expected a complete copy of the nested superglobal $_POST.

Actual result:
--
Any nested array information is getting stripped out.






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


[PHP-BUG] Bug #52500 [NEW]: Using array_map, strip tags nested $_POST array

2010-07-30 Thread jason dot gerfen at gmail dot com
From: 
Operating system: Ubuntu 10
PHP version:  5.2.14
Package:  Scripting Engine problem
Bug Type: Bug
Bug description:Using array_map, strip tags  nested $_POST array

Description:

When using a combination of array_map()  strip_tags to create a localized
copy of the $_POST superglobal array I am experiencing problems if $_POST
contains a nested array.



It seems to discard any secondary iteration of said nested array.

Test script:
---
$_POST = array('level-1-1', $var1,

   'level-1-2', $var2,

   'level-1-3', $var3,

   'level-1-4', array('level-2-1', $var1,

  'level-2-2', $var2,

  'level-2-3', $var3),

   'level-1-5', $var5);



$post = array_map(strip_tags, $_POST);



echo 'pre'; print_r($post); echo '/pre';



/* I am left with this?

level-1-1 = $var1

level-1-2 = $var2

level-1-3 = $var3

level-1-5 = $var5

*/

Expected result:

I expected a complete copy of the nested superglobal $_POST.

Actual result:
--
Any nested array information is getting stripped out.

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



[PHP-BUG] Bug #52143 [NEW]: strtotime() unexpectedly changed from 5.2.13 to 5.3.2 breaking alot of scripts

2010-06-22 Thread jason dot woods at blueyonder dot co dot uk
From: 
Operating system: CentOS 5.5 x86_64
PHP version:  5.3.2
Package:  Date/time related
Bug Type: Bug
Bug description:strtotime() unexpectedly changed from 5.2.13 to 5.3.2 breaking 
alot of scripts

Description:

In version 5.2.13 the following code:

?php

echo ($now = strtotime('+1 day')) . ' - ' . date('d-m-Y H.i.s', $now) .
\n;

echo ($last = strtotime('last week', $now)) . ' - ' . date('d-m-Y H.i.s',
$last) . \n;

echo ($next = strtotime('+1 week', $last)) . ' - ' . date('d-m-Y H.i.s',
$next) . \n;

?



Gives the following result:

1277283067 - 23-06-2010 09.51.07

1276678267 - 16-06-2010 09.51.07

1277283067 - 23-06-2010 09.51.07



That is, first line is current time.

Second time is last week, otherwise known as -1 week.

Third time is +1 week, which reverses the change that the -1 week did.



However, this changed in 5.3.2 and it now gives the following result:

1277281904 - 23-06-2010 09.31.44

1276504304 - 14-06-2010 09.31.44

1277109104 - 21-06-2010 09.31.44



So it appears last week is no longer the equivalent of -1 week.



Is this a deliberate change or something that was broken in 5.3.2?



I have been unable to test other versions and can only give you the
difference from 5.2.13 and 5.3.2.



Thanks.

Test script:
---
?php

echo ($now = strtotime('+1 day')) . ' - ' . date('d-m-Y H.i.s', $now) .
\n;

echo ($last = strtotime('last week', $now)) . ' - ' . date('d-m-Y H.i.s',
$last) . \n;

echo ($next = strtotime('+1 week', $last)) . ' - ' . date('d-m-Y H.i.s',
$next) . \n;

?

Expected result:

1277283067 - 23-06-2010 09.51.07

1276678267 - 16-06-2010 09.51.07

1277283067 - 23-06-2010 09.51.07

Actual result:
--
1277281904 - 23-06-2010 09.31.44

1276504304 - 14-06-2010 09.31.44

1277109104 - 21-06-2010 09.31.44

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



Bug #41631 [Com]: default_socket_timeout does not work with SSL

2010-03-15 Thread jason at kapoks dot co dot uk
Edit report at http://bugs.php.net/bug.php?id=41631edit=1

 ID:   41631
 Comment by:   jason at kapoks dot co dot uk
 Reported by:  david at acz dot org
 Summary:  default_socket_timeout does not work with SSL
 Status:   Assigned
 Type: Bug
 Package:  OpenSSL related
 Operating System: *
 PHP Version:  5.2.11
 Assigned To:  pajoye

 New Comment:

Had this issue over the weekend with 5.2.10.

Essentially this means our entire service is vulnerable to Denial of
Service.



Linux localhost.localdomain 2.6.18-164.el5 #1 SMP Thu Sep 3 03:33:56 EDT
2009 i686 i686 i386 GNU/Linux



CentOS release 5.3 (Final)



PHP 5.2.10 (cli) (built: Jun 21 2009 11:10:43)

Copyright (c) 1997-2009 The PHP Group

Zend Engine v2.2.0, Copyright (c) 1998-2009 Zend Technologies

with Zend Extension Manager v1.2.2, Copyright (c) 2003-2007, by Zend
Technologies

with Zend Optimizer v3.3.3, Copyright (c) 1998-2007, by Zend
Technologies


Previous Comments:

[2010-01-18 19:16:42] wdierkes at 5dollarwhitebox dot org

This is also reproducible on 5.2.12 as described.  As mentioned 

previously, this has the potentially to have major effects (Denial of 

Servide) etc due to processes hanging and never timing out.  



# cat /etc/redhat-release 

Red Hat Enterprise Linux Server release 5.4 (Tikanga)



# php -v

PHP 5.2.12 (cli) (built: Dec 17 2009 12:23:35) 

Copyright (c) 1997-2009 The PHP Group

Zend Engine v2.2.0, Copyright (c) 1998-2009 Zend Technologies



# uname -a

Linux linux 2.6.18-164.el5 #1 SMP Tue Aug 18 15:51:48 EDT 2009 x86_64 

x86_64 x86_64 GNU/Linux


[2009-10-16 20:14:25] arkadi dot shishlov at gmail dot com

At least it would be helpful to set TCP keep-alive on socket so OS could
timeout it eventually, otherwise there are connections stuck for days.


[2009-09-24 19:30:14] srina...@php.net

bug #48524 depends on this fix
(http://bugs.php.net/bug.php?id=48524edit=1)



i wish , bug tracking system allowed to be able to close a bug as
duplicate of another. then, we could close 48524 as dup of this (41631).
this can also trigger the internal score for this bug to be increased
(helping in set priority etc). 


[2009-09-18 10:10:02] marcin at php4u dot co dot uk

Still can reproduce on Windows XP SP3, PHP 5.2.6



while connecting to https, script doesn't time out


[2009-07-22 03:24:17] vergara_rh at yahoo dot com

I would greatly appreciate if this bug will be fix.




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/bug.php?id=41631


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


#50737 [Bgs]: stream_set_blocking creates high cpu usage

2010-01-15 Thread jason at lentink dot net
 ID:   50737
 User updated by:  jason at lentink dot net
 Reported By:  jason at lentink dot net
 Status:   Bogus
 Bug Type: Streams related
 Operating System: Linux
 PHP Version:  5.2.12
 New Comment:

Then we go back to the first post and there is a 2 line example of the

problem.

Reproduce code:
---
?php
$socket = fsockopen(somehost, 631313, $errno, $errstr);
stream_set_blocking($socket, 0); // non blocking

this is enough to trigger the problem.
I hope this is short enough.


Previous Comments:


[2010-01-15 08:56:36] j...@php.net

Strike 3. As long as you can not provide a short reproducing script
(like described in my first comment to this report) the bug is most
likely something you did wrong.



[2010-01-14 12:53:42] jason at lentink dot net

Whatever you want :)

http://www.grasvezel.nl/media/software/cpuload.txt

Here is a complete undressed file which only has the problem.



[2010-01-14 12:17:19] j...@php.net

I asked for small, complete script NOT for a framework.



[2010-01-14 12:13:36] jason at lentink dot net

I could provide you guys with a small script
bug i can also point you to the place where the problem exists since 
it happens in Zend Framework.

http://framework.zend.com/svn/framework/standard/trunk/library/Zend/Queu
e/Stomp/Client/Connection.php

The function is used at line 79. What i see on my servers is that when

there are simultaneous request made to the same script the problem 
increases more rapidly.



[2010-01-13 12:07:10] j...@php.net

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 ?php and ends with ?,
is max. 10-20 lines long and does not require any external 
resources such as databases, etc. If the script requires a 
database to demonstrate the issue, please make sure it creates 
all necessary tables, stored procedures etc.

Please avoid embedding huge scripts into the report.





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

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



#50737 [Fbk-Opn]: stream_set_blocking creates high cpu usage

2010-01-14 Thread jason at lentink dot net
 ID:   50737
 User updated by:  jason at lentink dot net
 Reported By:  jason at lentink dot net
-Status:   Feedback
+Status:   Open
 Bug Type: Streams related
 Operating System: Linux
 PHP Version:  5.2.12
 New Comment:

I could provide you guys with a small script
bug i can also point you to the place where the problem exists since 
it happens in Zend Framework.

http://framework.zend.com/svn/framework/standard/trunk/library/Zend/Queu
e/Stomp/Client/Connection.php

The function is used at line 79. What i see on my servers is that when

there are simultaneous request made to the same script the problem 
increases more rapidly.


Previous Comments:


[2010-01-13 12:07:10] j...@php.net

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 ?php and ends with ?,
is max. 10-20 lines long and does not require any external 
resources such as databases, etc. If the script requires a 
database to demonstrate the issue, please make sure it creates 
all necessary tables, stored procedures etc.

Please avoid embedding huge scripts into the report.





[2010-01-13 09:58:52] jason at lentink dot net

Description:

When using stream_set_blocking on a stream will create a huge load on 
cpu. When using this function it uses up to 50% of the cpu. When not 
using this function it will only use 0.1% cpu usage.

Reproduce code:
---
$this-_socket = fsockopen($str, $port, $errno, $errstr);
stream_set_blocking($this-_socket, 0); // non blocking

Expected result:

An socket which will be opened fast. in a non-blocking mode.

Actual result:
--
An open socket. But the cpu use is enormous.





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



#50737 [Fbk-Opn]: stream_set_blocking creates high cpu usage

2010-01-14 Thread jason at lentink dot net
 ID:   50737
 User updated by:  jason at lentink dot net
 Reported By:  jason at lentink dot net
-Status:   Feedback
+Status:   Open
 Bug Type: Streams related
 Operating System: Linux
 PHP Version:  5.2.12
 New Comment:

Whatever you want :)

http://www.grasvezel.nl/media/software/cpuload.txt

Here is a complete undressed file which only has the problem.


Previous Comments:


[2010-01-14 12:17:19] j...@php.net

I asked for small, complete script NOT for a framework.



[2010-01-14 12:13:36] jason at lentink dot net

I could provide you guys with a small script
bug i can also point you to the place where the problem exists since 
it happens in Zend Framework.

http://framework.zend.com/svn/framework/standard/trunk/library/Zend/Queu
e/Stomp/Client/Connection.php

The function is used at line 79. What i see on my servers is that when

there are simultaneous request made to the same script the problem 
increases more rapidly.



[2010-01-13 12:07:10] j...@php.net

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 ?php and ends with ?,
is max. 10-20 lines long and does not require any external 
resources such as databases, etc. If the script requires a 
database to demonstrate the issue, please make sure it creates 
all necessary tables, stored procedures etc.

Please avoid embedding huge scripts into the report.





[2010-01-13 09:58:52] jason at lentink dot net

Description:

When using stream_set_blocking on a stream will create a huge load on 
cpu. When using this function it uses up to 50% of the cpu. When not 
using this function it will only use 0.1% cpu usage.

Reproduce code:
---
$this-_socket = fsockopen($str, $port, $errno, $errstr);
stream_set_blocking($this-_socket, 0); // non blocking

Expected result:

An socket which will be opened fast. in a non-blocking mode.

Actual result:
--
An open socket. But the cpu use is enormous.





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



#50737 [NEW]: stream_set_blocking creates high cpu usage

2010-01-13 Thread jason at lentink dot net
From: jason at lentink dot net
Operating system: Linux
PHP version:  5.2.12
PHP Bug Type: Sockets related
Bug description:  stream_set_blocking creates high cpu usage

Description:

When using stream_set_blocking on a stream will create a huge load on 
cpu. When using this function it uses up to 50% of the cpu. When not 
using this function it will only use 0.1% cpu usage.

Reproduce code:
---
$this-_socket = fsockopen($str, $port, $errno, $errstr);
stream_set_blocking($this-_socket, 0); // non blocking

Expected result:

An socket which will be opened fast. in a non-blocking mode.

Actual result:
--
An open socket. But the cpu use is enormous.

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



#49267 [Com]: Linking fails for iconv: Undefined symbols: _libiconv

2009-09-11 Thread jason at dajaney dot com
 ID:   49267
 Comment by:   jason at dajaney dot com
 Reported By:  s dot rost at ewerk dot com
 Status:   Assigned
 Bug Type: Compile Failure
 Operating System: Mac OSX 10.6 Snow Leopard
 PHP Version:  5.3, 6 (2009-08-18)
 Assigned To:  scottmac
 New Comment:

I am also experiencing this same issue on my new mac, running 10.6.

Keep this alive with any updates. 

Undefined symbols:
  _libiconv_open, referenced from:
  _do_convert in gdkanji.o
  _libiconv, referenced from:
  _do_convert in gdkanji.o
  _libiconv_close, referenced from:
  _do_convert in gdkanji.o
ld: symbol(s) not found
collect2: ld returned 1 exit status
make: *** [libs/libphp5.bundle] Error 1

The above was trying my last ditch effort to have --without-iconv in
the ./configure statement. 

Jason


Previous Comments:


[2009-09-09 20:34:20] rickdunn at chez dot com

For what it's worth, this is probably the same iconv issue that has 
already popped up in bug #43189 and bug #48195.



[2009-09-09 13:30:41] aoyagi dot kouhei at gmail dot com

SnowLeopard
PHP-5.3.1RC1

ext/iconv/iconv.c

#ifdef HAVE_LIBICONV
#define iconv libiconv
#endif

to 

#ifdef HAVE_LIBICONV
#define iconv iconv
#endif

./configure --prefix=/opt/php-5.3.1RC1 --enable-zip
--with-apxs2=/opt/httpd/bin/apxs --with-bz2 --enable-calendar
--with-curl --with-gd --enable-gd-native-ttf --enable-gd-jis-conv 
--enable-mbstring --with-pdo-pgsql=/opt/postgresql
--with-pgsql=/opt/postgresql --enable-soap --enable-sockets
--with-jpeg-dir=/opt/jpeg --with-png-dir=/opt/libpng
--with-freetype-dir=/opt/freetype --with-zlib
--with-libxml-dir=/opt/libxml2 --with-xsl=/opt/libxslt
--with-readline=/opt/readline --with-gettext=/opt/gettext
--with-iconv-dir=/opt/libiconv

make

Undefined symbols:
  _libiconv_open, referenced from:
  _do_convert in gdkanji.o
  _libiconv, referenced from:
  _do_convert in gdkanji.o
  _libiconv_close, referenced from:
  _do_convert in gdkanji.o
ld: symbol(s) not found
collect2: ld returned 1 exit status
make: *** [libs/libphp5.bundle] Error 1



[2009-09-09 13:29:03] alexandre dot morgaut at 4d dot fr

the tip of notfornoone worked for me 
but I still have a problem with buildconf :

sh-3.2# ./buildconf --force
Forcing buildconf
buildconf: checking installation...
buildconf: autoconf version 2.61 (ok)
buildconf: Your version of autoconf likely contains buggy cache code.
   Running vcsclean for you.
   To avoid this, install autoconf-2.13.
Can't figure out your VCS, not cleaning.

I didn't change autoconf, so I imagine snow leopard did..



[2009-09-08 00:45:55] notfornoone at gmail dot com

The instructions in the first comment worked for me, here is what I did
to successfully install php-5.3.1RC1 on Snow Leopard. This also worked
for php-5.2.11RC1 on Snow Leopard.

1.
I changed ext/iconv/iconv.c as per the first comment on this bug.

On line 185 change

#ifdef HAVE_LIBICONV
#define iconv libiconv
#endif

to 

#ifdef HAVE_LIBICONV
#define iconv iconv
#endif


2.
Run configure
./configure --prefix=/usr/local/php/5.3.1RC1
--with-apxs2=/usr/sbin/apxs


I found that after changing the iconv.c file I did not need to add
-lsresolv to EXTRA_LIBS



[2009-09-06 03:47:43] me at sleepycode dot com

I have the same issue as well with Snow Leopard and any version of PHP
I try.
I have built my own libiconv and this made little difference.

My configure line:

./configure --prefix=/home/software/php/v5 \
--sysconfdir=/etc \
--localstatedir=/var \
--mandir=/usr/share/man \
--with-mysql=mysqlnd \
--with-mysqli=mysqlnd \
--with-pdo-mysql=mysqlnd \
--with-apxs2=/home/software/apache/bin/apxs \
--enable-maintainer-zts \
--with-zlib-dir=/home/software/zlib \
--with-pgsql=/home/software/postgresql \
--enable-mbstring \
--with-gd \
--with-png-dir=/home/software/libpng \
--with-iconv=/home/software/iconv


The build error during make:

Undefined symbols:
  _libiconv_open, referenced from:
  _do_convert in gdkanji.o
  _php_iconv_string in iconv.o
  __php_iconv_strlen in iconv.o
  __php_iconv_substr in iconv.o
  __php_iconv_substr in iconv.o
  __php_iconv_strpos in iconv.o
  __php_iconv_mime_encode in iconv.o
  __php_iconv_mime_encode in iconv.o
  __php_iconv_mime_decode in iconv.o
  __php_iconv_mime_decode in iconv.o
  _php_iconv_stream_filter_ctor in iconv.o
  _libiconv, referenced from:
  _do_convert in gdkanji.o
  _libiconv_close, referenced from:
  _do_convert in gdkanji.o
  _php_iconv_string in iconv.o
  __php_iconv_strlen in iconv.o
  __php_iconv_substr in iconv.o

#49007 [NEW]: add a third parameter to ltrim: limit

2009-07-21 Thread jason at jasonsw dot com
From: jason at jasonsw dot com
Operating system: Debian/Linux
PHP version:  5.3.0
PHP Bug Type: Feature/Change Request
Bug description:  add a third parameter to ltrim: limit

Description:

It would be great if there was a way to limit the amount of characters
that were trimmed from a string, in either ltrim, trim or rtrim, using a
new limit parameter.

Reproduce code:
---
---
From manual page: function.ltrim
---



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



#48841 [NEW]: A tab inside ob_start using Eclipse IDE causes a glitch when sending HTML email

2009-07-07 Thread jason dot anderson at abcphones dot com
From: jason dot anderson at abcphones dot com
Operating system: Windows XP
PHP version:  5.3.0
PHP Bug Type: Unknown/Other Function
Bug description:  A tab inside ob_start using Eclipse IDE causes a glitch when 
sending HTML email

Description:

Using a text editor (Eclipse) for PHP the attached code will not work
properly when a tab is typed inside of the ob_start() section.  No errors
are reported but when the HTML email is received it is represented as raw
text including the header data.  Debugging for this in such case can be
very very difficult.

Reproduce code:
---
function test_html_email(){
$to = 'jason.ander...@abcphones.com';
$subject = 'My Code';
$random_hash = md5(date('r', time()));
$headers = From: ad...@pgxgolf.com\r\nreply-to: ad...@pgxgolf.com;
$headers .= \r\nContent-Type: multipart/alternative;
boundary=\PHP-alt-.$random_hash.\;
ob_start(); //Turn on output buffering  - Notice tabs below
?  --PHP-alt-?php echo $random_hash; ? 
Content-Type: text/plain; charset=iso-8859-1
Content-Transfer-Encoding: 7bit

Hello World!!! 
This is simple text email message.

--PHP-alt-?php echo $random_hash; ? 
Content-Type: text/html; charset=iso-8859-1
Content-Transfer-Encoding: 7bit

h2Hello World!/h2
pThis is something with bHTML/b formatting./p

--PHP-alt-?php echo $random_hash; ?--
?php $message = ob_get_clean();
ob_end_flush();
$mail_sent = @mail( $to, $subject, $message, $headers );
echo $mail_sent ? Mail sent : Mail failed;
}
test_html_email();

Expected result:

Hello World!
This is something with HTML formatting.


Actual result:
--
--PHP-alt-527d2deecd08a0f3e80bced5cace8aaa 
Content-Type: text/plain; charset=iso-8859-1
Content-Transfer-Encoding: 7bit

Hello World!!! 
This is simple text email message.

--PHP-alt-527d2deecd08a0f3e80bced5cace8aaa 
Content-Type: text/html; charset=iso-8859-1
Content-Transfer-Encoding: 7bit

h2Hello World!/h2
pThis is something with bHTML/b formatting./p

--PHP-alt-527d2deecd08a0f3e80bced5cace8aaa--


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



#48526 [Com]: When using the b flag i get a error: Warning: fopen(/tmp/12/foo2.txt

2009-06-12 Thread jason at ovitech dot nl
 ID:   48526
 Comment by:   jason at ovitech dot nl
 Reported By:  jason at ovitech dot nl
 Status:   Feedback
 Bug Type: Filesystem function related
 Operating System: OSX
 PHP Version:  5.2.9
 New Comment:

No I did not. Now I have and it seems to work.
But what is the difference? shouldn't have work anyway since these are
just flags you pass to the function?


Previous Comments:


[2009-06-11 20:22:53] ka...@php.net

Without looking deeply into this, have you tried with fopen(..., 'wb')
instead of bw ?



[2009-06-11 09:26:56] jason at ovitech dot nl

Description:

When I open a file with the b flag in it. for example bw I get the
error that the file does not exists. That is correct and I want fopen to
create the file for me and set the pointer on the beginning of the code.
that is why I use the w flag. I have used the b flag because of the note
that is underneath the fopen manual file on the site./

Reproduce code:
---
$fp = fopen($this-_file, bw);

Expected result:

A new file created in /tmp/12 called foo2.txt

Actual result:
--
Warning: fopen(/tmp/12/foo2.txt) [function.fopen]: failed to open
stream: No such file or directory in /Users/jason/Sites/zf/myclass.php
on line 168





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



#48526 [NEW]: When using the b flag i get a error: Warning: fopen(/tmp/12/foo2.txt

2009-06-11 Thread jason at ovitech dot nl
From: jason at ovitech dot nl
Operating system: OSX
PHP version:  5.2.9
PHP Bug Type: Filesystem function related
Bug description:  When using the b flag i get a error: Warning: 
fopen(/tmp/12/foo2.txt

Description:

When I open a file with the b flag in it. for example bw I get the error
that the file does not exists. That is correct and I want fopen to create
the file for me and set the pointer on the beginning of the code. that is
why I use the w flag. I have used the b flag because of the note that is
underneath the fopen manual file on the site./

Reproduce code:
---
$fp = fopen($this-_file, bw);

Expected result:

A new file created in /tmp/12 called foo2.txt

Actual result:
--
Warning: fopen(/tmp/12/foo2.txt) [function.fopen]: failed to open stream:
No such file or directory in /Users/jason/Sites/zf/myclass.php on line 168

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



#47270 [Bgs]: Invalid email address allowed as valid

2009-02-02 Thread jason at netmums dot com
 ID:   47270
 User updated by:  jason at netmums dot com
 Reported By:  jason at netmums dot com
 Status:   Bogus
 Bug Type: Filter related
 Operating System: RHEL 5.3
 PHP Version:  5.2.8
 New Comment:

Thanks, perhaps a flag could be added to test against valid public TLDs

supported by IANA versus technically valid internal addresses?


Previous Comments:


[2009-02-02 14:23:26] johan...@php.net

Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at
http://www.php.net/manual/ and the instructions on how to report
a bug at http://bugs.php.net/how-to-report.php

That domain might exist at your network.



[2009-02-02 09:44:42] jason at netmums dot com

Description:

An email address is submitted to filter_var and returned as valid 
despite the domain being invalid. There are no single character top-
level domains.

Reproduce code:
---
$email = 'testu...@hotmail.co.u';
if (filter_var($email, FILTER_VALIDATE_EMAIL) === false) {
echo Invalid email address.;
} else {
echo Valid email address.;
}



Expected result:

Invalid email address.

Actual result:
--
Valid email address.





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



#47270 [NEW]: Invalid email address allowed as valid

2009-02-02 Thread jason at netmums dot com
From: jason at netmums dot com
Operating system: RHEL 5.3
PHP version:  5.2.8
PHP Bug Type: Filter related
Bug description:  Invalid email address allowed as valid

Description:

An email address is submitted to filter_var and returned as valid 
despite the domain being invalid. There are no single character top-
level domains.

Reproduce code:
---
$email = 'testu...@hotmail.co.u';
if (filter_var($email, FILTER_VALIDATE_EMAIL) === false) {
echo Invalid email address.;
} else {
echo Valid email address.;
}



Expected result:

Invalid email address.

Actual result:
--
Valid email address.

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



#46111 [NEW]: strtotime() returns false for some valid timezones

2008-09-18 Thread jason at eventshop dot com dot au
From: jason at eventshop dot com dot au
Operating system: Windows XP
PHP version:  5.2.6
PHP Bug Type: Date/time related
Bug description:  strtotime() returns false for some valid timezones

Description:

When converting a date/time/timezone string using strtotime(), it returns
false for several of the supposedly valid timezones, such as
Adelaide/ACT, Israel, US/Arizona, etc.

All other timezones work correctly.

Reproduce code:
---
$timezones = timezone_identifiers_list();

foreach ($timezones as $zone) {
$date_string = 2008-01-01 13:00:00  . $zone;

if (!strtotime($date_string)) {
echo br /  . $zone;
}
}

Expected result:

No result should be displayed.

Actual result:
--
Africa/Dar_es_Salaam
Africa/Porto-Novo
America/Argentina/ComodRivadavia
America/Blanc-Sablon
... etc ...
US/Pacific
US/Pacific-New
US/Samoa
W-SU
Zulu

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



#44098 [Com]: imap_utf8() returns only capital letters

2008-04-11 Thread jason at foreflight dot com
 ID:   44098
 Comment by:   jason at foreflight dot com
 Reported By:  steffen at dislabs dot de
 Status:   No Feedback
 Bug Type: IMAP related
 Operating System: FreeBSD 6.2
 PHP Version:  5.2.5
 Assigned To:  fb-req-jani
 New Comment:

I am seeing this too:

Red Hat Enterprise Linux ES release 4 (Nahant Update 6)
CClient: imap-2007a1


Previous Comments:


[2008-04-11 01:00:00] 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.



[2008-04-03 14:31:46] [EMAIL PROTECTED]

What c-client version did you compile PHP with?



[2008-02-13 11:06:32] steffen at dislabs dot de

ok i was wrong with debian.

This is the info from phpinfo:

FreeBSD xx 6.2-RELEASE-p9 FreeBSD 6.2-RELEASE-p9 #0: Fri Dec 28
22:40:13 CET 2007 [EMAIL PROTECTED]:/usr/obj/usr/src/sys/SMP i386



[2008-02-13 01:17:20] [EMAIL PROTECTED]

Works fine to me... What libc-client-dev version you have used?

I used 7:2002edebian1-13.1ubuntu1



[2008-02-11 11:30:12] steffen at dislabs dot de

Description:

using imap_utf8 returns only capitols.
This behavior changed with 5.2.5 as it worked in 5.2.4 correct.

Reproduce code:
---
echo imap_utf8('=?iso-8859-1?b?THV6b26uMTQ=?= dot CoM');

Expected result:

Luzon®14 dot CoM

Actual result:
--
LUZON®14 DOT COM





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



#44176 [NEW]: Problems with strtotime or strftime and DST

2008-02-19 Thread jason dot young at daystar dot com
From: jason dot young at daystar dot com
Operating system: win 2003 IIs 6
PHP version:  5.2.5
PHP Bug Type: Date/time related
Bug description:  Problems with strtotime or strftime and DST

Description:

Ok I'm trying to do some calendar work right during this summers time
change hour. 3/9/2008 at 2 a.m. I work for a television network and we have
to created scheduals for every hour of every day. (This includes 2 am)
strtotime or possibly strftime is not handling that 2:00 am hour correctly
here is some testing:

Reproduce code:
---
?php
echo(strftime(%a %m/%d/%y %I:%M %p,(strtotime(3/9/2008 2:00:00 AM;

echo  --- ; 
echo(strftime(%m/%d/%y %I:%M %p,(strtotime(Mar 9 2008 2:00AM; 
echo  --- ; 
echo(strtotime(-2 days ,strtotime(03/09/08)));
echo  --- ; 
echo(strtotime(-2 days , 1205042400));
echo  --- ; 
echo(strtotime(3/9/2008 2:00:00 AM));
echo  --- ; 
echo(strtotime(Mar 9 2008 2:00AM)); 
?

Output:
Sun 03/09/08 03:00 AM --- 03/09/08 03:00 AM --- 1204869600 --- 1204869600
--- 1205049600 --- 1205049600

I've tried setting the TZ to US/CDT that didn't help ($test =
putenv(TZ=US/CDT);)


Expected result:

I expect the code to return a formated verson of the date Mar 9 2008
2:00AM

Actual result:
--
Sun 03/09/08 03:00 AM 

I apologize in advance if this is my misuse. 

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


#43231 [Com]: array-based callback syntax is overly E_STRICT

2008-01-31 Thread jason at citydiesel dot net
 ID:   43231
 Comment by:   jason at citydiesel dot net
 Reported By:  chuck at horde dot org
 Status:   Open
 Bug Type: Scripting Engine problem
 Operating System: *
 PHP Version:  5.2.*
 Assigned To:  helly
 New Comment:

I also don't understand.  It seems to me that this logic will lead to a
lot of unnecessary compatibility issues.  If we need the strict behavior
we can always set E_STRICT.


Previous Comments:


[2008-01-30 19:25:35] [EMAIL PROTECTED]

I'm sorry, I don't understand. Of course it is an E_STRICT error. But
why is it an error if E_STRICT is turned off?



[2008-01-30 19:20:47] [EMAIL PROTECTED]

Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at
http://www.php.net/manual/ and the instructions on how to report
a bug at http://bugs.php.net/how-to-report.php

This is indeed the correct behavior. You do not pass in a valid
callback. If you call hello() directly you get an E_STRICT. Now
call_user_func[_array]() tries to bind this function and cannot because
it is not a valid one. It used to work in 5.2 for BC sakes, because I
overlooked this in 5.0. When I first noticed this issue in 5.1, we
couldn't change it in 5.1 and we also decided to not change this in 5.2.



[2008-01-17 06:11:28] [EMAIL PROTECTED]

Ping?



[2007-11-25 20:08:47] [EMAIL PROTECTED]

Just a reminder on this, since you said you already had the patch?



[2007-11-14 08:03:15] [EMAIL PROTECTED]

And this is HEAD issue too, that's where I simply MFH'd the stuff that
broke this. :)



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

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


#41636 [Bgs]: Warning: dl() [function.dl]: Unable to load dynamic library '%PATH%'

2007-06-12 Thread jason dot zhou at bertelsmann dot com dot cn
 ID:   41636
 User updated by:  jason dot zhou at bertelsmann dot com dot cn
 Reported By:  jason dot zhou at bertelsmann dot com dot cn
 Status:   Bogus
 Bug Type: *Extensibility Functions
 Operating System: SuSE Linux 9
 PHP Version:  5.2.3
 New Comment:

Hi Johannes,

Thanks a lot for your help!

You are right, I have too different version php installed. And now I
have reinstalled the server, and only installed Apache/2.2.4 (Unix)
PHP/5.2.3  pecl_http-1.5.3 

I have add the extension_dir=  and extension=http.so  to  the php.ini
file.

But it looks like the php didn't try to load the extension, also I use
/usr/local/php/bin/php -m command to test the load, I didn't see http in
the list. 

Would you please let me know where is the problem? What else should i
do?

Thanks!


Previous Comments:


[2007-06-09 08:06:58] [EMAIL PROTECTED]

The so you're trying to laod was compiled using another PHP version.
Please make sure you're using the same PHP while compiling and using the
extension.

btw. you shouldn't use dl() but only extension=so in your php.ini
file.

For future issues: Please report issues about PECL extensions at
http://pecl.php.net



[2007-06-08 16:22:46] jason dot zhou at bertelsmann dot com dot cn

Description:

I have installed 'pecl_http',and modified php.ini, the
extension_dir=/usr/local/php/lib/php/extensions/no-debug-non-zts-20060613/
 and extension=http.so. But i still get errors like below:

Warning: dl() [function.dl]: Unable to load dynamic library
'/usr/local/php/lib/php/extensions/no-debug-non-zts-20060613/http.so' -
/usr/local/php/lib/php/extensions/no-debug-non-zts-20060613/http.so:
undefined symbol: OnUpdateLong in /data/int/index.php on line 9

Fatal error: Call to undefined function http_get() in
/data/cms/mx/frontend/cfrontcache.php on line 456


I have tried to change the extension_dir=/usr/local/php/modules/  but
from the phpinfo.php  it still the /usr/.../no-debug...20060613

Reproduce code:
---
Warning: dl() [function.dl]: Unable to load dynamic library
'/usr/local/php/lib/php/extensions/no-debug-non-zts-20060613/http.so' -
/usr/local/php/lib/php/extensions/no-debug-non-zts-20060613/http.so:
undefined symbol: OnUpdateLong in /data/int/index.php on line 9

Fatal error: Call to undefined function http_get() in
/data/cms/mx/frontend/cfrontcache.php on line 456






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


#41636 [NEW]: Warning: dl() [function.dl]: Unable to load dynamic library '%PATH%'

2007-06-08 Thread jason dot zhou at bertelsmann dot com dot cn
From: jason dot zhou at bertelsmann dot com dot cn
Operating system: SuSE Linux 9
PHP version:  5.2.3
PHP Bug Type: *Extensibility Functions
Bug description:  Warning: dl() [function.dl]: Unable to load dynamic library  
'%PATH%'

Description:

I have installed 'pecl_http',and modified php.ini, the
extension_dir=/usr/local/php/lib/php/extensions/no-debug-non-zts-20060613/
 and extension=http.so. But i still get errors like below:

Warning: dl() [function.dl]: Unable to load dynamic library
'/usr/local/php/lib/php/extensions/no-debug-non-zts-20060613/http.so' -
/usr/local/php/lib/php/extensions/no-debug-non-zts-20060613/http.so:
undefined symbol: OnUpdateLong in /data/int/index.php on line 9

Fatal error: Call to undefined function http_get() in
/data/cms/mx/frontend/cfrontcache.php on line 456


I have tried to change the extension_dir=/usr/local/php/modules/  but from
the phpinfo.php  it still the /usr/.../no-debug...20060613

Reproduce code:
---
Warning: dl() [function.dl]: Unable to load dynamic library
'/usr/local/php/lib/php/extensions/no-debug-non-zts-20060613/http.so' -
/usr/local/php/lib/php/extensions/no-debug-non-zts-20060613/http.so:
undefined symbol: OnUpdateLong in /data/int/index.php on line 9

Fatal error: Call to undefined function http_get() in
/data/cms/mx/frontend/cfrontcache.php on line 456


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


#41254 [NEW]: 64bit libmcrypt not found after bug #39935 fixed

2007-05-01 Thread jason at ionzoft dot com
From: jason at ionzoft dot com
Operating system: RedHat ES 4
PHP version:  5.2.1
PHP Bug Type: *Configuration Issues
Bug description:  64bit libmcrypt not found after bug #39935 fixed

Description:

This is not a bug.

It is documentation of a problem encountered when using libmcrypt on 64
bit machines and upgrading PHP to 5.2.1.

---

In reference to Bug #39935 (extensions tidy,mcrypt,mhash,pdo_sqlite
ignores --with-libdir), I have encountered an error post-compile.

Previously, mcrypt ignored --with-libdir, and naturally looked in
/usr/local/lib for libmcrtpy.so.4.

After bug #39935 was fixed, libmcrypt began to look in the right place
(which I have specified as /lib64 on 64 bit machines).

A potential solution is to compile libmcrypt with --libdir=/lib64.

It took a lot of hunting to find this answer, and perhaps there is a place
that this information could be posted.

Thanks.
Jason Garber



Reproduce code:
---
./configure \
--with-libdir=lib64 \
--with-apxs2=/usr/sbin/apxs \
--with-config-file-path=/etc \
--enable-sigchild \
--with-openssl \
--enable-bcmath \
--with-curl \
--with-mcrypt \
--with-mysql \
--with-mysqli=/usr/bin/mysql_config \
--enable-sockets \
--with-gd \
--with-jpeg-dir=lib64 \
--with-png-dir \
--with-freetype-dir \
--with-zlib


make

make test

Expected result:

{successful tests}

Actual result:
--
/usr/local/src/ServerSoftware/PHP/php-5.2.1/sapi/cli/php: error while
loading shared libraries: libmcrypt.so.4: cannot open shared object file:
No such file or directory
make: [test] Error 127 (ignored)


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


#40998 [NEW]: The length of key of session limited

2007-04-04 Thread jason dot polaris at gmail dot com
From: jason dot polaris at gmail dot com
Operating system: Windows XP
PHP version:  4.4.5
PHP Bug Type: Session related
Bug description:  The length of key of session limited

Description:

Currently I am trying to store a lot of data in the session (i.e. filename
and things related to that particular file)
However some filename(with full path) can be more than 300 characters, and
it is not stored if I use the path as a $_SESSION key.
Any key that contains less than 250 characters surely works well.

Reproduce code:
---
?php
  session_start();
  $_SESSION['asdklfjsldfkjsldkfj(more than 300 chars)']['ABC'] = 1;

?

Expected result:

When reloading (or redirect to another page that reads session)
$_SESSION['asdklfjsldfkjsldkfj(more than 300 chars)']['ABC'] will equals
to 1

Actual result:
--
The session array ($_SESSION['asdklfjsldfkjsldkfj(more than 300
chars)']['ABC']) is simply not set

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


#40998 [Fbk-Opn]: The length of key of session limited

2007-04-04 Thread jason dot polaris at gmail dot com
 ID:   40998
 User updated by:  jason dot polaris at gmail dot com
 Reported By:  jason dot polaris at gmail dot com
-Status:   Feedback
+Status:   Open
 Bug Type: Session related
 Operating System: Windows XP
 PHP Version:  4.4.5
 New Comment:

Currently I am using my XP machine, so I just put it in:
C:\PHP\sessiondata

When I look inside the sessiondata folder, there is serveral files. I
use my text editor to search for my target key, I found:
L_CHR058_CHR047AutoPlayv2_CHR047Autoplay_CHR032in_CHR032Windows_CH|a:1:{s:3:P3R;s:1:1;}
which is part of a key that I had set. However, there is even more
character goes beyond Windows_CH.
For others, e.g.
L_CHR058_CHR047htdocs_CHR047stage2_CHR047drivesel_slice_CHR047Untitled_CHR0451_24_CHR046gif|a:1:{s:3:P3R;s:1:1;}

The actual statement I have used:
$_SESSION['L_CHR058_CHR047AutoPlayv2_CHR047Autoplay_CHR032in_CHR032Windows_CHR032XP_CHR032_CHR032Automatically_CHR032Detect_CHR032and_CHR032React_CHR032to_CHR032New_CHR032Devices_CHR032on_CHR032a_CHR032System_CHR032_CHR045_CHR045_CHR032MSDN_CHR032Magazine_CHR044_CHR032November_CHR0322001_files_CHR047t_CHR046gif']['P3R']
= 1;
(I know, a little bit long...)


Previous Comments:


[2007-04-04 19:04:38] [EMAIL PROTECTED]

What kind of session storage are you using?



[2007-04-04 19:02:35] jason dot polaris at gmail dot com

Description:

Currently I am trying to store a lot of data in the session (i.e.
filename and things related to that particular file)
However some filename(with full path) can be more than 300 characters,
and it is not stored if I use the path as a $_SESSION key.
Any key that contains less than 250 characters surely works well.

Reproduce code:
---
?php
  session_start();
  $_SESSION['asdklfjsldfkjsldkfj(more than 300 chars)']['ABC'] = 1;

?

Expected result:

When reloading (or redirect to another page that reads session)
$_SESSION['asdklfjsldfkjsldkfj(more than 300 chars)']['ABC'] will
equals to 1

Actual result:
--
The session array ($_SESSION['asdklfjsldfkjsldkfj(more than 300
chars)']['ABC']) is simply not set





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


#40436 [Fbk-Opn]: object references broken in 5.2.1

2007-02-11 Thread Jason at V7Studios dot com
 ID:   40436
 User updated by:  Jason at V7Studios dot com
 Reported By:  Jason at V7Studios dot com
-Status:   Feedback
+Status:   Open
 Bug Type: Class/Object related
 Operating System: Windows
 PHP Version:  5.2.1
 New Comment:

Seems to be a problem specific to XAMPP's installation of PHP 5.2.1.  I
copied the dlls from the php zip into the installation directory and
then pointed apache to php5apache2_2.dll and it worked.

Why is there a php5apache2.dll (doesn't work) and a php5apache2_2.dll?

Sorry for this erroneous report.  I will never trust a PHP installation
unless I do it myself.


Previous Comments:


[2007-02-11 09:17:50] [EMAIL PROTECTED]

Use var_dump() instead of print; set display_errors=On,
error_reporting=E_ALL; make sure you've removed old php5ts.dll; look
into your web-servers log.



[2007-02-11 07:50:13] Jason at V7Studios dot com

Description:

A certain object reference situation that my code depends on has been
broken in 5.2.1 on *windows*.  It works on my linux production server
running 5.2.1.

Thanks.

Reproduce code:
---
class Foo 
{
   private $params = array();

   function __set($name, $value){
 $this-params[$name] = $value;
   }
   
   function __get($name){
 return $this-params[$name];
   }
}

$foo = new Foo();
$ref = $foo-bar;
$ref = This is a test;
print($foo-bar);

Expected result:

It should print out This is a test

Actual result:
--
On windows, nothing is printed out.  $foo-bar is not set.





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


#40436 [NEW]: object references broken in 5.2.1

2007-02-10 Thread Jason at V7Studios dot com
From: Jason at V7Studios dot com
Operating system: Windows
PHP version:  5.2.1
PHP Bug Type: Class/Object related
Bug description:  object references broken in 5.2.1

Description:

A certain object reference situation that my code depends on has been
broken in 5.2.1 on *windows*.  It works on my linux production server
running 5.2.1.

Thanks.

Reproduce code:
---
class Foo 
{
   private $params = array();

   function __set($name, $value){
 $this-params[$name] = $value;
   }
   
   function __get($name){
 return $this-params[$name];
   }
}

$foo = new Foo();
$ref = $foo-bar;
$ref = This is a test;
print($foo-bar);

Expected result:

It should print out This is a test

Actual result:
--
On windows, nothing is printed out.  $foo-bar is not set.

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


#39581 [Com]: Apache crash on php5ts.dll

2006-12-06 Thread jason dot egan at gmail dot com
 ID:   39581
 Comment by:   jason dot egan at gmail dot com
 Reported By:  durumdara at gmail dot com
 Status:   No Feedback
 Bug Type: Apache2 related
 Operating System: win2k3 sp1
 PHP Version:  5.2.0
 New Comment:

I'm getting the exact same error with the exact same setup (Apache
2.2.3 and PHP 5.2.0) While I'm unable to do a backtrace, I was able to
find this in the error.log generated by Apache:

[Wed Dec 06 08:43:01 2006] [notice] Apache/2.2.3 (Win32) PHP/5.2.0
configured -- resuming normal operations
[Wed Dec 06 08:43:01 2006] [notice] Server built: Jul 27 2006 16:49:49
[Wed Dec 06 08:43:01 2006] [notice] Parent: Created child process 168
PHP Warning:  PHP Startup: Unable to load dynamic library
'C:\\PHP\\ext\\php_exif.dll' - The specified module could not be
found.\r\n in Unknown on line 0
PHP Warning:  PHP Startup: Unable to load dynamic library
'C:\\PHP\\ext\\php_ifx.dll' - The specified module could not be
found.\r\n in Unknown on line 0
PHP Warning:  PHP Startup: Unable to load dynamic library
'C:\\PHP\\ext\\php_oci8.dll' - The specified module could not be
found.\r\n in Unknown on line 0
PHP Warning:  PHP Startup: Unable to load dynamic library
'C:\\PHP\\ext\\php_pdo_oci.dll' - The specified module could not be
found.\r\n in Unknown on line 0
PHP Warning:  PHP Startup: Unable to load dynamic library
'C:\\PHP\\ext\\php_pdo_oci8.dll' - The specified module could not be
found.\r\n in Unknown on line 0
PHP Warning:  PHP Startup: Unable to load dynamic library
'C:\\PHP\\ext\\php_pspell.dll' - The specified module could not be
found.\r\n in Unknown on line 0
PHP Warning:  PHP Startup: Unable to load dynamic library
'C:\\PHP\\ext\\php_sybase_ct.dll' - The specified module could not be
found.\r\n in Unknown on line 0
PHP Warning:  PHP Startup: Unable to load dynamic library
'C:\\PHP\\ext\\php_ibm_db2.dll' - The specified module could not be
found.\r\n in Unknown on line 0
PHP Warning:  PHP Startup: Unable to load dynamic library
'C:\\PHP\\ext\\php_imagick.dll' - The specified module could not be
found.\r\n in Unknown on line 0
PHP Warning:  PHP Startup: Unable to load dynamic library
'C:\\PHP\\ext\\php_ingres.dll' - The specified module could not be
found.\r\n in Unknown on line 0
PHP Warning:  PHP Startup: Unable to load dynamic library
'C:\\PHP\\ext\\php_netools.dll' - The specified module could not be
found.\r\n in Unknown on line 0
PHP Warning:  PHP Startup: Unable to load dynamic library
'C:\\PHP\\ext\\php_oracle.dll' - The specified module could not be
found.\r\n in Unknown on line 0
PHP Warning:  PHP Startup: Unable to load dynamic library
'C:\\PHP\\ext\\php_svn.dll' - The specified module could not be
found.\r\n in Unknown on line 0
PHP Warning:  PHP Startup: Unable to load dynamic library
'C:\\PHP\\ext\\php_yaz.dll' - The specified procedure could not be
found.\r\n in Unknown on line 0
PHP Notice:  Constant XML_ELEMENT_NODE already defined in Unknown on
line 0
PHP Notice:  Constant XML_ATTRIBUTE_NODE already defined in Unknown on
line 0
PHP Notice:  Constant XML_TEXT_NODE already defined in Unknown on line
0
PHP Notice:  Constant XML_CDATA_SECTION_NODE already defined in Unknown
on line 0
PHP Notice:  Constant XML_ENTITY_REF_NODE already defined in Unknown on
line 0
PHP Notice:  Constant XML_ENTITY_NODE already defined in Unknown on
line 0
PHP Notice:  Constant XML_PI_NODE already defined in Unknown on line 0
PHP Notice:  Constant XML_COMMENT_NODE already defined in Unknown on
line 0
PHP Notice:  Constant XML_DOCUMENT_NODE already defined in Unknown on
line 0
PHP Notice:  Constant XML_DOCUMENT_TYPE_NODE already defined in Unknown
on line 0
PHP Notice:  Constant XML_DOCUMENT_FRAG_NODE already defined in Unknown
on line 0
PHP Notice:  Constant XML_NOTATION_NODE already defined in Unknown on
line 0
PHP Notice:  Constant XML_HTML_DOCUMENT_NODE already defined in Unknown
on line 0
PHP Notice:  Constant XML_DTD_NODE already defined in Unknown on line
0
PHP Notice:  Constant XML_ELEMENT_DECL_NODE already defined in Unknown
on line 0
PHP Notice:  Constant XML_ATTRIBUTE_DECL_NODE already defined in
Unknown on line 0
PHP Notice:  Constant XML_ENTITY_DECL_NODE already defined in Unknown
on line 0
PHP Notice:  Constant XML_NAMESPACE_DECL_NODE already defined in
Unknown on line 0
PHP Notice:  Constant XML_LOCAL_NAMESPACE already defined in Unknown on
line 0
PHP Notice:  Constant XML_ATTRIBUTE_CDATA already defined in Unknown on
line 0
PHP Notice:  Constant XML_ATTRIBUTE_ID already defined in Unknown on
line 0
PHP Notice:  Constant XML_ATTRIBUTE_IDREF already defined in Unknown on
line 0
PHP Notice:  Constant XML_ATTRIBUTE_IDREFS already defined in Unknown
on line 0
PHP Notice:  Constant XML_ATTRIBUTE_ENTITY already defined in Unknown
on line 0
PHP Notice:  Constant XML_ATTRIBUTE_NMTOKEN already defined in Unknown
on line 0
PHP Notice:  Constant XML_ATTRIBUTE_NMTOKENS already defined in Unknown
on line 0
PHP Notice:  Constant XML_ATTRIBUTE_ENUMERATION already

#39581 [Com]: Apache crash on php5ts.dll

2006-12-06 Thread jason dot egan at gmail dot com
 ID:   39581
 Comment by:   jason dot egan at gmail dot com
 Reported By:  durumdara at gmail dot com
 Status:   No Feedback
 Bug Type: Apache2 related
 Operating System: win2k3 sp1
 PHP Version:  5.2.0
 New Comment:

swummer, would you mind clarifying that a little? My current install
uses php5apache2_2.dll as the default file name. I've gone ahead and
changed it to php5apache2.dll, updated my httpd.conf, and restarted the
server. I still have the same issues no matter how it is named.


Previous Comments:


[2006-12-06 18:32:45] swummer at gmail dot com

Hi...
Maybe i have the answer for our problems.
I change the ../../PHP/php5apache2.dll to ../../PHP/php5apache2_2.dll
and the error doesn´t appear again. I´m still testing, and everything
it´s seems ok.
Hug.



[2006-12-06 15:00:11] jason dot egan at gmail dot com

I'm getting the exact same error with the exact same setup (Apache
2.2.3 and PHP 5.2.0) While I'm unable to do a backtrace, I was able to
find this in the error.log generated by Apache:

[Wed Dec 06 08:43:01 2006] [notice] Apache/2.2.3 (Win32) PHP/5.2.0
configured -- resuming normal operations
[Wed Dec 06 08:43:01 2006] [notice] Server built: Jul 27 2006 16:49:49
[Wed Dec 06 08:43:01 2006] [notice] Parent: Created child process 168
PHP Warning:  PHP Startup: Unable to load dynamic library
'C:\\PHP\\ext\\php_exif.dll' - The specified module could not be
found.\r\n in Unknown on line 0
PHP Warning:  PHP Startup: Unable to load dynamic library
'C:\\PHP\\ext\\php_ifx.dll' - The specified module could not be
found.\r\n in Unknown on line 0
PHP Warning:  PHP Startup: Unable to load dynamic library
'C:\\PHP\\ext\\php_oci8.dll' - The specified module could not be
found.\r\n in Unknown on line 0
PHP Warning:  PHP Startup: Unable to load dynamic library
'C:\\PHP\\ext\\php_pdo_oci.dll' - The specified module could not be
found.\r\n in Unknown on line 0
PHP Warning:  PHP Startup: Unable to load dynamic library
'C:\\PHP\\ext\\php_pdo_oci8.dll' - The specified module could not be
found.\r\n in Unknown on line 0
PHP Warning:  PHP Startup: Unable to load dynamic library
'C:\\PHP\\ext\\php_pspell.dll' - The specified module could not be
found.\r\n in Unknown on line 0
PHP Warning:  PHP Startup: Unable to load dynamic library
'C:\\PHP\\ext\\php_sybase_ct.dll' - The specified module could not be
found.\r\n in Unknown on line 0
PHP Warning:  PHP Startup: Unable to load dynamic library
'C:\\PHP\\ext\\php_ibm_db2.dll' - The specified module could not be
found.\r\n in Unknown on line 0
PHP Warning:  PHP Startup: Unable to load dynamic library
'C:\\PHP\\ext\\php_imagick.dll' - The specified module could not be
found.\r\n in Unknown on line 0
PHP Warning:  PHP Startup: Unable to load dynamic library
'C:\\PHP\\ext\\php_ingres.dll' - The specified module could not be
found.\r\n in Unknown on line 0
PHP Warning:  PHP Startup: Unable to load dynamic library
'C:\\PHP\\ext\\php_netools.dll' - The specified module could not be
found.\r\n in Unknown on line 0
PHP Warning:  PHP Startup: Unable to load dynamic library
'C:\\PHP\\ext\\php_oracle.dll' - The specified module could not be
found.\r\n in Unknown on line 0
PHP Warning:  PHP Startup: Unable to load dynamic library
'C:\\PHP\\ext\\php_svn.dll' - The specified module could not be
found.\r\n in Unknown on line 0
PHP Warning:  PHP Startup: Unable to load dynamic library
'C:\\PHP\\ext\\php_yaz.dll' - The specified procedure could not be
found.\r\n in Unknown on line 0
PHP Notice:  Constant XML_ELEMENT_NODE already defined in Unknown on
line 0
PHP Notice:  Constant XML_ATTRIBUTE_NODE already defined in Unknown on
line 0
PHP Notice:  Constant XML_TEXT_NODE already defined in Unknown on line
0
PHP Notice:  Constant XML_CDATA_SECTION_NODE already defined in Unknown
on line 0
PHP Notice:  Constant XML_ENTITY_REF_NODE already defined in Unknown on
line 0
PHP Notice:  Constant XML_ENTITY_NODE already defined in Unknown on
line 0
PHP Notice:  Constant XML_PI_NODE already defined in Unknown on line 0
PHP Notice:  Constant XML_COMMENT_NODE already defined in Unknown on
line 0
PHP Notice:  Constant XML_DOCUMENT_NODE already defined in Unknown on
line 0
PHP Notice:  Constant XML_DOCUMENT_TYPE_NODE already defined in Unknown
on line 0
PHP Notice:  Constant XML_DOCUMENT_FRAG_NODE already defined in Unknown
on line 0
PHP Notice:  Constant XML_NOTATION_NODE already defined in Unknown on
line 0
PHP Notice:  Constant XML_HTML_DOCUMENT_NODE already defined in Unknown
on line 0
PHP Notice:  Constant XML_DTD_NODE already defined in Unknown on line
0
PHP Notice:  Constant XML_ELEMENT_DECL_NODE already defined in Unknown
on line 0
PHP Notice:  Constant XML_ATTRIBUTE_DECL_NODE already defined in
Unknown on line 0
PHP Notice:  Constant XML_ENTITY_DECL_NODE already defined in Unknown
on line 0
PHP Notice:  Constant

#39431 [NEW]: Bug #35612 still occurs!

2006-11-08 Thread jason at eedo dot com
From: jason at eedo dot com
Operating system: Windows 2003
PHP version:  5.2.0
PHP Bug Type: IIS related
Bug description:  Bug #35612 still occurs!

Description:

Bug #35612 still occurs!


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


#38976 [Com]: missing last character when fetching query

2006-11-06 Thread jason at southerntextile dot com
 ID:   38976
 Comment by:   jason at southerntextile dot com
 Reported By:  zolfi at parspooyesh dot com
 Status:   No Feedback
 Bug Type: PDO related
 Operating System: fedora linux 5
 PHP Version:  5.1.6
 New Comment:

Latest Fedora RPMs (compilied Nov. 2) still affected by bug.


Previous Comments:


[2006-10-27 21:23:44] jason at southerntextile dot com

Make that two differnt Fedora 6 servers with the same problem now (PHP
5.1.6 /w PDO).



[2006-10-27 20:04:45] jason at southerntextile dot com

Since doing a fresh install of Fedora 6. This is occuring on all my
SQLite databases (using PDO).



[2006-10-05 01:00:00] 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-09-27 16:57:56] [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

Can't reproduce.



[2006-09-27 16:52:29] zolfi at parspooyesh dot com

Description:

when using SELECT statement for selecting rows of table, and 
using fetchAll(or fetch) method the last character of each row will be
lost.


Reproduce code:
---
$db_location = table.sqlite;

$db = new PDO(sqlite:{$db_location});

$db-query(create table my_table (name text););
// table is empty
$query = $db-query(delete from my_table);

$query = $db-query(insert into  my_table (name) values ('123'));

$query = $db-query(select name from my_table);

while ($row = $query-fetch())
{
 print_r($row);
}


Expected result:

Array
(
[name] = 123
[0] = 123
)


Actual result:
--
Array
(
[name] = 12
[0] = 12
)






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


#38976 [Com]: missing last character when fetching query

2006-10-27 Thread jason at southerntextile dot com
 ID:   38976
 Comment by:   jason at southerntextile dot com
 Reported By:  zolfi at parspooyesh dot com
 Status:   No Feedback
 Bug Type: PDO related
 Operating System: fedora linux 5
 PHP Version:  5.1.6
 New Comment:

Since doing a fresh install of Fedora 6. This is occuring on all my
SQLite databases (using PDO).


Previous Comments:


[2006-10-05 01:00:00] 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-09-27 16:57:56] [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

Can't reproduce.



[2006-09-27 16:52:29] zolfi at parspooyesh dot com

Description:

when using SELECT statement for selecting rows of table, and 
using fetchAll(or fetch) method the last character of each row will be
lost.


Reproduce code:
---
$db_location = table.sqlite;

$db = new PDO(sqlite:{$db_location});

$db-query(create table my_table (name text););
// table is empty
$query = $db-query(delete from my_table);

$query = $db-query(insert into  my_table (name) values ('123'));

$query = $db-query(select name from my_table);

while ($row = $query-fetch())
{
 print_r($row);
}


Expected result:

Array
(
[name] = 123
[0] = 123
)


Actual result:
--
Array
(
[name] = 12
[0] = 12
)






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


#38976 [Com]: missing last character when fetching query

2006-10-27 Thread jason at southerntextile dot com
 ID:   38976
 Comment by:   jason at southerntextile dot com
 Reported By:  zolfi at parspooyesh dot com
 Status:   No Feedback
 Bug Type: PDO related
 Operating System: fedora linux 5
 PHP Version:  5.1.6
 New Comment:

Make that two differnt Fedora 6 servers with the same problem now (PHP
5.1.6 /w PDO).


Previous Comments:


[2006-10-27 20:04:45] jason at southerntextile dot com

Since doing a fresh install of Fedora 6. This is occuring on all my
SQLite databases (using PDO).



[2006-10-05 01:00:00] 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-09-27 16:57:56] [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

Can't reproduce.



[2006-09-27 16:52:29] zolfi at parspooyesh dot com

Description:

when using SELECT statement for selecting rows of table, and 
using fetchAll(or fetch) method the last character of each row will be
lost.


Reproduce code:
---
$db_location = table.sqlite;

$db = new PDO(sqlite:{$db_location});

$db-query(create table my_table (name text););
// table is empty
$query = $db-query(delete from my_table);

$query = $db-query(insert into  my_table (name) values ('123'));

$query = $db-query(select name from my_table);

while ($row = $query-fetch())
{
 print_r($row);
}


Expected result:

Array
(
[name] = 123
[0] = 123
)


Actual result:
--
Array
(
[name] = 12
[0] = 12
)






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


#38920 [NEW]: preg_replace allows backreferences from a replacement string

2006-09-22 Thread jason at vancetech dot com
From: jason at vancetech dot com
Operating system: FreeBSD 6.1
PHP version:  4.4.4
PHP Bug Type: PCRE related
Bug description:  preg_replace allows backreferences from a replacement string

Description:

preg_replace allows backreferences from the replacement string which seems
insecure.  Parsing every replacement string is necessary when data comes
from a tainted source.

Perl handles this nicely by only allowing backreference's that are used
directly in the replacement text and not contained in a {tainted} string.

Reproduce code:
---
$text = 'This item costs $0.99';
$html = 'b%COST%No items%COST%/b';
print preg_replace('/%COST%.*?%COST%/i', $text, $html);

Expected result:

bThis item costs $0.99/b

Actual result:
--
This item costs %COST%No items%COST%.99

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


#38266 [NEW]: array += operator broken

2006-07-31 Thread jason at jasonjustman dot com
From: jason at jasonjustman dot com
Operating system: linux/windows
PHP version:  4.4.2
PHP Bug Type: Arrays related
Bug description:  array += operator broken

Description:

array += operator is now broken in 4.4.1 and 4.4.2

Reproduce code:
---
?
$x = array(a,b,c);
$x +=array(d,e);
print_r($x);


Expected result:

Array ( [0] = a [1] = b [2] = c [3] = d [4] = e)

Actual result:
--
Array ( [0] = a [1] = b [2] = c )

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


#38266 [Bgs]: array += operator broken

2006-07-31 Thread jason at jasonjustman dot com
 ID:   38266
 User updated by:  jason at jasonjustman dot com
 Reported By:  jason at jasonjustman dot com
 Status:   Bogus
 Bug Type: Arrays related
 Operating System: linux/windows
 PHP Version:  4.4.2
 New Comment:

Please refer to the following docs page:

 http://us3.php.net/manual/en/function.array-merge.php 

If you want to completely preserve the arrays and just want to append
them to each other, use the + operator:
?php
$array1 = array();
$array2 = array(1 = data);
$result = $array1 + $array2;
? 

i know that array_merge is the proper function to use in my previous
test case, for the output. but, regardless, if the key association is
being maintaed in my previous test case, the output should really be
[0] = d [1]=e [2]=c


please revisit, or redoc on the manpage.


Previous Comments:


[2006-07-31 08:51:07] [EMAIL PROTECTED]

This is how it works in 4.3.0, 4.3.6, 4.3.11, 5.0.x.
No bug here.



[2006-07-31 08:38:14] jason at jasonjustman dot com

Description:

array += operator is now broken in 4.4.1 and 4.4.2

Reproduce code:
---
?
$x = array(a,b,c);
$x +=array(d,e);
print_r($x);


Expected result:

Array ( [0] = a [1] = b [2] = c [3] = d [4] = e)

Actual result:
--
Array ( [0] = a [1] = b [2] = c )





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


#22216 [Com]: Named Arguments

2006-06-14 Thread jason at godsey dot net
 ID:   22216
 Comment by:   jason at godsey dot net
 Reported By:  tim dot lokot at printsoft dot com
 Status:   Open
 Bug Type: Feature/Change Request
 Operating System: All
 PHP Version:  4.3.0
 New Comment:

?php
// Missing named arguments work around..
// Set the default/REQUIRED var to something unlikely.

define(REQUIRED, _^_- . rand(100,) . - . time());

function parseRequired ($defaults, $args)
{
 foreach ($defaults as $key=$value) {
   if(!isset($args[$key])) {
 if ($value == REQUIRED) {
$backtrace = debug_backtrace();
$function = $backtrace[1][function];
throw new Exception(function: $function var: \$$key not
defined);
 }
 $args[$key] = $value;
   }
 }
 return 0;
}

function debugging ($args)
{
 $defaults = array(
   name=Lanny Jason Godsey,
   text=This is the default text!,
   date=REQUIRED
 );
 parseRequired($defaults, $args);
 print ($args[date]) Welcome $args[name], text entered:
$args[text]\n;
}

debugging(array(name=L. Jason Godsey,date=date(Y-m-d)));

?


Previous Comments:


[2003-02-13 16:59:47] tim dot lokot at printsoft dot com

I know this can be accomplished in other way and also know this has
been brought up before, but they are messy and require code from the
developer to handle this which seems to go against the php ethos of
easy and fast to develop.

If named arguments could be passed to functions and actually processed
by the php parser, then this would be really great.  Especially where
function prototypes have default values in them and you only want to
set one of them.  The proposed syntax would be something like this:

function foo ($var1=some value, $var2, $var3=some other value)
{
  // function code
}

then to call the function would be like this

foo (var2:=value for argument 2 only);

This would also be great if this feature would extend to the existing
functions in the extensions as well.

mail (to:=[EMAIL PROTECTED], message:=no message, subject:=subject);

This in my opinion makes the function calls more readable in some
circumstances, particularly when you have to keep going back to the
prototype to figure out what the order of the arguments is.  It's kind
of self documenting really when you look at code written in this way.

Bug #2285: default arguments skipping
(http://bugs.php.net/bug.php?id=2285) was filed with a similar
suggestion and the solution suggested was to use associative arrays.

Becuase it was never explained in any of the other reports as to why
this wasn't going to be implemented, why the above not more preferable
to have than always have to implement the same code this:

function foo ($args)
{
  // Named Argument Checks
  $var1 = some value;
  $var3 = some other value;

  foreach ($args as $key = $value)
  {
$$key = $value;
  }

  // Do function code here
}

foo (array (var2=some other value again,var1=variable 1));


Surely forcing developers into using this messy syntax goes against one
of the main strengths of php which is simple code that's easy to read,
understand and develop.

I'm in no wasy saying the above code was hard, just the first example
of named arguments seems to fit more into the php way than the second
example.

If this is to be rejected like the other requests for it, can you
please provide a reason why the array method is more preferable?




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


#34998 [WFx]: zend.ze1_compatibility_mode doesn't implict clone when passed in array

2006-05-24 Thread jason at jasonjustman dot com
 ID:   34998
 User updated by:  jason at jasonjustman dot com
 Reported By:  jason at jasonjustman dot com
 Status:   Wont fix
 Bug Type: Scripting Engine problem
 Operating System: *
 PHP Version:  5CVS-2005-10-27 (snap)
 Assigned To:  dmitry
 New Comment:

Please tell me this is because the php5.2 object model will operate
like php 4 if this flag is going to be removed.

thanks,
jason


Previous Comments:


[2006-05-24 08:03:23] [EMAIL PROTECTED]

zend.ze1_compatibility_mode was removed from HEAD and PHP_5_2 branches.



[2005-11-26 09:02:15] jason at jasonjustman dot com

still present in:

PHP Version 5.1.0
System  SunOS apache 5.10 Generic sun4u



[2005-10-27 10:12:02] jason at jasonjustman dot com

Description:

Again, with zend.ze1_compatibility_mode, it fails to properly clone
objects when calling as an argument for the array() function.  

This BC break is getting annoying...

Reproduce code:
---
?
$single_container = array();
$double_container = array();

class base_object {};
$x = new base_object;

$x-value = 5;
$single_container[1] = $x;
$double_container[1] = array($x);

$x-value = 10;
$single_container[2] = $x;
$double_container[2] = array($x);

$x-value = 15;
$single_container[3] = $x;
$double_container[3] = array($x);

print_r($single_container);
print_r($double_container);


Expected result:

//single
Array
(
[1] = base_object Object
(
[value] = 5
)

[2] = base_object Object
(
[value] = 10
)

[3] = base_object Object
(
[value] = 15
)

)
//double, values are correct
Array
(
[1] = Array
(
[0] = base_object Object
(
[value] = 5
)

)

[2] = Array
(
[0] = base_object Object
(
[value] = 10
)

)

[3] = Array
(
[0] = base_object Object
(
[value] = 15
)

)

)

Actual result:
--
//single
Array
(
[1] = base_object Object
(
[value] = 5
)

[2] = base_object Object
(
[value] = 10
)

[3] = base_object Object
(
[value] = 15
)

)

//double - values are incorrect
Array
(
[1] = Array
(
[0] = base_object Object
(
[value] = 15
)

)

[2] = Array
(
[0] = base_object Object
(
[value] = 15
)

)

[3] = Array
(
[0] = base_object Object
(
[value] = 15
)

)

)





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


#37357 [NEW]: php_tidy.dll cause Apache2 to crash on stop

2006-05-07 Thread jason at 01box dot com
From: jason at 01box dot com
Operating system: WinXP 32bit Apache2
PHP version:  5.1.4
PHP Bug Type: *Extensibility Functions
Bug description:  php_tidy.dll cause Apache2 to crash on stop

Description:

when enable
extension=php_tidy.dll
Although the apache2 can start and opearate as normal,
it can exit or restart correctly

Reproduce code:
---
enable
extension=php_tidy.dll
in php.ini
start apache2
then restart or stop the server
an error / message box will be pop up

Expected result:

Apache2 restarted
or 
have a clean exit

Actual result:
--
an error message popup and
apache2 processes was killed

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


#37064 [Fbk-Opn]: mod_ext_filter causes a filtered php page to hang with calls to eval()

2006-04-13 Thread jason at merchant dot to
 ID:   37064
 User updated by:  jason at merchant dot to
 Reported By:  jason at merchant dot to
-Status:   Feedback
+Status:   Open
 Bug Type: Apache2 related
 Operating System: Windows XP
 PHP Version:  5.1.2
 New Comment:

The link you gave me for the win32 debug packs is broken on
http://snaps.php.net/

It is giving php warnings for all the win32 packages.


Previous Comments:


[2006-04-13 10:29:36] [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.





[2006-04-13 03:51:37] jason at merchant dot to

Description:

I am using Apache2's mod_ext_filter to modify the output filtering of
html and php pages. It works fine on html pages. On php pages with to
many calls to eval(), the filter will cause it to hang until the script
times out. Within the 30 second timeout my filter was only able to
return the first line unmodified.

Reproduce code:
---
//httpd.conf directives*/

ExtFilterDefine myfilter mode=output intype=text/html
cmd=C:/php/php.exe C:/myfilter.php

SetOutputFilter myfilter
/

//***  C:/myfilter.php(The filter called by php.exe) **/

?php
$fp = fopen(php://stdin, r);
while (!feof($fp)) {
   echo fgets($fp);  
}
fclose($fp);
?
/

//  the php page that will be filtered ***/
// This script was copied from a previous bug report with a similar
issue in php3 here: http://bugs.php.net/bug.php?id=3744

?php
   $b = ;
   for ($i = 1; $i  1; $i++)
   $b .= b;
echo b: $b\n;

   for ($i = 1; $i  1; $i++)
   {
echo i: $i\n; flush();
   eval(\$a = '$b';);
   }
?
/

Expected result:

when run with the filter turned off I get the expected echoed
information.

Actual result:
--
The script hangs until it reaches the maximum execution time.





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


#37064 [NEW]: mod_ext_filter causes a filtered php page to hang with calls to eval()

2006-04-12 Thread jason at merchant dot to
From: jason at merchant dot to
Operating system: Windows XP
PHP version:  5.1.2
PHP Bug Type: Apache2 related
Bug description:  mod_ext_filter causes a filtered php page to hang with calls 
to eval()

Description:

I am using Apache2's mod_ext_filter to modify the output filtering of html
and php pages. It works fine on html pages. On php pages with to many calls
to eval(), the filter will cause it to hang until the script times out.
Within the 30 second timeout my filter was only able to return the first
line unmodified.

Reproduce code:
---
//httpd.conf directives*/

ExtFilterDefine myfilter mode=output intype=text/html cmd=C:/php/php.exe
C:/myfilter.php

SetOutputFilter myfilter
/

//***  C:/myfilter.php(The filter called by php.exe) **/

?php
$fp = fopen(php://stdin, r);
while (!feof($fp)) {
   echo fgets($fp);  
}
fclose($fp);
?
/

//  the php page that will be filtered ***/
// This script was copied from a previous bug report with a similar issue
in php3 here: http://bugs.php.net/bug.php?id=3744

?php
   $b = ;
   for ($i = 1; $i  1; $i++)
   $b .= b;
echo b: $b\n;

   for ($i = 1; $i  1; $i++)
   {
echo i: $i\n; flush();
   eval(\$a = '$b';);
   }
?
/

Expected result:

when run with the filter turned off I get the expected echoed information.

Actual result:
--
The script hangs until it reaches the maximum execution time.

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


#36036 [NEW]: fsockopen will not connect with bindto option

2006-01-16 Thread jason at eblasterpro dot com
From: jason at eblasterpro dot com
Operating system: Mandrake 10.2
PHP version:  5.1.2
PHP Bug Type: Sockets related
Bug description:  fsockopen will not connect with bindto option

Description:

I passed this option
$options = array('socket' = array('bindto' = '10.1.14.1:9000'));
into 
$context = stream_context_create($options);
$fp = @$openfunc($this-addr, $this-port, $errno, $errstr, $timeout,
$context);
Which caused my program to stop connecting all together.
The ip and port are valid.

Expected result:

Pear Socket.php has a place for options to be passed in, so I thought it
would bind

Actual result:
--
Could never connect to remote machine

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


#36036 [Fbk-Opn]: fsockopen will not connect with bindto option

2006-01-16 Thread jason at eblasterpro dot com
 ID:   36036
 User updated by:  jason at eblasterpro dot com
 Reported By:  jason at eblasterpro dot com
-Status:   Feedback
+Status:   Open
 Bug Type: Sockets related
 Operating System: Mandrake 10.2
 PHP Version:  5.1.2
 New Comment:

bWarning/b:  fsockopen() expects at most 5 parameters, 6 given in
b/home/home/virtualhosts/trendex/lib/Net/Socket4.php/b on line
b133/bbr /

Pear's Socket.php contain the following in its connect function.   The
must have wrote this assuming fsockopen would accept options one day.

$openfunc = $this-persistent ? 'pfsockopen' : 'fsockopen';
$errno = 0;
$errstr = '';
if ($options  function_exists('stream_context_create')) {
if ($this-timeout) {
$timeout = $this-timeout;
} else {
$timeout = 0;
}
$context = stream_context_create($options);
$fp = $openfunc($this-addr, $this-port, $errno, $errstr, $timeout,
$context);
} else {
if ($this-timeout) {
$fp = $openfunc($this-addr, $this-port, $errno, $errstr,
$this-timeout);
} else {
$fp = $openfunc($this-addr, $this-port, $errno, $errstr);
}
}


Previous Comments:


[2006-01-16 21:46:30] [EMAIL PROTECTED]

Remove the @ from the function call and post the error you get (if
any).
And make sure your 10.1.14.1 is *your* IP and port #9000 is not blocked
by a firewall (or better just turn off any firewalls/filters).



[2006-01-16 21:41:23] jason at eblasterpro dot com

Description:

I passed this option
$options = array('socket' = array('bindto' = '10.1.14.1:9000'));
into 
$context = stream_context_create($options);
$fp = @$openfunc($this-addr, $this-port, $errno, $errstr, $timeout,
$context);
Which caused my program to stop connecting all together.
The ip and port are valid.

Expected result:

Pear Socket.php has a place for options to be passed in, so I thought
it would bind

Actual result:
--
Could never connect to remote machine





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


#35768 [NEW]: PHP.EXE outputs the filename.php file as TEXT

2005-12-21 Thread jason at thinkingman dot org
From: jason at thinkingman dot org
Operating system: Server 2003 Update 1
PHP version:  5.1.1
PHP Bug Type: *Compile Issues
Bug description:  PHP.EXE outputs the filename.php file as TEXT

Description:

PHP.EXE outputs the filename.php file as TEXT output instead of executing
the code under Windows Server 2003 command line when PHP.INI-recommended
is used.

PHP.EXE works as normal when NO PHP.INI file is used or when PHP.INI-dist
is used.

INSANELY ANNOYING BUG -- SPENT **HOURS** ON GOOGLE AND PHP.NET AND FAQ'S
AND PHP README DOCS TRYING TO FIGURE OUT WHAT WAS WRONG WITH MY WIN 2003
SERVER AND PHP INSTALL / INI FILE.



Reproduce code:
---
To reproduce:

Rename PHP.INI-recommend to PHP.INI and copy to C:\Windows folder or set
your env var PHPRC=C:\PHP (or where your PHP.INI is located.)

From the command line run PHP.EXE w/ .php file.

Example:

C: php.exe testcode.php

Will output file instead of executing.  So, you'll get:

?

   echo hello world;

?

instead of:
hello world


Expected result:

hello world

Actual result:
--
?

   echo hello world;

?

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


#34998 [Asn]: zend.ze1_compatibility_mode doesn't implict clone when passed in array

2005-11-26 Thread jason at jasonjustman dot com
 ID:   34998
 User updated by:  jason at jasonjustman dot com
 Reported By:  jason at jasonjustman dot com
 Status:   Assigned
 Bug Type: Scripting Engine problem
 Operating System: *
 PHP Version:  5CVS-2005-10-27 (snap)
 Assigned To:  dmitry
 New Comment:

still present in:

PHP Version 5.1.0
System  SunOS apache 5.10 Generic sun4u


Previous Comments:


[2005-10-27 10:12:02] jason at jasonjustman dot com

Description:

Again, with zend.ze1_compatibility_mode, it fails to properly clone
objects when calling as an argument for the array() function.  

This BC break is getting annoying...

Reproduce code:
---
?
$single_container = array();
$double_container = array();

class base_object {};
$x = new base_object;

$x-value = 5;
$single_container[1] = $x;
$double_container[1] = array($x);

$x-value = 10;
$single_container[2] = $x;
$double_container[2] = array($x);

$x-value = 15;
$single_container[3] = $x;
$double_container[3] = array($x);

print_r($single_container);
print_r($double_container);


Expected result:

//single
Array
(
[1] = base_object Object
(
[value] = 5
)

[2] = base_object Object
(
[value] = 10
)

[3] = base_object Object
(
[value] = 15
)

)
//double, values are correct
Array
(
[1] = Array
(
[0] = base_object Object
(
[value] = 5
)

)

[2] = Array
(
[0] = base_object Object
(
[value] = 10
)

)

[3] = Array
(
[0] = base_object Object
(
[value] = 15
)

)

)

Actual result:
--
//single
Array
(
[1] = base_object Object
(
[value] = 5
)

[2] = base_object Object
(
[value] = 10
)

[3] = base_object Object
(
[value] = 15
)

)

//double - values are incorrect
Array
(
[1] = Array
(
[0] = base_object Object
(
[value] = 15
)

)

[2] = Array
(
[0] = base_object Object
(
[value] = 15
)

)

[3] = Array
(
[0] = base_object Object
(
[value] = 15
)

)

)





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


#35112 [NEW]: Pear Install Error - Call to undefined function: getversion()

2005-11-05 Thread jason at extremeoverclocking dot com
From: jason at extremeoverclocking dot com
Operating system: RH EL 3
PHP version:  4CVS-2005-11-05 (snap)
PHP Bug Type: Compile Failure
Bug description:  Pear Install Error - Call to undefined function:  getversion()

Description:

Doing a make install caused the error below, so I installed everything
except pear, then ran the following but it still would not work.

[root php4-STABLE-200511051406]# make install-pear
Installing PEAR environment:  /usr/lib/php/

Fatal error: Call to undefined function:  getversion() in
/root/php4-STABLE-200511051406/pear/install-pear.php on line 118
make[1]: *** [install-pear-installer] Error 255
make: *** [install-pear] Error 2


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


#34998 [NEW]: zend.ze1_compatibility_mode doesn't implict clone when passed in array

2005-10-27 Thread jason at jasonjustman dot com
From: jason at jasonjustman dot com
Operating system: irrelv
PHP version:  5CVS-2005-10-27 (snap)
PHP Bug Type: Scripting Engine problem
Bug description:  zend.ze1_compatibility_mode doesn't implict clone when passed 
in array

Description:

Again, with zend.ze1_compatibility_mode, it fails to properly clone
objects when calling as an argument for the array() function.  

This BC break is getting annoying...

Reproduce code:
---
?
$single_container = array();
$double_container = array();

class base_object {};
$x = new base_object;

$x-value = 5;
$single_container[1] = $x;
$double_container[1] = array($x);

$x-value = 10;
$single_container[2] = $x;
$double_container[2] = array($x);

$x-value = 15;
$single_container[3] = $x;
$double_container[3] = array($x);

print_r($single_container);
print_r($double_container);


Expected result:

//single
Array
(
[1] = base_object Object
(
[value] = 5
)

[2] = base_object Object
(
[value] = 10
)

[3] = base_object Object
(
[value] = 15
)

)
//double, values are correct
Array
(
[1] = Array
(
[0] = base_object Object
(
[value] = 5
)

)

[2] = Array
(
[0] = base_object Object
(
[value] = 10
)

)

[3] = Array
(
[0] = base_object Object
(
[value] = 15
)

)

)

Actual result:
--
//single
Array
(
[1] = base_object Object
(
[value] = 5
)

[2] = base_object Object
(
[value] = 10
)

[3] = base_object Object
(
[value] = 15
)

)

//double - values are incorrect
Array
(
[1] = Array
(
[0] = base_object Object
(
[value] = 15
)

)

[2] = Array
(
[0] = base_object Object
(
[value] = 15
)

)

[3] = Array
(
[0] = base_object Object
(
[value] = 15
)

)

)

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


#34998 [Opn]: zend.ze1_compatibility_mode doesn't implict clone when passed in array

2005-10-27 Thread jason at jasonjustman dot com
 ID:   34998
 User updated by:  jason at jasonjustman dot com
 Reported By:  jason at jasonjustman dot com
 Status:   Open
 Bug Type: Scripting Engine problem
 Operating System: irrelv
 PHP Version:  5CVS-2005-10-27 (snap)
 New Comment:

PHP Version 5.1.0RC4-dev
Oct 27 2005 08:24:52


Previous Comments:


[2005-10-27 10:12:02] jason at jasonjustman dot com

Description:

Again, with zend.ze1_compatibility_mode, it fails to properly clone
objects when calling as an argument for the array() function.  

This BC break is getting annoying...

Reproduce code:
---
?
$single_container = array();
$double_container = array();

class base_object {};
$x = new base_object;

$x-value = 5;
$single_container[1] = $x;
$double_container[1] = array($x);

$x-value = 10;
$single_container[2] = $x;
$double_container[2] = array($x);

$x-value = 15;
$single_container[3] = $x;
$double_container[3] = array($x);

print_r($single_container);
print_r($double_container);


Expected result:

//single
Array
(
[1] = base_object Object
(
[value] = 5
)

[2] = base_object Object
(
[value] = 10
)

[3] = base_object Object
(
[value] = 15
)

)
//double, values are correct
Array
(
[1] = Array
(
[0] = base_object Object
(
[value] = 5
)

)

[2] = Array
(
[0] = base_object Object
(
[value] = 10
)

)

[3] = Array
(
[0] = base_object Object
(
[value] = 15
)

)

)

Actual result:
--
//single
Array
(
[1] = base_object Object
(
[value] = 5
)

[2] = base_object Object
(
[value] = 10
)

[3] = base_object Object
(
[value] = 15
)

)

//double - values are incorrect
Array
(
[1] = Array
(
[0] = base_object Object
(
[value] = 15
)

)

[2] = Array
(
[0] = base_object Object
(
[value] = 15
)

)

[3] = Array
(
[0] = base_object Object
(
[value] = 15
)

)

)





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


#34712 [Asn]: zend.ze1_compatibility_mode = on segfault

2005-10-18 Thread jason at jasonjustman dot com
 ID:   34712
 User updated by:  jason at jasonjustman dot com
 Reported By:  jason at jasonjustman dot com
 Status:   Assigned
 Bug Type: Reproducible crash
 Operating System: *
 PHP Version:  5CVS-2005-10-03 (snap)
 Assigned To:  dmitry
 New Comment:

still present in:

PHP 5.1.0RC3 (cli) (built: Oct 18 2005 08:28:41)
Copyright (c) 1997-2005 The PHP Group
Zend Engine v2.1.0-dev, Copyright (c) 1998-2005 Zend Technologies


Previous Comments:


[2005-10-04 09:18:27] [EMAIL PROTECTED]

Dmitry, with the provided script I can reproduce this.




[2005-10-04 08:44:10] jason at jasonjustman dot com

http://www.jasonjustman.com/crash.phps

line 114 is what causes the segfault:

$this-_transform_actions = new
base_object_meta_transform_actions($this);

its not clean nor tight, but an example of the pattern that causes it
to crash



[2005-10-03 22:23:13] [EMAIL PROTECTED]

We really need a reproducing script. Please try come up with one.




[2005-10-03 18:02:29] jason at jasonjustman dot com

Like i said before, i can't track down the exact sequence (stacktrace
of the .php script code shows its in the 12-14th depth), and for full
debug - only after parsing about 15kloc of code. 

When adding in debugging php source code in the new call (
$this-_helper = new helper($this);), it prevents the crash but in one
case a print_r($this) in the aggrevator:: scope resulted in an empty
object. 

This testcase is more pseudocode of the segfault pattern than actual
instance.  If you'd like I can privately attach the application source
- but again, its not an application problem - as turning off ze1_compat
doesn't cause a segfault , but is required for implicit clone.

This happens in the same spot for the 5.0.5, 5.0.6-dev and 5.0.6-latest
- even after building in seperate directories with no caching enabled.



[2005-10-03 12:13:48] [EMAIL PROTECTED]

This test case must not work at all.

$ php -d zend.ze1_compatibility_mode=1 bug34712.php

Fatal error: Cannot use 'parent' as class name as it is reserved in
/home/dmitry/php/test/bug34712.php on line 20

Without parent it works fine on Linux/i386.

Try to make full rebuild.



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

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


#34892 [NEW]: Process hang on LDAP operations

2005-10-17 Thread jason at mugfu dot com
From: jason at mugfu dot com
Operating system: FreeBSD 6.0 RC1
PHP version:  5.0.5
PHP Bug Type: LDAP related
Bug description:  Process hang on LDAP operations

Description:

Environment:

- FreeBSD 6.0 RC-1 on AMD64
- OpenLDAP2.2 client libraries on php host
- Connecting to OpenLDAP2.3 on remote host.

When this script is run from the command line, the LDAP operations
complete very quickly, without any problem.  When executed via mod_php in
Apache2, the php process will timeout everytime.  I have enabled full
debug tracing on in the LDAP server (OpenLDAP).  It shows the result being
sent back to the client, but the client does not close the connection.  CPU
usage on the httpd process handling the web client goes to 100%. 
ktrace/kdump show the process to be caught in a continuous loop like
this:

 69111 httpdCALL  select(0x400,0x9e1d00,0x9e1d80,0,0)
 69111 httpdRET   select 1


Reproduce code:
---
Short script:
?php
error_reporting(E_ALL);

$ds=ldap_connect(192.168.1.11);
echo connect result is  . $ds . br /\n;

if (ldap_set_option($ds, LDAP_OPT_PROTOCOL_VERSION, 3)) {
   echo Using LDAPv3br/\n;
} else {
   echo Failed to set protocol version to 3br/\n;
}

//Anonymous bind:
$r=ldap_bind($ds);
echo Bind result is  . $r . br /\n;

$sr=ldap_search($ds, dc=mydomain,dc=com, ((objectclass=*)));
echo Number of entires returned is  . ldap_count_entries($ds, $sr) .
br /\n;

ldap_close($ds);
?


Expected result:

I would expect the command line version, and the version running via
mod_php to behave in the same fashion.

Actual result:
--
Process timeouts without any other error.  Note that ldap_connect and
ldap_set_option behave fine in both environments (I may be wrong, but I
don't believe those actually open connections).  It is ldap_bind and
ldap_search that cause the issue.  If I comment out ldap_bind, the process
hangs on ldap_search.

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


#34892 [Opn-Bgs]: Process hang on LDAP operations

2005-10-17 Thread jason at mugfu dot com
 ID:   34892
 User updated by:  jason at mugfu dot com
 Reported By:  jason at mugfu dot com
-Status:   Open
+Status:   Bogus
 Bug Type: LDAP related
 Operating System: FreeBSD 6.0 RC1
 PHP Version:  5.0.5
 New Comment:

Withdrawing bug.  Now I can no longer reproduce this problem :/


Previous Comments:


[2005-10-17 16:50:43] jason at mugfu dot com

Description:

Environment:

- FreeBSD 6.0 RC-1 on AMD64
- OpenLDAP2.2 client libraries on php host
- Connecting to OpenLDAP2.3 on remote host.

When this script is run from the command line, the LDAP operations
complete very quickly, without any problem.  When executed via mod_php
in Apache2, the php process will timeout everytime.  I have enabled
full debug tracing on in the LDAP server (OpenLDAP).  It shows the
result being sent back to the client, but the client does not close the
connection.  CPU usage on the httpd process handling the web client goes
to 100%.  ktrace/kdump show the process to be caught in a continuous
loop like this:

 69111 httpdCALL  select(0x400,0x9e1d00,0x9e1d80,0,0)
 69111 httpdRET   select 1


Reproduce code:
---
Short script:
?php
error_reporting(E_ALL);

$ds=ldap_connect(192.168.1.11);
echo connect result is  . $ds . br /\n;

if (ldap_set_option($ds, LDAP_OPT_PROTOCOL_VERSION, 3)) {
   echo Using LDAPv3br/\n;
} else {
   echo Failed to set protocol version to 3br/\n;
}

//Anonymous bind:
$r=ldap_bind($ds);
echo Bind result is  . $r . br /\n;

$sr=ldap_search($ds, dc=mydomain,dc=com, ((objectclass=*)));
echo Number of entires returned is  . ldap_count_entries($ds, $sr) .
br /\n;

ldap_close($ds);
?


Expected result:

I would expect the command line version, and the version running via
mod_php to behave in the same fashion.

Actual result:
--
Process timeouts without any other error.  Note that ldap_connect and
ldap_set_option behave fine in both environments (I may be wrong, but I
don't believe those actually open connections).  It is ldap_bind and
ldap_search that cause the issue.  If I comment out ldap_bind, the
process hangs on ldap_search.





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


#34831 [NEW]: parse_url behavior changed from 5.0.4 to 5.0.5 breaks code

2005-10-11 Thread jason at eblasterpro dot com
From: jason at eblasterpro dot com
Operating system: Mandrake 10.2
PHP version:  5.0.5
PHP Bug Type: URL related
Bug description:  parse_url behavior changed from 5.0.4 to 5.0.5 breaks code

Description:

results differ from php-5.0.4 to php-5.0.5 for parse_url with  host and
scheme replaced with host and path


Reproduce code:
---
example of problem
php-5.0.4:
print_r(parse_url('href=http://mysite.com'));
results:
url = Array[2]
---host= mysite.com
---scheme= href=http

php-5.0.5:
print_r(parse_url('href=http://mysite.com'));
results:
url = Array[2]
---host= href=http
---path= //mysite.com

Expected result:

the returned result should not change between versions the correct return
should be
url = Array[2]
---host= mysite.com
---scheme= href=http

Actual result:
--
the incorrect result
url = Array[2]
---host= href=http
---path= //mysite.com



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


#34831 [Bgs]: parse_url behavior changed from 5.0.4 to 5.0.5 breaks code

2005-10-11 Thread jason at eblasterpro dot com
 ID:   34831
 User updated by:  jason at eblasterpro dot com
 Reported By:  jason at eblasterpro dot com
 Status:   Bogus
 Bug Type: URL related
 Operating System: Mandrake 10.2
 PHP Version:  5.0.5
 New Comment:

its a break from previous behaviors there for bug!!!
This has worked this way all the way from 5.0.4 code exist out there on
the internet the depend on how this function has behaved in the past,
and now it does not work the same.  Unless you were intending to break
code out there bug introducing this change it is a bug, and it will be
posted to google forums as so.


Previous Comments:


[2005-10-11 17:36:46] [EMAIL PROTECTED]

'href=http://mysite.com' is not a correct URL, nobody told you that
parse_url() will behave in the same way with invalid URLs.
No bug here.



[2005-10-11 17:26:03] jason at eblasterpro dot com

Description:

results differ from php-5.0.4 to php-5.0.5 for parse_url with  host and
scheme replaced with host and path


Reproduce code:
---
example of problem
php-5.0.4:
print_r(parse_url('href=http://mysite.com'));
results:
url = Array[2]
---host= mysite.com
---scheme= href=http

php-5.0.5:
print_r(parse_url('href=http://mysite.com'));
results:
url = Array[2]
---host= href=http
---path= //mysite.com

Expected result:

the returned result should not change between versions the correct
return should be
url = Array[2]
---host= mysite.com
---scheme= href=http

Actual result:
--
the incorrect result
url = Array[2]
---host= href=http
---path= //mysite.com







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


#34767 [Com]: Zend Engine 1 Compatibility not copying objects correctly

2005-10-10 Thread jason at jasonjustman dot com
 ID:   34767
 Comment by:   jason at jasonjustman dot com
 Reported By:  dstarr at allofe dot net
 Status:   Assigned
 Bug Type: Scripting Engine problem
 Operating System: *
 PHP Version:  5CVS-2005-10-06 (cvs)
 Assigned To:  dmitry
 New Comment:

if you're going to nuke ze1_compat then add the clone keyword into the
4.x branch (like i recommended A YEAR AGO:
http://bugs.php.net/bug.php?id=30332).

j


Previous Comments:


[2005-10-06 20:56:31] [EMAIL PROTECTED]

The expected result you do get without setting the option..so.. :)




[2005-10-06 20:55:38] [EMAIL PROTECTED]

Dmitry, this thing doesn't really seem to work.
Somehow I'm getting the impression that it would be much better to just
nuke this option and make people fix their scripts..




[2005-10-06 20:49:00] dstarr at allofe dot net

Description:

When zend.ze1_compatibility_mode is On, copying objects that have
references to other objects the object that was referenced is copied
instead of the reference itself.

The Expected Results were obtained by using PHP 4.4.0
The Actual is a result of running on 5.0.5

Reproduce code:
---
$a-y = new stdClass();
print_r($a);
echo br/;
$b = $a;
$a-y-z = 1;
print_r($b);


Expected result:

// Expected Output
// stdClass Object ( [y] = stdClass Object ( ) ) 
// stdClass Object ( [y] = stdClass Object ( [z] = 1 ) ) 

Actual result:
--
// Actual Output
// stdClass Object ( [y] = stdClass Object ( ) ) 
// stdClass Object ( [y] = stdClass Object ( ) ) 





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


#34712 [Fbk-Opn]: zend.ze1_compatibility_mode = on segfault

2005-10-04 Thread jason at jasonjustman dot com
 ID:   34712
 User updated by:  jason at jasonjustman dot com
 Reported By:  jason at jasonjustman dot com
-Status:   Feedback
+Status:   Open
 Bug Type: Reproducible crash
-Operating System: solars 10
+Operating System: solaris 10
 PHP Version:  5CVS-2005-10-03 (snap)
 Assigned To:  dmitry
 New Comment:

http://www.jasonjustman.com/crash.phps

line 114 is what causes the segfault:

$this-_transform_actions = new
base_object_meta_transform_actions($this);

its not clean nor tight, but an example of the pattern that causes it
to crash


Previous Comments:


[2005-10-03 22:23:13] [EMAIL PROTECTED]

We really need a reproducing script. Please try come up with one.




[2005-10-03 18:02:29] jason at jasonjustman dot com

Like i said before, i can't track down the exact sequence (stacktrace
of the .php script code shows its in the 12-14th depth), and for full
debug - only after parsing about 15kloc of code. 

When adding in debugging php source code in the new call (
$this-_helper = new helper($this);), it prevents the crash but in one
case a print_r($this) in the aggrevator:: scope resulted in an empty
object. 

This testcase is more pseudocode of the segfault pattern than actual
instance.  If you'd like I can privately attach the application source
- but again, its not an application problem - as turning off ze1_compat
doesn't cause a segfault , but is required for implicit clone.

This happens in the same spot for the 5.0.5, 5.0.6-dev and 5.0.6-latest
- even after building in seperate directories with no caching enabled.



[2005-10-03 12:13:48] [EMAIL PROTECTED]

This test case must not work at all.

$ php -d zend.ze1_compatibility_mode=1 bug34712.php

Fatal error: Cannot use 'parent' as class name as it is reserved in
/home/dmitry/php/test/bug34712.php on line 20

Without parent it works fine on Linux/i386.

Try to make full rebuild.



[2005-10-03 10:29:43] jason at jasonjustman dot com

last two lines of sample code should be:

$c = new child;
$a = new aggrevator($c);



[2005-10-03 10:05:08] jason at jasonjustman dot com

Description:

segfault in solaris 10, using php-5.0.6-dev - php5-STABLE-200510030637


Program received signal SIGSEGV, Segmentation fault.
0xff019b38 in zend_objects_clone_obj (zobject=0xff3fffd8) at
/export/apache/php5-STABLE-200510030637/Zend/zend_objects.c:181
181 new_obj_val = zend_objects_new(new_object,
old_object-ce TSRMLS_CC);

(gdb) backtrace
#0  0xff019b38 in zend_objects_clone_obj (zobject=0xff3fffd8) at
/export/apache/php5-STABLE-200510030637/Zend/zend_objects.c:181
#1  0xff019970 in zval_add_ref_or_clone (p=0x0) at
/export/apache/php5-STABLE-200510030637/Zend/zend_objects.c:127


Reproduce code:
---
can't exactly pin down reproduceable code, but it seems to be something
similar to the following:

class aggrevator {
 function aggrevator($obj) {
   $this-obj = $obj;
   $this-_call();
 }
 function _call()
 {
  $this-obj-callback();
 }
}

class helper {
function helper($obj)
 {
  $this-obj_ref = $obj;
 }
}

class parent { }
class child extends parent {
 function callback() {
   $this-_helper = new helper($this);
 }
}
  
$c = new child;
$h = new helper($c);


Expected result:

not to crash...


Actual result:
--
f'd in the a, segfault





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


#34712 [NEW]: zend.ze1_compatibility_mode = on segfault

2005-10-03 Thread jason at jasonjustman dot com
From: jason at jasonjustman dot com
Operating system: solars 10 
PHP version:  5CVS-2005-10-03 (snap)
PHP Bug Type: Reproducible crash
Bug description:  zend.ze1_compatibility_mode = on  segfault 

Description:

segfault in solaris 10, using php-5.0.6-dev - php5-STABLE-200510030637


Program received signal SIGSEGV, Segmentation fault.
0xff019b38 in zend_objects_clone_obj (zobject=0xff3fffd8) at
/export/apache/php5-STABLE-200510030637/Zend/zend_objects.c:181
181 new_obj_val = zend_objects_new(new_object, old_object-ce
TSRMLS_CC);

(gdb) backtrace
#0  0xff019b38 in zend_objects_clone_obj (zobject=0xff3fffd8) at
/export/apache/php5-STABLE-200510030637/Zend/zend_objects.c:181
#1  0xff019970 in zval_add_ref_or_clone (p=0x0) at
/export/apache/php5-STABLE-200510030637/Zend/zend_objects.c:127


Reproduce code:
---
can't exactly pin down reproduceable code, but it seems to be something
similar to the following:

class aggrevator {
 function aggrevator($obj) {
   $this-obj = $obj;
   $this-_call();
 }
 function _call()
 {
  $this-obj-callback();
 }
}

class helper {
function helper($obj)
 {
  $this-obj_ref = $obj;
 }
}

class parent { }
class child extends parent {
 function callback() {
   $this-_helper = new helper($this);
 }
}
  
$c = new child;
$h = new helper($c);


Expected result:

not to crash...


Actual result:
--
f'd in the a, segfault

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


#34712 [Fbk-Opn]: zend.ze1_compatibility_mode = on segfault

2005-10-03 Thread jason at jasonjustman dot com
 ID:   34712
 User updated by:  jason at jasonjustman dot com
 Reported By:  jason at jasonjustman dot com
-Status:   Feedback
+Status:   Open
 Bug Type: Reproducible crash
 Operating System: solars 10
 PHP Version:  5CVS-2005-10-03 (snap)
 New Comment:

still present:

(gdb) n
Single stepping until exit from function child_main,
which has no line number information.

Program received signal SIGSEGV, Segmentation fault.
0xfef36f20 in zend_objects_clone_obj (zobject=0xff3fffc8) at
/export/apache/php5-200510030630/Zend/zend_objects.c:167
167 new_obj_val = zend_objects_new(new_object,
old_object-ce TSRMLS_CC);
(gdb) backtrace
#0  0xfef36f20 in zend_objects_clone_obj (zobject=0xff3fffc8) at
/export/apache/php5-200510030630/Zend/zend_objects.c:167
#1  0xfef36de0 in zval_add_ref_or_clone (p=0x0) at
/export/apache/php5-200510030630/Zend/zend_objects.c:129

sniped


Previous Comments:


[2005-10-03 10:06:07] [EMAIL PROTECTED]

Please try using this CVS snapshot:

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





[2005-10-03 10:05:08] jason at jasonjustman dot com

Description:

segfault in solaris 10, using php-5.0.6-dev - php5-STABLE-200510030637


Program received signal SIGSEGV, Segmentation fault.
0xff019b38 in zend_objects_clone_obj (zobject=0xff3fffd8) at
/export/apache/php5-STABLE-200510030637/Zend/zend_objects.c:181
181 new_obj_val = zend_objects_new(new_object,
old_object-ce TSRMLS_CC);

(gdb) backtrace
#0  0xff019b38 in zend_objects_clone_obj (zobject=0xff3fffd8) at
/export/apache/php5-STABLE-200510030637/Zend/zend_objects.c:181
#1  0xff019970 in zval_add_ref_or_clone (p=0x0) at
/export/apache/php5-STABLE-200510030637/Zend/zend_objects.c:127


Reproduce code:
---
can't exactly pin down reproduceable code, but it seems to be something
similar to the following:

class aggrevator {
 function aggrevator($obj) {
   $this-obj = $obj;
   $this-_call();
 }
 function _call()
 {
  $this-obj-callback();
 }
}

class helper {
function helper($obj)
 {
  $this-obj_ref = $obj;
 }
}

class parent { }
class child extends parent {
 function callback() {
   $this-_helper = new helper($this);
 }
}
  
$c = new child;
$h = new helper($c);


Expected result:

not to crash...


Actual result:
--
f'd in the a, segfault





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


#34712 [Opn]: zend.ze1_compatibility_mode = on segfault

2005-10-03 Thread jason at jasonjustman dot com
 ID:   34712
 User updated by:  jason at jasonjustman dot com
 Reported By:  jason at jasonjustman dot com
 Status:   Open
 Bug Type: Reproducible crash
 Operating System: solars 10
 PHP Version:  5CVS-2005-10-03 (snap)
 New Comment:

last two lines of sample code should be:

$c = new child;
$a = new aggrevator($c);


Previous Comments:


[2005-10-03 10:26:29] jason at jasonjustman dot com

still present:

(gdb) n
Single stepping until exit from function child_main,
which has no line number information.

Program received signal SIGSEGV, Segmentation fault.
0xfef36f20 in zend_objects_clone_obj (zobject=0xff3fffc8) at
/export/apache/php5-200510030630/Zend/zend_objects.c:167
167 new_obj_val = zend_objects_new(new_object,
old_object-ce TSRMLS_CC);
(gdb) backtrace
#0  0xfef36f20 in zend_objects_clone_obj (zobject=0xff3fffc8) at
/export/apache/php5-200510030630/Zend/zend_objects.c:167
#1  0xfef36de0 in zval_add_ref_or_clone (p=0x0) at
/export/apache/php5-200510030630/Zend/zend_objects.c:129

sniped



[2005-10-03 10:06:07] [EMAIL PROTECTED]

Please try using this CVS snapshot:

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





[2005-10-03 10:05:08] jason at jasonjustman dot com

Description:

segfault in solaris 10, using php-5.0.6-dev - php5-STABLE-200510030637


Program received signal SIGSEGV, Segmentation fault.
0xff019b38 in zend_objects_clone_obj (zobject=0xff3fffd8) at
/export/apache/php5-STABLE-200510030637/Zend/zend_objects.c:181
181 new_obj_val = zend_objects_new(new_object,
old_object-ce TSRMLS_CC);

(gdb) backtrace
#0  0xff019b38 in zend_objects_clone_obj (zobject=0xff3fffd8) at
/export/apache/php5-STABLE-200510030637/Zend/zend_objects.c:181
#1  0xff019970 in zval_add_ref_or_clone (p=0x0) at
/export/apache/php5-STABLE-200510030637/Zend/zend_objects.c:127


Reproduce code:
---
can't exactly pin down reproduceable code, but it seems to be something
similar to the following:

class aggrevator {
 function aggrevator($obj) {
   $this-obj = $obj;
   $this-_call();
 }
 function _call()
 {
  $this-obj-callback();
 }
}

class helper {
function helper($obj)
 {
  $this-obj_ref = $obj;
 }
}

class parent { }
class child extends parent {
 function callback() {
   $this-_helper = new helper($this);
 }
}
  
$c = new child;
$h = new helper($c);


Expected result:

not to crash...


Actual result:
--
f'd in the a, segfault





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


#34712 [Fbk-Opn]: zend.ze1_compatibility_mode = on segfault

2005-10-03 Thread jason at jasonjustman dot com
 ID:   34712
 User updated by:  jason at jasonjustman dot com
 Reported By:  jason at jasonjustman dot com
-Status:   Feedback
+Status:   Open
 Bug Type: Reproducible crash
 Operating System: solars 10
 PHP Version:  5CVS-2005-10-03 (snap)
 Assigned To:  dmitry
 New Comment:

Like i said before, i can't track down the exact sequence (stacktrace
of the .php script code shows its in the 12-14th depth), and for full
debug - only after parsing about 15kloc of code. 

When adding in debugging php source code in the new call (
$this-_helper = new helper($this);), it prevents the crash but in one
case a print_r($this) in the aggrevator:: scope resulted in an empty
object. 

This testcase is more pseudocode of the segfault pattern than actual
instance.  If you'd like I can privately attach the application source
- but again, its not an application problem - as turning off ze1_compat
doesn't cause a segfault , but is required for implicit clone.

This happens in the same spot for the 5.0.5, 5.0.6-dev and 5.0.6-latest
- even after building in seperate directories with no caching enabled.


Previous Comments:


[2005-10-03 12:13:48] [EMAIL PROTECTED]

This test case must not work at all.

$ php -d zend.ze1_compatibility_mode=1 bug34712.php

Fatal error: Cannot use 'parent' as class name as it is reserved in
/home/dmitry/php/test/bug34712.php on line 20

Without parent it works fine on Linux/i386.

Try to make full rebuild.



[2005-10-03 11:24:37] [EMAIL PROTECTED]

Dmitry, you did something related to this lately?




[2005-10-03 10:29:43] jason at jasonjustman dot com

last two lines of sample code should be:

$c = new child;
$a = new aggrevator($c);



[2005-10-03 10:26:29] jason at jasonjustman dot com

still present:

(gdb) n
Single stepping until exit from function child_main,
which has no line number information.

Program received signal SIGSEGV, Segmentation fault.
0xfef36f20 in zend_objects_clone_obj (zobject=0xff3fffc8) at
/export/apache/php5-200510030630/Zend/zend_objects.c:167
167 new_obj_val = zend_objects_new(new_object,
old_object-ce TSRMLS_CC);
(gdb) backtrace
#0  0xfef36f20 in zend_objects_clone_obj (zobject=0xff3fffc8) at
/export/apache/php5-200510030630/Zend/zend_objects.c:167
#1  0xfef36de0 in zval_add_ref_or_clone (p=0x0) at
/export/apache/php5-200510030630/Zend/zend_objects.c:129

sniped



[2005-10-03 10:06:07] [EMAIL PROTECTED]

Please try using this CVS snapshot:

  http://snaps.php.net/php5-latest.tar.gz
 
For Windows:
 
  http://snaps.php.net/win32/php5-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/34712

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


#33698 [Bgs]: Conflicts with multiple interfaces sharing common method names

2005-07-15 Thread jason at hybd dot net
 ID:   33698
 User updated by:  jason at hybd dot net
 Reported By:  jason at hybd dot net
 Status:   Bogus
 Bug Type: Feature/Change Request
 Operating System: *
 PHP Version:  5.0.4
 New Comment:

I know PHP != Java, but surely this sort of stuff should be documented?
Most people will expect interfaces to work like Java interfaces or C++
interfaces (Pure virtual abstract methods), as many other languages
seem to follow this behaviour. As I said this is debatable as it
depends how you look at things, and likewise it is fairly easy to work
round this issue.


Previous Comments:


[2005-07-15 12:44:04] [EMAIL PROTECTED]

PHP != Java



[2005-07-14 17:35:15] jason at hybd dot net

Description:

This is debateable if this is a bug or not. Personally, I don't regard
it as a bug.

Classes that implement 1 interface that share common methods raise
fatal errors. Because of the abstract nature of interfaces, no error or
warning should be rasied.

I know PHP  Java, but Java doesn't raise any errors, and PHP5's OO
model is very close to Java's

Reproduce code:
---
interface FirstInterface
{
function execute();
}

interface SecondInterface
{
function execute();
}

class MyClass implements FirstInterface, SecondInterface
{
function execute()
{
echo Hello World;
}
}

$obj = new MyClass();
$obj-execute();

Expected result:

Hello World

Actual result:
--
Can't inherit abstract function SecondInterface::execute()





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


#33698 [NEW]: Conflicts with multiple interfaces sharing common method names

2005-07-14 Thread jason at hybd dot net
From: jason at hybd dot net
Operating system: Irrelevent
PHP version:  5.0.4
PHP Bug Type: Scripting Engine problem
Bug description:  Conflicts with multiple interfaces sharing common method names

Description:

This is debateable if this is a bug or not. Personally, I don't regard it
as a bug.

Classes that implement 1 interface that share common methods raise fatal
errors. Because of the abstract nature of interfaces, no error or warning
should be rasied.

I know PHP  Java, but Java doesn't raise any errors, and PHP5's OO model
is very close to Java's

Reproduce code:
---
interface FirstInterface
{
function execute();
}

interface SecondInterface
{
function execute();
}

class MyClass implements FirstInterface, SecondInterface
{
function execute()
{
echo Hello World;
}
}

$obj = new MyClass();
$obj-execute();

Expected result:

Hello World

Actual result:
--
Can't inherit abstract function SecondInterface::execute()

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


#33673 [Fbk-Opn]: File upload error reporting incorrectly

2005-07-13 Thread jason at code820 dot com
 ID:   33673
 User updated by:  jason at code820 dot com
 Reported By:  jason at code820 dot com
-Status:   Feedback
+Status:   Open
 Bug Type: Apache2 related
 Operating System: Linux
 PHP Version:  5.0.4
 New Comment:

Upgrading to 5.1.0-dev did NOT fix the problem unfortunately.


Previous Comments:


[2005-07-13 09:39:08] [EMAIL PROTECTED]

Please try using this CVS snapshot:

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





[2005-07-13 01:12:22] jason at code820 dot com

Description:

On file upload $_FILES['userfile']['error'] is expecting to return an
error when a file is only partially uploaded. However, it returns 0
(upload successful) on each try.

We have uploaded everything from 4 meg files to 250 meg files and we
cancel them mid-transfer and we are still getting a 0 returned.

This is very similar to this bug here:

http://bugs.php.net/bug.php?id=19556

Actually, almost the same thing, just with a newer version of PHP.

We have tried with single uploads as well as multiple uploads with the
same results.

Setup is:

PHP 5.0.4
Apache 2.0.54
eAccelerator 0.9.2
(did it with eAccelerator turned ON and turned OFF, same result)

Apache configure:
./configure --enable-mods-shared=all --enable-ssl

PHP configure:
'./configure' '--with-apxs2=/usr/local/apache2/bin/apxs' '--with-pgsql'
'--with-mysql' '--enable-bcmath' '--with-mcrypt=/usr/local'
'--with-zlib=/usr/' '--with-mime-magic' '--enable-exif'
'--with-curl=/usr/local' '--with-openssl' '--enable-sockets'
'--enable-mbstring' '--enable-sigchild'


php.ini has been altered to accept larger files on upload/post/etc.

Reproduce code:
---
// upload form
form name=myform method=post action=?php echo
$_SERVER['PHP_SELF']; ? enctype=multipart/form-data

Image 1: input type=file name=THEFILE size=30

// end upload form



// process script
?php
$m = print_r($_FILE, TRUE);
mail([EMAIL PROTECTED], DEBUG, $m);
?

Mail message contains:
Array
(
[THEFILE] = Array
(
[name] = IMG_0138.JPG
[type] = image/jpeg
[tmp_name] = /usr/local/web/tmp/phpmGnzHe
[error] = 0
[size] = 3581591
)

)

Expected result:

Expect to see [THEFILE][error] = 3



Actual result:
--
Array
(
[THEFILE] = Array
(
[name] = IMG_0138.JPG
[type] = image/jpeg
[tmp_name] = /usr/local/web/tmp/phpmGnzHe
[error] = 0
[size] = 3581591
)

)

Actual size of the file on the server is 3040870, NOT 3581591





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


#33673 [Com]: File upload error reporting partial uploads incorrectly

2005-07-13 Thread jason at burfield dot com
 ID:   33673
 Comment by:   jason at burfield dot com
 Reported By:  jason at code820 dot com
 Status:   Analyzed
 Bug Type: Apache2 related
 Operating System: *
 PHP Version:  5CVS, 4CVS (2005-07-13)
 New Comment:

Ok...can the docs be updated for this? Might save someone a lot of time
in the future.

Also...will future versions of PHP support partial upload detetction?

Thanks.


Previous Comments:


[2005-07-13 19:51:28] [EMAIL PROTECTED]

This is really a bug, or rather a mixed up error:
'UPLOAD_ERR_PARTIAL' should be 'UPLOAD_ERR_PARTIAL_WRITE'

We actually don't have an error for partial uploads at the moment.




[2005-07-13 01:12:22] jason at code820 dot com

Description:

On file upload $_FILES['userfile']['error'] is expecting to return an
error when a file is only partially uploaded. However, it returns 0
(upload successful) on each try.

We have uploaded everything from 4 meg files to 250 meg files and we
cancel them mid-transfer and we are still getting a 0 returned.

This is very similar to this bug here:

http://bugs.php.net/bug.php?id=19556

Actually, almost the same thing, just with a newer version of PHP.

We have tried with single uploads as well as multiple uploads with the
same results.

Setup is:

PHP 5.0.4
Apache 2.0.54
eAccelerator 0.9.2
(did it with eAccelerator turned ON and turned OFF, same result)

Apache configure:
./configure --enable-mods-shared=all --enable-ssl

PHP configure:
'./configure' '--with-apxs2=/usr/local/apache2/bin/apxs' '--with-pgsql'
'--with-mysql' '--enable-bcmath' '--with-mcrypt=/usr/local'
'--with-zlib=/usr/' '--with-mime-magic' '--enable-exif'
'--with-curl=/usr/local' '--with-openssl' '--enable-sockets'
'--enable-mbstring' '--enable-sigchild'


php.ini has been altered to accept larger files on upload/post/etc.

Reproduce code:
---
// upload form
form name=myform method=post action=?php echo
$_SERVER['PHP_SELF']; ? enctype=multipart/form-data

Image 1: input type=file name=THEFILE size=30

// end upload form



// process script
?php
$m = print_r($_FILE, TRUE);
mail([EMAIL PROTECTED], DEBUG, $m);
?

Mail message contains:
Array
(
[THEFILE] = Array
(
[name] = IMG_0138.JPG
[type] = image/jpeg
[tmp_name] = /usr/local/web/tmp/phpmGnzHe
[error] = 0
[size] = 3581591
)

)

Expected result:

Expect to see [THEFILE][error] = 3



Actual result:
--
Array
(
[THEFILE] = Array
(
[name] = IMG_0138.JPG
[type] = image/jpeg
[tmp_name] = /usr/local/web/tmp/phpmGnzHe
[error] = 0
[size] = 3581591
)

)

Actual size of the file on the server is 3040870, NOT 3581591





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


#33673 [NEW]: File upload error reporting incorrectly

2005-07-12 Thread jason at code820 dot com
From: jason at code820 dot com
Operating system: Linux
PHP version:  5.0.4
PHP Bug Type: Scripting Engine problem
Bug description:  File upload error reporting incorrectly

Description:

On file upload $_FILES['userfile']['error'] is expecting to return an
error when a file is only partially uploaded. However, it returns 0
(upload successful) on each try.

We have uploaded everything from 4 meg files to 250 meg files and we
cancel them mid-transfer and we are still getting a 0 returned.

This is very similar to this bug here:

http://bugs.php.net/bug.php?id=19556

Actually, almost the same thing, just with a newer version of PHP.

We have tried with single uploads as well as multiple uploads with the
same results.

Setup is:

PHP 5.0.4
Apache 2.0.54
eAccelerator 0.9.2
(did it with eAccelerator turned ON and turned OFF, same result)

Apache configure:
./configure --enable-mods-shared=all --enable-ssl

PHP configure:
'./configure' '--with-apxs2=/usr/local/apache2/bin/apxs' '--with-pgsql'
'--with-mysql' '--enable-bcmath' '--with-mcrypt=/usr/local'
'--with-zlib=/usr/' '--with-mime-magic' '--enable-exif'
'--with-curl=/usr/local' '--with-openssl' '--enable-sockets'
'--enable-mbstring' '--enable-sigchild'


php.ini has been altered to accept larger files on upload/post/etc.

Reproduce code:
---
// upload form
form name=myform method=post action=?php echo $_SERVER['PHP_SELF'];
? enctype=multipart/form-data

Image 1: input type=file name=THEFILE size=30

// end upload form



// process script
?php
$m = print_r($_FILE, TRUE);
mail([EMAIL PROTECTED], DEBUG, $m);
?

Mail message contains:
Array
(
[THEFILE] = Array
(
[name] = IMG_0138.JPG
[type] = image/jpeg
[tmp_name] = /usr/local/web/tmp/phpmGnzHe
[error] = 0
[size] = 3581591
)

)

Expected result:

Expect to see [THEFILE][error] = 3



Actual result:
--
Array
(
[THEFILE] = Array
(
[name] = IMG_0138.JPG
[type] = image/jpeg
[tmp_name] = /usr/local/web/tmp/phpmGnzHe
[error] = 0
[size] = 3581591
)

)

Actual size of the file on the server is 3040870, NOT 3581591

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


#33643 [NEW]: Fatal error: Only variables can be passed by reference

2005-07-11 Thread Jason at hybd dot net
From: Jason at hybd dot net
Operating system: 
PHP version:  5.1.0b2
PHP Bug Type: Scripting Engine problem
Bug description:  Fatal error: Only variables can be passed by reference 

Description:

This bug is a rehash of 33516, but I can't reopen as I'm not the original
author.

It seems like you can not pass tempories to function / method parameters.

?php

class Foo {
public static function bar() {
return array('a' = '1234567890');
}
}

$tmp = Foo::bar();
$var = array_pop($tmp);

?

Seems to work, but it shouldn't be down to the PHP user (imho) to
implement this as this change in PHP 5.1 breaks a lot of existing code.

Reproduce code:
---
?php

class Foo {
public static function bar() {
return array('a' = '1234567890');
}
}

$var = array_pop(Foo::bar());

?

Expected result:

$var = '1234567890';
Foo::bar() gets placed in temporary variable

Actual result:
--
Fatal error: Only variables can be passed by reference 

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


#33643 [Bgs-Opn]: Fatal error: Only variables can be passed by reference

2005-07-11 Thread Jason at hybd dot net
 ID:  33643
 User updated by: Jason at hybd dot net
 Reported By: Jason at hybd dot net
-Status:  Bogus
+Status:  Open
 Bug Type:Scripting Engine problem
 PHP Version: 5.1.0b2
 New Comment:

Sorry, it's all fair and well making this bogus, but this change breaks
LOADS of existing code, so it is not a bug and it's behavior is
NOT documented. The least you could have done is justify why this is
not a bug and why this change was introduced into the language!

This is really a PHP bug because thi has worked in all versions of PHP
prior to this. There has been nothing in the way of warning or anything
in recent releases to phase in this change in behaviour like there was
with the call by reference thing.

Do you expect many thousands of programmers to change their code
because if this stupid querk.


Previous Comments:


[2005-07-11 17:32:30] [EMAIL PROTECTED]

Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at
http://www.php.net/manual/ and the instructions on how to report
a bug at http://bugs.php.net/how-to-report.php

.



[2005-07-11 13:06:46] Jason at hybd dot net

Description:

This bug is a rehash of 33516, but I can't reopen as I'm not the
original author.

It seems like you can not pass tempories to function / method
parameters.

?php

class Foo {
public static function bar() {
return array('a' = '1234567890');
}
}

$tmp = Foo::bar();
$var = array_pop($tmp);

?

Seems to work, but it shouldn't be down to the PHP user (imho) to
implement this as this change in PHP 5.1 breaks a lot of existing code.

Reproduce code:
---
?php

class Foo {
public static function bar() {
return array('a' = '1234567890');
}
}

$var = array_pop(Foo::bar());

?

Expected result:

$var = '1234567890';
Foo::bar() gets placed in temporary variable

Actual result:
--
Fatal error: Only variables can be passed by reference 





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


#32963 [Fbk-Opn]: Hard to find/trace Segfault issues

2005-05-10 Thread Jason at hybd dot net
 ID:   32963
 User updated by:  Jason at hybd dot net
 Reported By:  Jason at hybd dot net
-Status:   Feedback
+Status:   Open
 Bug Type: Reproducible crash
 Operating System: CentOS 4 / RHEL 3
 PHP Version:  5CVS-2005-05-06 (dev)
 New Comment:

in what way?

In the template system I started to play about with, I did use
reference operators explictly, much like PHP4. However, since then I
haven't used them in other bits of code. I did find that occasionally
that using the reference operators did screw things up a while back,
and I have had issues such as the one in at
http://bugs.php.net/bug.php?id=32745. However the points in which I
have used the reference operator, they have nearly always been dealing
with objects, and not POD types such as string/int/float types, and
therefore would be naturally be passed by reference regardless of there
being a reference operator.

Out of interest, what way do references affect things internally?


Previous Comments:


[2005-05-09 23:11:38] [EMAIL PROTECTED]

Are you using references extensively?



[2005-05-09 19:47:01] Jason at hybd dot net

There seems to be no way I can reduce this bug down to a few lines. I
can only think some eariler piece of code triggers some sort of memory
corruption. I've tried with a test script, fiddling about with things
like scopes and making circlar references, thinking maybe that was to
do with it (seeing as it's destruction call to the offset that seems to
be creating the problem, from what I can make out in the src)

Although I don't think it's the same thing as (Certainly I had some
code that was doing what was said in these bugs, but it seems like it
works now, which makes me believe the bugs below are different,
although the behaviour is rather similar at times)...

http://bugs.php.net/bug.php?id=30346
OR
http://bugs.php.net/bug.php?id=32252

It is very similar. The issue is to do with offsetGet(). Frame 5 of the
dump seems to the most likely problem area.



[2005-05-09 15:17:20] Jason at hybd dot net

In a worst case scenario (if I can't get a small test script
developed), would it be OK to email you with access details to the
scripts/server so you can investigate for yourself. I can give you
suitable SSH access to our testing box. That way you can do what you
want in the way of running gdb, recompiling etc if need be.



[2005-05-09 11:38:38] [EMAIL PROTECTED]

We can't do much without a script to reproduce it ourselves, so try
come up with one..




[2005-05-09 11:28:08] jason at amp-design dot net

I normally do try and isolate bugs in PHP by producing a short few
lines of PHP in order to replicate the problem.

I have tried on many occasions when I have had this bug to replicate it
by stripping parts of the code down, but I have not managed to do it
sucessfully yet. Is there any other way I can profide feedback? I could
probably try and limit the amount code down to some extent, but even so
I doubt it would be a small chunk of code.

Anyway, I will attempt to find a way to replicate this as soon as I can
get time.



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

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


#32963 [Opn]: Hard to find/trace Segfault issues

2005-05-10 Thread Jason at hybd dot net
 ID:   32963
 User updated by:  Jason at hybd dot net
 Reported By:  Jason at hybd dot net
 Status:   Open
 Bug Type: Reproducible crash
 Operating System: CentOS 4 / RHEL 3
 PHP Version:  5CVS-2005-05-06 (dev)
 New Comment:

Hi Derick,

You're a ledgend! I was having to do some changes to some of the code
that was crashing. Funnily enough I changed some and decided I'd use a
reference to an array element. All of a sudden the segfaults returned,
and I did a backtrace on our live server (for some reason, probably
relating to my clumsiness, the test box doesn't give us backtraces
despite compiling with --enable-debug). The backtrace gives exactly the
same results.

It seems the segfault does not happen though until further down in the
program. I would guess it does it where some of the ArrayAccess stuff
is used.

I'll see if I can develop a test script again to reproduce this bug,
now I have a clearer idea what seems to be causing it.


Previous Comments:


[2005-05-10 11:30:58] Jason at hybd dot net

in what way?

In the template system I started to play about with, I did use
reference operators explictly, much like PHP4. However, since then I
haven't used them in other bits of code. I did find that occasionally
that using the reference operators did screw things up a while back,
and I have had issues such as the one in at
http://bugs.php.net/bug.php?id=32745. However the points in which I
have used the reference operator, they have nearly always been dealing
with objects, and not POD types such as string/int/float types, and
therefore would be naturally be passed by reference regardless of there
being a reference operator.

Out of interest, what way do references affect things internally?



[2005-05-09 23:11:38] [EMAIL PROTECTED]

Are you using references extensively?



[2005-05-09 19:47:01] Jason at hybd dot net

There seems to be no way I can reduce this bug down to a few lines. I
can only think some eariler piece of code triggers some sort of memory
corruption. I've tried with a test script, fiddling about with things
like scopes and making circlar references, thinking maybe that was to
do with it (seeing as it's destruction call to the offset that seems to
be creating the problem, from what I can make out in the src)

Although I don't think it's the same thing as (Certainly I had some
code that was doing what was said in these bugs, but it seems like it
works now, which makes me believe the bugs below are different,
although the behaviour is rather similar at times)...

http://bugs.php.net/bug.php?id=30346
OR
http://bugs.php.net/bug.php?id=32252

It is very similar. The issue is to do with offsetGet(). Frame 5 of the
dump seems to the most likely problem area.



[2005-05-09 15:17:20] Jason at hybd dot net

In a worst case scenario (if I can't get a small test script
developed), would it be OK to email you with access details to the
scripts/server so you can investigate for yourself. I can give you
suitable SSH access to our testing box. That way you can do what you
want in the way of running gdb, recompiling etc if need be.



[2005-05-09 11:38:38] [EMAIL PROTECTED]

We can't do much without a script to reproduce it ourselves, so try
come up with one..




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

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


#32963 [Fbk-Opn]: Hard to find/trace Segfault issues

2005-05-09 Thread jason at amp-design dot net
 ID:   32963
 User updated by:  jason at amp-design dot net
 Reported By:  jason at amp-design dot net
-Status:   Feedback
+Status:   Open
 Bug Type: Reproducible crash
 Operating System: CentOS 4 / RHEL 3
 PHP Version:  5CVS-2005-05-06 (dev)
 New Comment:

I normally do try and isolate bugs in PHP by producing a short few
lines of PHP in order to replicate the problem.

I have tried on many occasions when I have had this bug to replicate it
by stripping parts of the code down, but I have not managed to do it
sucessfully yet. Is there any other way I can profide feedback? I could
probably try and limit the amount code down to some extent, but even so
I doubt it would be a small chunk of code.

Anyway, I will attempt to find a way to replicate this as soon as I can
get time.


Previous Comments:


[2005-05-07 05:48:04] [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 ?php and ends 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.





[2005-05-06 16:05:48] jason at amp-design dot net

OK, I've tried to narrow down things a little more. This is not proving
easy.

OK, I can see why this is making things crash according to different
browsers. I have a piece of code like this ...

/**
 * Extracts path data from URL into a string.
 *
 * This will attempt to read the path data from many locations, 
 * such as after the .php part of the URL, the path request variable
 * or from the site root.
 */
function iq_extract_path() {
if (!isset($_REQUEST['path'])) {
/* try to extract it from URL */
$path_string = $_SERVER['REQUEST_URI'];
/* Are we hiding the .php file ? */
if (strpos($_SERVER['SCRIPT_NAME'], '.php') !== false) {
/* Remove the index or whatever .php bit */ 
$path_string = preg_replace('/\/[\w]+.php/', '', 
$path_string);
}
/* We need to trim on / or it replaces '/' if we are running 
from
root dir */
$prefix_path = trim(dirname($_SERVER['SCRIPT_NAME']), '/');
/* Remove any prefixed URL path */
$path_string = str_replace($prefix_path, '', $path_string);
/* remove query string */
$path_string = str_replace('?'.$_SERVER['QUERY_STRING'], '',
$path_string);
} else {
$path_string = $_REQUEST['path'];
}
return $path_string;
}

As you can see, this looks at server variables, which explains that. On
the site it's used, it allows us to use a clean search engine / user
friendly URL system, instead of using HTTP GET/POST variables for the
front controller's dispatching. If no server variables are used, it
looks at $_REQUEST['path'] as a safety fallback.

I found that setting $_REQUEST['path'] to the right value (so it
doesn't touch the $_SERVER array) stops the segfault.

The segfault it's self is because of the SPL. I'm 99.9% sure of
this. zend_execute.c:1205 confirms this, and other scenarios where I
get segfaults normally involve SPL ArrayAccess objects.

We use a template system, which is modelled as an object. This
implements the ArrayAccess interface, so it makes it easy to set
variables. It's initialized like this ...

$payment_schedule = new IQ_Template('admin/payment_schedule.xml');

we can poke data in like this...

$payment_schedule['schedule_year'] = $year;

likewise, there is some system in place where we can write custom web
controls so it behaves like WACT / ASP.NETs template system.

Anyway, I found another way to prevent the crash, instead of setting
$_REQUEST['path'] was to place ...

$payment_schedule = 'insert random string here';

before the line 

$payment_schedule = new IQ_Template('admin/payment_schedule.xml');

Despite the fact the additional line does nothing, it stops the
segfault. I tried this after realising that the issue was related with
a decreasing reference count due to _zval_ptr_dtor() being called.

I can't say this always happens always when assignments are made
between two objects implementing ArrayAccess through the [] subscripts.
However it does appear that there is always an ArrayAccess object with a
[] subscript the left of the assignment operator at the point of the
segfault.

Obviously this seems like a memory management issue at the heart of the
variable managment / Zend engine's object overloading system, which
explains it's complex, tricky nature as far as tracing

#32983 [NEW]: Bogus error message when using ArrayAccess / References

2005-05-09 Thread jason at amp-design dot net
From: jason at amp-design dot net
Operating system: Cent OS 4
PHP version:  5CVS-2005-05-09 (dev)
PHP Bug Type: Zend Engine 2 problem
Bug description:  Bogus error message when using ArrayAccess / References

Description:

I'm not 100% sure this is considered a bug as such, anyway, I thought
I'd point it out, and let you decide. It's more a case of the error
message being a little fuzzy.

When trying to assign an item by reference by using the reference
operator, , to an element inside a class that implements ArrayAccess
produces a werid error message.

Admittedly, the code I've provided is probably not valid PHP code, because
the nature of the ArrayAccess interface means that data is assigned and
returned from offsetSet and offsetGet by value, so using refernces should
probably not work.

However, the when you do try this, you get an error about about post/pre
increment/decrement. I'm not sure what this refers to, but it doesn't seem
to be very descriptive.

Reproduce code:
---
?php

class ArrayAccessImpl implements ArrayAccess {
private $data = array();

public function offsetUnset($index) {}

public function offsetSet($index, $value) {
$this-data[$index] = $value;
}

public function offsetGet($index) {
return $this-data[$index];
}

public function offsetExists($index) {
return isset($this-data[$index]);
}
}

$data = new ArrayAccessImpl();
$test = 'some data';
$data['element'] = $test;

?

Expected result:

Unsure, probably an error message relating to the fact ArrayAccess objects
can not assign by reference

Actual result:
--
Fatal error: Objects used as arrays in post/pre increment/decrement must
return values by reference

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


#32963 [Fbk-Opn]: Hard to find/trace Segfault issues

2005-05-09 Thread Jason at hybd dot net
 ID:   32963
 User updated by:  Jason at hybd dot net
-Reported By:  jason at amp-design dot net
+Reported By:  Jason at hybd dot net
-Status:   Feedback
+Status:   Open
 Bug Type: Reproducible crash
 Operating System: CentOS 4 / RHEL 3
 PHP Version:  5CVS-2005-05-06 (dev)
 New Comment:

In a worst case scenario (if I can't get a small test script
developed), would it be OK to email you with access details to the
scripts/server so you can investigate for yourself. I can give you
suitable SSH access to our testing box. That way you can do what you
want in the way of running gdb, recompiling etc if need be.


Previous Comments:


[2005-05-09 11:38:38] [EMAIL PROTECTED]

We can't do much without a script to reproduce it ourselves, so try
come up with one..




[2005-05-09 11:28:08] jason at amp-design dot net

I normally do try and isolate bugs in PHP by producing a short few
lines of PHP in order to replicate the problem.

I have tried on many occasions when I have had this bug to replicate it
by stripping parts of the code down, but I have not managed to do it
sucessfully yet. Is there any other way I can profide feedback? I could
probably try and limit the amount code down to some extent, but even so
I doubt it would be a small chunk of code.

Anyway, I will attempt to find a way to replicate this as soon as I can
get time.



[2005-05-07 05:48:04] [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 ?php and ends 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.





[2005-05-06 16:05:48] jason at amp-design dot net

OK, I've tried to narrow down things a little more. This is not proving
easy.

OK, I can see why this is making things crash according to different
browsers. I have a piece of code like this ...

/**
 * Extracts path data from URL into a string.
 *
 * This will attempt to read the path data from many locations, 
 * such as after the .php part of the URL, the path request variable
 * or from the site root.
 */
function iq_extract_path() {
if (!isset($_REQUEST['path'])) {
/* try to extract it from URL */
$path_string = $_SERVER['REQUEST_URI'];
/* Are we hiding the .php file ? */
if (strpos($_SERVER['SCRIPT_NAME'], '.php') !== false) {
/* Remove the index or whatever .php bit */ 
$path_string = preg_replace('/\/[\w]+.php/', '', 
$path_string);
}
/* We need to trim on / or it replaces '/' if we are running 
from
root dir */
$prefix_path = trim(dirname($_SERVER['SCRIPT_NAME']), '/');
/* Remove any prefixed URL path */
$path_string = str_replace($prefix_path, '', $path_string);
/* remove query string */
$path_string = str_replace('?'.$_SERVER['QUERY_STRING'], '',
$path_string);
} else {
$path_string = $_REQUEST['path'];
}
return $path_string;
}

As you can see, this looks at server variables, which explains that. On
the site it's used, it allows us to use a clean search engine / user
friendly URL system, instead of using HTTP GET/POST variables for the
front controller's dispatching. If no server variables are used, it
looks at $_REQUEST['path'] as a safety fallback.

I found that setting $_REQUEST['path'] to the right value (so it
doesn't touch the $_SERVER array) stops the segfault.

The segfault it's self is because of the SPL. I'm 99.9% sure of
this. zend_execute.c:1205 confirms this, and other scenarios where I
get segfaults normally involve SPL ArrayAccess objects.

We use a template system, which is modelled as an object. This
implements the ArrayAccess interface, so it makes it easy to set
variables. It's initialized like this ...

$payment_schedule = new IQ_Template('admin/payment_schedule.xml');

we can poke data in like this...

$payment_schedule['schedule_year'] = $year;

likewise, there is some system in place where we can write custom web
controls so it behaves like WACT / ASP.NETs template system.

Anyway, I found another way to prevent the crash, instead of setting
$_REQUEST['path'] was to place ...

$payment_schedule = 'insert random string here';

before the line 

$payment_schedule = new IQ_Template('admin/payment_schedule.xml

  1   2   3   >