#24024 [Com]: Vulnerability in phpinfo()

2004-08-08 Thread grangeway at blueyonder dot co dot uk
 ID:   24024
 Comment by:   grangeway at blueyonder dot co dot uk
 Reported By:  rich dot fearn at btopenworld dot com
 Status:   Bogus
 Bug Type: *General Issues
 Operating System: Linux
 PHP Version:  4.3.1
 New Comment:

Rasmus, you filter or more convert  to lt; for some strings, (i.e.
for ~6 strings), but not for _SERVER[argv].

If it is a debugging tool, then the filtering should be removed from
all strings? 

Otherwise surely argv should be handled in the same way as querystring,
_GET['test'] etc etc.

Having inconsistent output of the same string when debugging just
causes confusion.


Previous Comments:


[2003-06-04 13:06:02] [EMAIL PROTECTED]

phpinfo() is a debugging function.  It is not something that should be
publically accessible.  Adding filtering to it would make it much less
useful as a debugging tool.



[2003-06-04 12:42:54] rich dot fearn at btopenworld dot com

I've just received an e-mail about a vulnerability in the phpinfo()
function.

If phpinfo() is used in a page on a web site, a parameter containing
script can be passed to that page; that script will be executed.

For example, with the page:

?php
phpinfo();
?

stored as info.php, going to

http://website/info.php?test=scriptalert('Hello')/script

will cause the script to be executed, resulting in a pop-up containing
the message Hello.

The vulnerability is due to the fact that parameters are not encoded
when they are output in the 

_SERVER[argv]

section of phpinfo()'s output. (In the other parts of the output where
parameters are displayed,  and  characters are converted to the 
entities.)




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


#29570 [NEW]: phpinfo output inconsistent

2004-08-08 Thread grangeway at blueyonder dot co dot uk
From: grangeway at blueyonder dot co dot uk
Operating system: any
PHP version:  4.3.8
PHP Bug Type: Feature/Change Request
Bug description:  phpinfo output inconsistent

Description:

Bug #24024 discusses the fact that _SERVER[argv], does not convert html
entities e.g.  to lt; as phpinfo() is a debugging tool, and is marked as
bogus.

If this is the case, and content should not be escaped as phpinfo is for
debugging, then:
_SERVER[QUERY_STRING]/tdtd
class=vtest=lt;scriptgt;alert()lt;/scriptgt;/td/tr

should not escape  to lt; and should be consistent with the behaviour of
_SERVER['argv'].

At the moment, _SERVER['argv'] and GET['test'] / _SERVER[QUERY_STRING]/
etc show different representations of the same string, where in reality the
value is the same. 



Expected result:

Ideally All strings should be escaped.

If not (i.e. if this would hinder debugging), then no strings should be
escaped so that the output of any string in phpinfo matches the expected
value given when running var_dump on the variable.


-- 
Edit bug report at http://bugs.php.net/?id=29570edit=1
-- 
Try a CVS snapshot (php4):  http://bugs.php.net/fix.php?id=29570r=trysnapshot4
Try a CVS snapshot (php5):  http://bugs.php.net/fix.php?id=29570r=trysnapshot5
Fixed in CVS:   http://bugs.php.net/fix.php?id=29570r=fixedcvs
Fixed in release:   http://bugs.php.net/fix.php?id=29570r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=29570r=needtrace
Need Reproduce Script:  http://bugs.php.net/fix.php?id=29570r=needscript
Try newer version:  http://bugs.php.net/fix.php?id=29570r=oldversion
Not developer issue:http://bugs.php.net/fix.php?id=29570r=support
Expected behavior:  http://bugs.php.net/fix.php?id=29570r=notwrong
Not enough info:http://bugs.php.net/fix.php?id=29570r=notenoughinfo
Submitted twice:http://bugs.php.net/fix.php?id=29570r=submittedtwice
register_globals:   http://bugs.php.net/fix.php?id=29570r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=29570r=php3
Daylight Savings:   http://bugs.php.net/fix.php?id=29570r=dst
IIS Stability:  http://bugs.php.net/fix.php?id=29570r=isapi
Install GNU Sed:http://bugs.php.net/fix.php?id=29570r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=29570r=float


#29567 [Opn-Bgs]: PHP has encountered an Access Violation at 011573CD

2004-08-08 Thread edink
 ID:   29567
 Updated by:   [EMAIL PROTECTED]
 Reported By:  David at hostedby dot homeip dot net
-Status:   Open
+Status:   Bogus
 Bug Type: Unknown/Other Function
 Operating System: Windows server 2000
 PHP Version:  5.0.0
 New Comment:

Please search the bugs database before submitting new bug reports. The
issue has already been reported and fixed.


Previous Comments:


[2004-08-08 02:06:57] David at hostedby dot homeip dot net

Description:

This is possibly a mis-configured server, but I can not see anything
wrong.

The error appears on all pages that are using php.

System:Windows NT HOSTEDBY 5.0 build 2195  
Build Date Jul 13 2004 21:34:42  
Configure Command: cscript /nologo configure.js --enable- 
  snapshot-build --with-gd=shared  
Server API ISAPI  


Reproduce code:
---
http://www.hostedby.homeip.net/phpinfo.php






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


#29571 [NEW]: Many uploads will slow down Linux machine

2004-08-08 Thread k at ailis dot de
From: k at ailis dot de
Operating system: Linux
PHP version:  4.3.8
PHP Bug Type: Performance problem
Bug description:  Many uploads will slow down Linux machine

Description:

This is a mix of performance problem and feature request. So feel free
to reclassify this report as Feature request if you think it fits
better.

In a  large project we have the problem that many users are uploading many
large files to our PHP server. PHP can handle this very well but the
problem is, that all files are stored in the same directory. Our upload
directory sometimes contains more than 2 files. This produces high
loads because accessing these files is very I/O intensive because of the
flat directory hierarchy. 

You already have addressed this problem with session files by introducing
a directory depth. Its possible to use 2;/var/lib/php/uploads as
session.save_path which is a very nice feature. Exactly this feature would
be a cool thing if it were also implemented for upload_tmp_dir.

Here is a small patch as an example how this feature could be implemented.
We are using this patch on our servers and it works great. This patch not
only implements this feature for upload_tmp_dir but for all other modules
which are using the php_open_temporary_file() function.

--- php_open_temporary_file.c.orig  Sun Aug  8 14:29:06 2004
+++ php_open_temporary_file.c   Sun Aug  8 14:29:12 2004
@@ -106,6 +106,10 @@
 {
char *trailing_slash;
char *opened_path;
+   char *p;
+   char *sub_dirs;
+   size_t dirdepth, i;
+   int rand_value;
int fd = -1;
 #ifndef HAVE_MKSTEMP
int open_flags = O_CREAT | O_TRUNC | O_RDWR
@@ -125,6 +129,30 @@
if (!(opened_path = emalloc(MAXPATHLEN))) {
return -1;
}
+   
+   /* Check subdirectory depth and point p to real path name */
+   if ((p = strchr(path, ';')))
+   {
+   dirdepth = (size_t) strtol(path, NULL, 10);
+   p++;
+   }
+   else
+   {
+   dirdepth = 0;
+   p = (char *) path;
+   }
+
+   /* Build subdirectory tree if needed */
+   if (dirdepth) {
+   if (!(sub_dirs = emalloc(dirdepth * 2 + 1))) return -1;
+   sub_dirs[0] = 0;
+   for (i = 0; i  dirdepth; i++)
+   {
+   strcat(sub_dirs, x/);
+   rand_value = php_rand()  0xf;
+   sub_dirs[i * 2] = rand_value  10 ? rand_value + 48 : rand_value
+ 87;
+   }
+   } else sub_dirs = ;
 
if (IS_SLASH(path[strlen(path)-1])) {
trailing_slash = ;
@@ -132,7 +160,10 @@
trailing_slash = /;
}
 
-   (void)snprintf(opened_path, MAXPATHLEN, %s%s%sXX, path,
trailing_slash, pfx);
+   (void)snprintf(opened_path, MAXPATHLEN, %s%s%s%sXX, p,
trailing_slash, sub_dirs, pfx);
+   
+   /* Free memory if it was used */
+   if (dirdepth) efree(sub_dirs);
 
 #ifdef PHP_WIN32
if (GetTempFileName(path, pfx, 0, opened_path)) {
@@ -140,7 +171,7 @@
 * which means that opening it will fail... */
VCWD_CHMOD(opened_path, 0600);
fd = VCWD_OPEN_MODE(opened_path, open_flags, 0600);
-   }
+l1 }
 #elif defined(NETWARE)
/* Using standard mktemp() implementation for NetWare */
file_path = mktemp(opened_path);



-- 
Edit bug report at http://bugs.php.net/?id=29571edit=1
-- 
Try a CVS snapshot (php4):  http://bugs.php.net/fix.php?id=29571r=trysnapshot4
Try a CVS snapshot (php5):  http://bugs.php.net/fix.php?id=29571r=trysnapshot5
Fixed in CVS:   http://bugs.php.net/fix.php?id=29571r=fixedcvs
Fixed in release:   http://bugs.php.net/fix.php?id=29571r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=29571r=needtrace
Need Reproduce Script:  http://bugs.php.net/fix.php?id=29571r=needscript
Try newer version:  http://bugs.php.net/fix.php?id=29571r=oldversion
Not developer issue:http://bugs.php.net/fix.php?id=29571r=support
Expected behavior:  http://bugs.php.net/fix.php?id=29571r=notwrong
Not enough info:http://bugs.php.net/fix.php?id=29571r=notenoughinfo
Submitted twice:http://bugs.php.net/fix.php?id=29571r=submittedtwice
register_globals:   http://bugs.php.net/fix.php?id=29571r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=29571r=php3
Daylight Savings:   http://bugs.php.net/fix.php?id=29571r=dst
IIS Stability:  http://bugs.php.net/fix.php?id=29571r=isapi
Install GNU Sed:http://bugs.php.net/fix.php?id=29571r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=29571r=float


#25004 [Bgs]: Uploaded file name truncated if accent present

2004-08-08 Thread magnus
 ID:   25004
 Updated by:   [EMAIL PROTECTED]
 Reported By:  spud at nothingness dot org
 Status:   Bogus
 Bug Type: *Languages/Translation
 Operating System: RedHat 7.2
 PHP Version:  4.3.2
 New Comment:

Restore comment: 
[2004-07-23 21:12:44] apinstein at mac dot com 
 
Actually, it seems that Safari has a problem uploading  
files with non-latin filenames. In Safari 1.2 (Panther)  
the file is SKIPPED entirely from the upload's POST  
data. In Safari pre-1.2, (Jaguar) the filename is  
mangled a bit. 
 
I am pretty sure this isn't a PHP problem, but if anyone  
knows how to set up the HTML form to allow this it'd be  
great for everyone to know! 


Previous Comments:


[2003-08-11 11:34:45] spud at nothingness dot org

Correction: the problem persists in PHP 4.3.3RC3 with 
the (mac) Safari browser, but works in (mac) IE 5.2.3. 
Until further browser testing, I'll consider this 
bogus, assuming it's a browser issue with Safari 
only.



[2003-08-11 11:27:16] spud at nothingness dot org

Actually, the first rule of submitting a bug is check 
the database first, but point taken.

This problem still occurs with PHP 4.3.3RC3 on my 
machine, despite your results. See (http://
dev.dadaimc.org/test.php for test form and phpinfo() 
output)

The CVS snapshot (php4-200308111530) refuses to make on 
my machine, generating an error near the end (see 
below), so I can't test the CVS version:

/home/spud/src/php4-200308111530/ext/standard/
filestat.c:575: undefined reference to 
`php_check_open_basedir_ex'



[2003-08-10 11:11:55] [EMAIL PROTECTED]

Works fine with latest CVS (and with PHP 4.3.3RC3 too)
Bogusing since you failed the first rule of submitting a bug report:
Try the latest CVS snapshot first.




[2003-08-10 10:54:57] spud at nothingness dot org

Description:

On a standard form upload, if the user uploads a file 
with a name like épice.jpg (with an acute accent on 
the e), PHP reports the $_FILES[0]['name'] as foo_e, 
dropping the accent and ALL following characters, 
including the suffix.

I understand the perhaps the file upload can't handle 
the accented characters, but it seems incorrect to 
strip off the rest of the filename, including 
characters that are still legitimate.

I don't know if this is a PHP bug or not, but it seems 
very limiting for non-English file uploads, where 
accented characters in a filename are common.

Reproduce code:
---
Example: with a page like

html
head
meta http-equiv=content-type content=text/html; charset=utf-8
/head
body
form action=test.php method=post enctype=multipart/form-data
input type=file name=upload
input type=submit name=submit value=submit
/form

?
if (isset($_POST['submit'])) {
print_r($_FILES);
}
?

upload a file named épice.jpg, and PHP will report the filename as
e.

Expected result:

I expect $_FILES[0]['name'] to be épice.jpg, or at 
least epice.jpg.

Actual result:
--
Filename reported as e.





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


#29366 [Csd-Bgs]: Change in error_reporting behavior

2004-08-08 Thread magnus
 ID:   29366
 Updated by:   [EMAIL PROTECTED]
 Reported By:  nbi at gmx dot de
-Status:   Closed
+Status:   Bogus
 Bug Type: PHP options/info functions
 Operating System: Windows XP
 PHP Version:  4.3.8
 New Comment:

Not a bug. 


Previous Comments:


[2004-07-28 23:21:45] nbi at gmx dot de

Yes, indead: mysql.trace_mode = Off solved the problem.
However, mysql.trace_mode could be ON up to PHP 4.3.6 without having
any apparent effect, though.
Thanks for your help.



[2004-07-27 23:45:59] evan at fusion-zero dot com

In php.ini, you probably have mysql.trace.mode set to On
You need to set it to Off, just like this.

; Trace mode. When trace_mode is active (=On), warnings for table/index
scans and
; SQL-Erros will be displayed.
mysql.trace_mode = Off



[2004-07-24 21:11:59] nbi at gmx dot de

Description:

There seems to be a change in error_reporting(), that came up from PHP
4.3.6 to 4.3.7:

Setting error_reporting(0) did NOT display a warning like 
Warning: mysql_query(): Your query requires a full tablescan (table
xyz, 4 rows affected). Use EXPLAIN to optimize your query. in xyz.php
on line 594

With PHP 4.3.7 and 4.3.8 this warning is displayed, despite settings of
error_reporting(0) or ini_set ('error_reporting', 0)







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


#29423 [Opn-Ver]: reference count gets wrong when return-reference-calling a normal function

2004-08-08 Thread magnus
 ID:   29423
 Updated by:   [EMAIL PROTECTED]
 Reported By:  stefan at hotpaenz dot de
-Status:   Open
+Status:   Verified
 Bug Type: Zend Engine 2 problem
 Operating System: Linux 2.6.3
 PHP Version:  5CVS-2004-07-28 (dev)


Previous Comments:


[2004-07-28 10:59:58] stefan at hotpaenz dot de

Description:

See the code below: 
 
An object of ClassA is passed to FuncB, which calls FuncA 
with the return-by-reference operator. FuncA is not 
designed to return by reference. 
 
The reference count seems to get wrong by doing that so 
the object is discarded when FuncB returns. 
 

Reproduce code:
---
?php
class ClassA { }

function FuncA($obj) {
return $obj;
}

function FuncB($obj) {
$dummy = FuncA($obj);
}

$obj = new ClassA();
FuncB($obj);
$str='This is a string'
var_dump($obj);


Expected result:

object(ClassA)#1 (0) { } 
 

Actual result:
--
string(16) This is a string 
 





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


#29490 [Com]: 'Failed to instantiate .Net object' using PHP.NET docu example

2004-08-08 Thread christian at wenz dot org
 ID:   29490
 Comment by:   christian at wenz dot org
 Reported By:  mike at ziebeck dot net
 Status:   Closed
 Bug Type: COM related
 Operating System: Windows 2000
 PHP Version:  5.0.0
 New Comment:

I still get the error with
http://snaps.php.net/win32/php5-win32-200408081430.zip
mike at ziebeck dot net and matthias dot haldimann at epfl dot ch,
can you reproduce that?


Previous Comments:


[2004-08-08 01:03:49] [EMAIL PROTECTED]

This bug has been fixed in CVS.

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

Thanks to Michael Sisolak, this bug has been resolved.
Try the next snapshot.



[2004-08-07 22:40:23] christian at wenz dot org

FWIW, I can reproduce it with


Windowx XP Pro, German, SP1 + all available patches
with
PHP 5.1.0-dev, current snapshot as CGI and .NET Framework 1.1
IIS 5.1


Windowx XP Pro, German, SP1 + all available patches
with
PHP 5.1.0-dev, current snapshot as CGI and .NET Framework 1.1
Apache 1.3.31


Windowx XP Home, German, SP1 + all available patches
with
PHP 5.1.0-dev, current snapshot as CGI and .NET Framework 1.0SP1
Apache 2.0.50


Windowx XP Pro, German, SP1 + all available patches
with
PHP 5.1.0-dev, current snapshot as CGI and .NET Framework 1.0
IIS 5.1


I'll try to test it on more systems tomorrow.



[2004-08-05 09:25:19] mike at ziebeck dot net

I've additionaly tryed to get the example with:
PHP 5.1.0-dev (cli) (built: Aug  4 2004 08:29:44)
running on a development machine.

MS .NET Studio 2003 Enterprise Architect
MS .NET Frame Work SDK 1.1
MS Platform SDK February 2003

same results :(



[2004-08-05 08:14:14] matthias dot haldimann at epfl dot ch

Though this might not help a lot, it might still be interesting to note
that I continue to have the exact same problem, under

Windowx XP, English, SP1 + all available patches
with
PHP 5.1.0-dev, Snapshot Aug 5 2004 04:15:53 
and .NET Framework 1.1

Matthias



[2004-08-04 18:23:07] mike at ziebeck dot net

There's been a typo: 

c:\Programme\php\php5.php.ini
  is
c:\Programme\php\php5.ini

Sorry for that.
   mz.



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

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


#29573 [NEW]: Segmentation fault when php function(called from XSLT templat) throw exception

2004-08-08 Thread x-penguin at tut dot by
From: x-penguin at tut dot by
Operating system: Linux
PHP version:  5CVS-2004-08-08 (dev)
PHP Bug Type: XSLT related
Bug description:  Segmentation fault when php function(called from XSLT templat) throw 
exception

Description:

Child httpd process segfault, when php function(called from XSLT template)
throw exception, and when exception was throwed from steream wrapper, used
in XSLT template.

PHP Version 5.1.0-dev, configure with:
'./configure' '--prefix=/usr/' '--with-apxs2' '--with-gettext'
'--with-iconv' '--with-mysql' '--enable-mbstring=ru' '--enable-mbregex'
'--enable-mbstr-enc-trans' '--disable-short-tags' '--with-xsl'
'--with-libxml' '--without-sqlite' '--enable-soap'

libxslt Version 1.1.8
libxml Version  2.6.11
libexslt Version1.1.8

apache 2.0.48

Reproduce code:
---
?php
try {
function throwFunction() {
throw new Exception('exception messaage');
}

$xsl = new DomDocument();
$xsl-loadXML(
'?xml version=1.0 encoding=iso-8859-1 ?
xsl:stylesheet version=1.0
xmlns:xsl=http://www.w3.org/1999/XSL/Transform;
xmlns:php=http://php.net/xsl;
xsl:template match=/
xsl:value-of select=php:function(\'throwFunction\') /
/xsl:template
/xsl:stylesheet'
);

$xml = new DomDocument;
$xml-loadXML(
'?xml version=1.0 encoding=iso-8859-1 ?
null/null'
);

$proc = new XSLTProcessor();
$proc-registerPhpFunctions();
$proc-importStylesheet($xsl);

$dom = $proc-transformToDoc($xml);
} catch(Exception $exception) {
echo $exception;
}
?

Expected result:

exception 'Exception' with message 'exception messaage' in
/mnt/data/www/html/web/test.php:4
Stack trace:
#0 /mnt/data/www/html/web/test.php(27): XSLTProcessor-throwFunction()
#1 /mnt/data/www/html/web/test.php(27):
XSLTProcessor-transformToDoc(Object(DOMDocument))
#2 {main}

Actual result:
--
from apache error log:
[Sun Aug 08 18:55:33 2004] [notice] child pid 1337 exit signal
Segmentation fault (11)

-- 
Edit bug report at http://bugs.php.net/?id=29573edit=1
-- 
Try a CVS snapshot (php4):  http://bugs.php.net/fix.php?id=29573r=trysnapshot4
Try a CVS snapshot (php5):  http://bugs.php.net/fix.php?id=29573r=trysnapshot5
Fixed in CVS:   http://bugs.php.net/fix.php?id=29573r=fixedcvs
Fixed in release:   http://bugs.php.net/fix.php?id=29573r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=29573r=needtrace
Need Reproduce Script:  http://bugs.php.net/fix.php?id=29573r=needscript
Try newer version:  http://bugs.php.net/fix.php?id=29573r=oldversion
Not developer issue:http://bugs.php.net/fix.php?id=29573r=support
Expected behavior:  http://bugs.php.net/fix.php?id=29573r=notwrong
Not enough info:http://bugs.php.net/fix.php?id=29573r=notenoughinfo
Submitted twice:http://bugs.php.net/fix.php?id=29573r=submittedtwice
register_globals:   http://bugs.php.net/fix.php?id=29573r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=29573r=php3
Daylight Savings:   http://bugs.php.net/fix.php?id=29573r=dst
IIS Stability:  http://bugs.php.net/fix.php?id=29573r=isapi
Install GNU Sed:http://bugs.php.net/fix.php?id=29573r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=29573r=float


#27406 [Com]: php_check_syntax behavior

2004-08-08 Thread phpbug at bigredspark dot com
 ID:   27406
 Comment by:   phpbug at bigredspark dot com
 Reported By:  thomas at stauntons dot org
 Status:   Bogus
 Bug Type: Zend Engine 2 problem
 Operating System: OS X
 PHP Version:  5.0.0b4 (beta4)
 Assigned To:  iliaa
 New Comment:

Bogus? Could someone document this function so we know what the
proper usage is? Is this funtion meant to load the file into the
current scope as it's syntax is checked? If so, please say so in the
documentation. Otherwise, I have another bug report to file.

original.php
?php
$bool = php_check_syntax('checkme.php');
foo();
$bar = new Bar;
$bar-foo();
?

checkme.php
?php
function foo()
{ echo checkme::foo\n; }
class Bar {
function foo()
{ echo checkme::bar::foo\n; }
}
?

results in

checkme::foo
checkme::bar::foo

for example, when my assumption of how the function works should have
the code results in undefined function and class errors.


Previous Comments:


[2004-04-13 13:12:03] [EMAIL PROTECTED]

Don't misuse the function.




[2004-02-26 15:18:57] [EMAIL PROTECTED]

Ilia, maybe this function wasn't such a good idea after all?
Here's the first misuse of it already..




[2004-02-26 11:00:17] thomas at stauntons dot org

Description:

I am writing a class that will include another file 
containing a class that needs to implement a specific 
interface. When calling php_check_syntax on the file its 
behavious differs depending on whether or not the class 
implements my interface. If the file implements my 
interface the class will not show up in 
get_declared_classes() and an include() of the file will 
work, but if the class doesn't implement my interface the 
class will be in get_declared_classes() and the include 
will fail with 'cannot redeclareclass'

Reproduce code:
---
in Main.php
?php
interface MustImplement {}
if (!php_check_syntax('includeme.php'))
die('Bad Syntax\n');
else include('includeme.php');
?
in includeme.php (Case 1)
?php
class AClass implements MustImplement
{}
?
in includeme.php (Case 2)
?php
class AClass
{}
?

Expected result:

Case 1 of includeme.php will work OK, php_syntax_check will 
succeed and include will load the file OK, AClass will be 
available. 

Case 2 will fail, php_syntax_check will work but include 
will fail with 'cannot redeclare class'  Illegal 
Instruction

Actual result:
--
Just as Above. 





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


#29573 [Opn-Ver]: Segmentation fault when php function(called from XSLT templat) throw exception

2004-08-08 Thread chregu
 ID:   29573
 Updated by:   [EMAIL PROTECTED]
 Reported By:  x-penguin at tut dot by
-Status:   Open
+Status:   Verified
 Bug Type: XSLT related
 Operating System: Linux
 PHP Version:  5CVS-2004-08-08 (dev)
 New Comment:

That's not supposed to work this way ;)

I'm not sure, if we can pass exceptions from php function called within
XSLT back to the PHP script starting the transformation (we have libxml2
twice in the middle of that, that's the problem).

But of course, it shouldn't segfault and that's fixable. Expect a patch
for that soon






Previous Comments:


[2004-08-08 18:08:49] x-penguin at tut dot by

Description:

Child httpd process segfault, when php function(called from XSLT
template) throw exception, and when exception was throwed from steream
wrapper, used in XSLT template.

PHP Version 5.1.0-dev, configure with:
'./configure' '--prefix=/usr/' '--with-apxs2' '--with-gettext'
'--with-iconv' '--with-mysql' '--enable-mbstring=ru' '--enable-mbregex'
'--enable-mbstr-enc-trans' '--disable-short-tags' '--with-xsl'
'--with-libxml' '--without-sqlite' '--enable-soap'

libxslt Version 1.1.8
libxml Version  2.6.11
libexslt Version1.1.8

apache 2.0.48

Reproduce code:
---
?php
try {
function throwFunction() {
throw new Exception('exception messaage');
}

$xsl = new DomDocument();
$xsl-loadXML(
'?xml version=1.0 encoding=iso-8859-1 ?
xsl:stylesheet version=1.0
xmlns:xsl=http://www.w3.org/1999/XSL/Transform;
xmlns:php=http://php.net/xsl;
xsl:template match=/
xsl:value-of select=php:function(\'throwFunction\') /
/xsl:template
/xsl:stylesheet'
);

$xml = new DomDocument;
$xml-loadXML(
'?xml version=1.0 encoding=iso-8859-1 ?
null/null'
);

$proc = new XSLTProcessor();
$proc-registerPhpFunctions();
$proc-importStylesheet($xsl);

$dom = $proc-transformToDoc($xml);
} catch(Exception $exception) {
echo $exception;
}
?

Expected result:

exception 'Exception' with message 'exception messaage' in
/mnt/data/www/html/web/test.php:4
Stack trace:
#0 /mnt/data/www/html/web/test.php(27): XSLTProcessor-throwFunction()
#1 /mnt/data/www/html/web/test.php(27):
XSLTProcessor-transformToDoc(Object(DOMDocument))
#2 {main}

Actual result:
--
from apache error log:
[Sun Aug 08 18:55:33 2004] [notice] child pid 1337 exit signal
Segmentation fault (11)





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


#29574 [NEW]: FastCgi server can't be used with unix domain sockets

2004-08-08 Thread [EMAIL PROTECTED]
From: [EMAIL PROTECTED]
Operating system: Linux
PHP version:  5CVS-2004-08-08 (dev)
PHP Bug Type: CGI related
Bug description:  FastCgi server can't be used with unix domain sockets

Description:

The cgi module does not accept unix domain sockets as parameters to option
-b, as it will be prefixed by :.

This is needed so I don't have to revert to using iptables with owner
matching to set access restrictions for local users; but use
directory/file permissions.

Here's a patch against the latest CVS version to not prepend bindpath with
: when it looks like a file:

Index: sapi/cgi/cgi_main.c
===
RCS file: /repository/php-src/sapi/cgi/cgi_main.c,v
retrieving revision 1.256
diff -u -r1.256 cgi_main.c
--- sapi/cgi/cgi_main.c 14 Jul 2004 22:30:27 -  1.256
+++ sapi/cgi/cgi_main.c 8 Aug 2004 14:53:57 -
@@ -1130,7 +1130,7 @@
 * path (it's what the fastcgi library expects)
 */

-   if (strchr(bindpath, ':') == NULL) {
+   if ((strchr(bindpath, ':') == NULL)  (strchr(bindpath,
'/') == NULL)) {
char *tmp;

tmp = malloc(strlen(bindpath) + 2);


Reproduce code:
---
php -b /var/run/fastcgi/php4-someuser

Expected result:

Start a FastCgi server listening on /var/run/fastcgi/php4-someuser.

Actual result:
--
No server starting as :/var/run/fastcgi/php4-someuser is passed to
libfcgi.

-- 
Edit bug report at http://bugs.php.net/?id=29574edit=1
-- 
Try a CVS snapshot (php4):  http://bugs.php.net/fix.php?id=29574r=trysnapshot4
Try a CVS snapshot (php5):  http://bugs.php.net/fix.php?id=29574r=trysnapshot5
Fixed in CVS:   http://bugs.php.net/fix.php?id=29574r=fixedcvs
Fixed in release:   http://bugs.php.net/fix.php?id=29574r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=29574r=needtrace
Need Reproduce Script:  http://bugs.php.net/fix.php?id=29574r=needscript
Try newer version:  http://bugs.php.net/fix.php?id=29574r=oldversion
Not developer issue:http://bugs.php.net/fix.php?id=29574r=support
Expected behavior:  http://bugs.php.net/fix.php?id=29574r=notwrong
Not enough info:http://bugs.php.net/fix.php?id=29574r=notenoughinfo
Submitted twice:http://bugs.php.net/fix.php?id=29574r=submittedtwice
register_globals:   http://bugs.php.net/fix.php?id=29574r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=29574r=php3
Daylight Savings:   http://bugs.php.net/fix.php?id=29574r=dst
IIS Stability:  http://bugs.php.net/fix.php?id=29574r=isapi
Install GNU Sed:http://bugs.php.net/fix.php?id=29574r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=29574r=float


#29573 [Ver-Csd]: Segmentation fault when php function(called from XSLT templat) throw exception

2004-08-08 Thread chregu
 ID:   29573
 Updated by:   [EMAIL PROTECTED]
 Reported By:  x-penguin at tut dot by
-Status:   Verified
+Status:   Closed
 Bug Type: XSLT related
 Operating System: Linux
 PHP Version:  5CVS-2004-08-08 (dev)
 New Comment:

This bug has been fixed in CVS.

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

Fixed in PHP_5_0 branch as well.

And, surprisingly, the exceptions bubbles up to the calling
transformation function... Everything should now work as expected.



Previous Comments:


[2004-08-08 18:59:34] [EMAIL PROTECTED]

That's not supposed to work this way ;)

I'm not sure, if we can pass exceptions from php function called within
XSLT back to the PHP script starting the transformation (we have libxml2
twice in the middle of that, that's the problem).

But of course, it shouldn't segfault and that's fixable. Expect a patch
for that soon







[2004-08-08 18:08:49] x-penguin at tut dot by

Description:

Child httpd process segfault, when php function(called from XSLT
template) throw exception, and when exception was throwed from steream
wrapper, used in XSLT template.

PHP Version 5.1.0-dev, configure with:
'./configure' '--prefix=/usr/' '--with-apxs2' '--with-gettext'
'--with-iconv' '--with-mysql' '--enable-mbstring=ru' '--enable-mbregex'
'--enable-mbstr-enc-trans' '--disable-short-tags' '--with-xsl'
'--with-libxml' '--without-sqlite' '--enable-soap'

libxslt Version 1.1.8
libxml Version  2.6.11
libexslt Version1.1.8

apache 2.0.48

Reproduce code:
---
?php
try {
function throwFunction() {
throw new Exception('exception messaage');
}

$xsl = new DomDocument();
$xsl-loadXML(
'?xml version=1.0 encoding=iso-8859-1 ?
xsl:stylesheet version=1.0
xmlns:xsl=http://www.w3.org/1999/XSL/Transform;
xmlns:php=http://php.net/xsl;
xsl:template match=/
xsl:value-of select=php:function(\'throwFunction\') /
/xsl:template
/xsl:stylesheet'
);

$xml = new DomDocument;
$xml-loadXML(
'?xml version=1.0 encoding=iso-8859-1 ?
null/null'
);

$proc = new XSLTProcessor();
$proc-registerPhpFunctions();
$proc-importStylesheet($xsl);

$dom = $proc-transformToDoc($xml);
} catch(Exception $exception) {
echo $exception;
}
?

Expected result:

exception 'Exception' with message 'exception messaage' in
/mnt/data/www/html/web/test.php:4
Stack trace:
#0 /mnt/data/www/html/web/test.php(27): XSLTProcessor-throwFunction()
#1 /mnt/data/www/html/web/test.php(27):
XSLTProcessor-transformToDoc(Object(DOMDocument))
#2 {main}

Actual result:
--
from apache error log:
[Sun Aug 08 18:55:33 2004] [notice] child pid 1337 exit signal
Segmentation fault (11)





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


#25876 [Com]: session_start(): Failed to initialize storage module

2004-08-08 Thread ron at dse dot nl
 ID:   25876
 Comment by:   ron at dse dot nl
 Reported By:  golden at riscom dot com
 Status:   Closed
 Bug Type: Session related
 Operating System: freebsd 4.8
 PHP Version:  4.3.3
 New Comment:

Spent over a day troubleshooting as well. I think the real problem is
described here: http://bugs.php.net/bug.php?id=25753

Although the suggested bug fix over there seems to have been
incorporated in up to version 4.3.8, the behaviour still exists. The
bug is easily triggered by running Squirrelmail and Drupal off the same
Apache server as in my case. Drupal sets the session.save_handler to
'user' by a directive in the .htaccess file that comes with the
installation. If, by accident, the next request by the same Apache
child process is for a squirrelmail user, then the squirrelmail
session_start() fails with 'Failed to initialize storage module'. This
happens because the session.save_handler is still set to user instead
of file, it is not reset to the master value for the child process. It
is a matter of random luck which child process will serve the
squirrelmail request so that explains the intermittent occurance.

As mentioned by rasmus this only happens on text/html files with the
executable bit set. Clearing the bit for all of the squirrelmail PHP
files seems to be useful a workaround. Just perform a

find . -name '*.php' -type f -exec chmod -x {} ';'

in your squirrelmail (or other PHP application) directory and restart
your Apache server (for some reason this was necessary).


Previous Comments:


[2004-08-08 01:01:54] mail at ferryvink dot nl

Typo in the email address of my last post. ...



[2004-08-08 01:00:42] mail at ferryviuk dot nl

Got the Failed to initialize session module error as well. The
session.save_handler reset to files worked when I also restarted the
webserver! Seems logical but can easily be forgotten. Didn't see it in
al these posts. Hell, I almost installed a new and fresh php4.

hope it helps.

Cheers
FHV



[2004-07-07 12:15:12] jenokz at yahoo dot com

Hi,

Im using php4.3.7 on FreeBSD 4.10-STABLE.

The problem is session saved to /tmp but without values on it. I've try
recompile it and im still get this problem, session not works.

PS: /tmp is writeable and avaiable space on it.



[2004-07-04 16:22:56] paulridge at ukwsd dot com

We are experiencing this also on 4.3.3; RH9. tmp folder is chmod 777.

Our php is compiled as follows:


'./configure' '--with-apxs=/usr/local/apache/bin/apxs' '--with-xml'
'--enable-bcmath' '--enable-calendar' '--with-curl'
'--with-swf=/usr/local/flash' '--enable-ftp' '--with-gd'
'--with-jpeg-dir=/usr/local' '--with-png-dir=/usr'
'--with-xpm-dir=/usr/X11R6' '--with-gettext' '--enable-mbstring'
'--enable-mbstr-enc-trans' '--enable-mbregex' '--with-mcrypt'
'--with-mhash' '--with-ming=../ming-0.2a' '--enable-magic-quotes'
'--with-mysql=/usr' '--enable-discard-path' '--with-pear'
'--enable-xslt' '--with-xslt-sablot' '--enable-sockets'
'--enable-track-vars' '--with-ttf' '--with-freetype-dir=/usr'
'--enable-gd-native-ttf' '--enable-versioning' '--with-zlib'



[2004-06-18 00:20:06] searchadm at goschorn dot de

forgot to tell ...

permissions on /tmp set to 777
session__handling is set to file

after apachectl restart it works again for some days and then the
problem returned



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

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


#25753 [Com]: php_value|flag / php_admin_* settings leak from vhosts/.htaccess files

2004-08-08 Thread ron at dse dot nl
 ID:   25753
 Comment by:   ron at dse dot nl
 Reported By:  [EMAIL PROTECTED]
 Status:   Closed
 Bug Type: Apache related
 Operating System: *
 PHP Version:  4CVS, 5CVS
 New Comment:

I think this problem still exist in version 4.3.8 and this bug report
should be reopened. See my comments at:
http://bugs.php.net/bug.php?id=25876


Previous Comments:


[2004-01-28 12:40:04] [EMAIL PROTECTED]

This only happens on text/html files with the executable bit set.  If
the +x bit is set, we load the current ini settings and if php's
xbithack option is not set we decline the request but forget to reset
the ini settings potentially leaking them to the next request.  This is
now fixed in CVS and will be in the next release of both PHP4 and PHP5.



[2004-01-28 00:47:04] rover at tob dot ru

We examine source files more carefull and remake a patch:

diff -udr php-4.3.3/sapi/apache/mod_php4.c
php-4.3.3.patched/sapi/apache/mod_php4.c
--- php-4.3.3/sapi/apache/mod_php4.c2003-06-03 11:41:49.0
+0600
+++ php-4.3.3.patched/sapi/apache/mod_php4.c2004-01-28
10:48:27.0 +0500
@@ -830,6 +830,9 @@
}
if(!AP(xbithack)) {
r-allowed |= (1  METHODS) - 1;
+   zend_try {
+   zend_ini_deactivate(TSRMLS_C);
+   } zend_end_try();
return DECLINED;
}
return send_parsed_php(r);



[2004-01-27 13:36:14] rover at tob dot ru

It seems we have found a bug in mod_php4.c. We can 100% reproduce this
error. How to reproduce (our case):
in httpd.conf we have:

# to enable only one instance of apache process
StartServers 1
MaxClients 1
#
Directory /var/www/info/
php_value engine off
/Directory

in php.ini:
Engine = On,
we enable php-scripts at all site, but disable in /info.

Let's begin:
#/usr/sbin/apache.dbg -f /etc/apache/httpd.conf
#gbd /usr/sbin/apache.gdb pid_of_child (attach to child, what serve
requests)
(gdb)p php_apache_info.engine
 =1! php-engine ENABLED
(gdb)watch php_apache_info.engine  ! VERY IMPORTANT
(gdb)break send_php! bug in this func.
(gdb)c

1) Request a usual file from http://our.site/info/index.html:
Because we define 'php_value off' for this directory - at line 829 in
function php_xbithack_handler(remember - we process text/html) we call
zend_hash_apply((HashTable *) per_dir_conf, (apply_func_t)
php_apache_alter_ini_entries TSRMLS_CC);
and change our 'engine' value to 0.
backtrace for this call (don't look at line number - they shifted
because i insert debug lines in source files):
Hardware watchpoint 1: php_apache_info.engine
Old value = 1
New value = 0
#0  OnUpdateInt (entry=0x80dc778, new_value=0x80d3cc4 off,
new_value_length=3, mh_arg1=0x0, mh_arg2=0x4057f92c,
mh_arg3=0x0, stage=4) at
/usr/local/src/apache2+php4/php4-4.3.3/Zend/zend_ini.c:453
#1  0x4051110a in zend_alter_ini_entry (name=0x80de170 engine,
name_length=7, new_value=0x80de180 off,
new_value_length=3, modify_type=2, stage=4) at
/usr/local/src/apache2+php4/php4-4.3.3/Zend/zend_ini.c:212
#2  0x40519fc6 in php_apache_alter_ini_entries
(per_dir_entry=0x812c598)
at
/usr/local/src/apache2+php4/php4-4.3.3/sapi/apache/mod_php4.c:511
#3  0x4050b8f9 in zend_hash_apply (ht=0x809fc98, apply_func=0x40519f40
php_apache_alter_ini_entries)
at /usr/local/src/apache2+php4/php4-4.3.3/Zend/zend_hash.c:698
#4  0x4051ad1b in php_xbithack_handler (r=0x81367ec)
at
/usr/local/src/apache2+php4/php4-4.3.3/sapi/apache/mod_php4.c:850
#5  0x080551c3 in ap_invoke_handler (r=0x81367ec) at http_config.c:518
#6  0x08067e28 in process_request_internal (r=0x81367ec) at
http_request.c:1332
#7  0x08067fd4 in ap_process_request (r=0x81367ec) at
http_request.c:1348
#8  0x08060644 in child_main (child_num_arg=0) at http_main.c:4719
#9  0x080607f7 in make_child (s=0x0, slot=0, now=0) at
http_main.c:4898
#10 0x08060920 in startup_children (number_to_start=1) at
http_main.c:4925
#11 0x0806149a in standalone_main (argc=1, argv=0xbdf4) at
http_main.c:5244
#12 0x08061a08 in main (argc=1, argv=0xbdf4) at http_main.c:5601

Result of 1): we process http://our.site/info/index.html succefull and
set global var 'engine'=0!

Now we try to access http://our.site/index.php
2) breakpoint 2 executed:
Breakpoint 2, send_php (r=0x81367ec, display_source_mode=0,
filename=0x0)
at
/usr/local/src/apache2+php4/php4-4.3.3/sapi/apache/mod_php4.c:544
544 fh.free_filename = 0;
#0  send_php (r=0x81367ec, display_source_mode=0, filename=0x0)
at
/usr/local/src/apache2+php4/php4-4.3.3/sapi/apache/mod_php4.c:544
#1  0x4051a6eb in send_parsed_php (r=0x81367ec) at
/usr/local/src/apache2+php4/php4-4.3.3/sapi/apache/mod_php4.c:655
#2  

#29490 [Csd]: 'Failed to instantiate .Net object' using PHP.NET docu example

2004-08-08 Thread mike at ziebeck dot net
 ID:   29490
 User updated by:  mike at ziebeck dot net
 Reported By:  mike at ziebeck dot net
 Status:   Closed
 Bug Type: COM related
 Operating System: Windows 2000
 PHP Version:  5.0.0
 New Comment:

Well DONE, Michael !!
=

Works fine now using:
php5-win32-200408081430.zip
PHP 5.1.0-dev (cli) (built: Aug  8 2004 16:31:06)
Zend Engine v2.0.1-dev, Copyright (c) 1998-2004 Zend Technologies

php5 -f tst_DotNet.php
Hello .Net

Windows XP pro (no sevice packs, no patches)
MS .NET SDK 1.1
logged on as 'Hauptbenutzer'==MainUser

Best Regards
 mz.


Previous Comments:


[2004-08-08 17:05:56] christian at wenz dot org

I still get the error with
http://snaps.php.net/win32/php5-win32-200408081430.zip
mike at ziebeck dot net and matthias dot haldimann at epfl dot ch,
can you reproduce that?



[2004-08-08 01:03:49] [EMAIL PROTECTED]

This bug has been fixed in CVS.

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

Thanks to Michael Sisolak, this bug has been resolved.
Try the next snapshot.



[2004-08-07 22:40:23] christian at wenz dot org

FWIW, I can reproduce it with


Windowx XP Pro, German, SP1 + all available patches
with
PHP 5.1.0-dev, current snapshot as CGI and .NET Framework 1.1
IIS 5.1


Windowx XP Pro, German, SP1 + all available patches
with
PHP 5.1.0-dev, current snapshot as CGI and .NET Framework 1.1
Apache 1.3.31


Windowx XP Home, German, SP1 + all available patches
with
PHP 5.1.0-dev, current snapshot as CGI and .NET Framework 1.0SP1
Apache 2.0.50


Windowx XP Pro, German, SP1 + all available patches
with
PHP 5.1.0-dev, current snapshot as CGI and .NET Framework 1.0
IIS 5.1


I'll try to test it on more systems tomorrow.



[2004-08-05 09:25:19] mike at ziebeck dot net

I've additionaly tryed to get the example with:
PHP 5.1.0-dev (cli) (built: Aug  4 2004 08:29:44)
running on a development machine.

MS .NET Studio 2003 Enterprise Architect
MS .NET Frame Work SDK 1.1
MS Platform SDK February 2003

same results :(



[2004-08-05 08:14:14] matthias dot haldimann at epfl dot ch

Though this might not help a lot, it might still be interesting to note
that I continue to have the exact same problem, under

Windowx XP, English, SP1 + all available patches
with
PHP 5.1.0-dev, Snapshot Aug 5 2004 04:15:53 
and .NET Framework 1.1

Matthias



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

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


#29229 [Opn-Csd]: --enable-ftp fails,

2004-08-08 Thread herps at raqtweak dot com
 ID:   29229
 User updated by:  herps at raqtweak dot com
 Reported By:  herps at raqtweak dot com
-Status:   Open
+Status:   Closed
 Bug Type: Compile Failure
 Operating System: RedHat 7.x
 PHP Version:  5.0.0
 New Comment:

OK... well... after long long debugging I found the issue.
It is a compatibility issue!!!

Closing.


Previous Comments:


[2004-07-31 01:09:25] herps at raqtweak dot com

Well, what exactly is it you need?
I posted everything I can think of

Thanks.



[2004-07-31 01:00:05] 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.



[2004-07-19 22:43:48] [EMAIL PROTECTED]

Not enough information was provided for us to be able
to handle this bug. Please re-read the instructions at
http://bugs.php.net/how-to-report.php

If you can provide more information, feel free to add it
to this bug and change the status back to Open.

Thank you for your interest in PHP.




[2004-07-17 19:02:47] herps at raqtweak dot com

Description:

When I compile with --enable-ftp, I get the following error when
compiling.
When I use --disable-ftp, it works fine...
This DID work on all PHP4 builds, but not on PHP5.

ext/ftp/ftp.lo: In function `ftp_close':
/usr/src/redhat/BUILD/php-5.0.0/ext/ftp/ftp.c:188: undefined reference
to `SSL_shutdown'
ext/ftp/ftp.lo: In function `ftp_login':
/usr/src/redhat/BUILD/php-5.0.0/ext/ftp/ftp.c:282: undefined reference
to `SSLv23_client_method'
/usr/src/redhat/BUILD/php-5.0.0/ext/ftp/ftp.c:282: undefined reference
to `SSL_CTX_new'
/usr/src/redhat/BUILD/php-5.0.0/ext/ftp/ftp.c:288: undefined reference
to `SSL_new'
/usr/src/redhat/BUILD/php-5.0.0/ext/ftp/ftp.c:291: undefined reference
to `SSL_CTX_free'
/usr/src/redhat/BUILD/php-5.0.0/ext/ftp/ftp.c:295: undefined reference
to `SSL_set_fd'
/usr/src/redhat/BUILD/php-5.0.0/ext/ftp/ftp.c:297: undefined reference
to `SSL_connect'
/usr/src/redhat/BUILD/php-5.0.0/ext/ftp/ftp.c:299: undefined reference
to `SSL_shutdown'
ext/ftp/ftp.lo: In function `my_send':
/usr/src/redhat/BUILD/php-5.0.0/ext/ftp/ftp.c:1267: undefined reference
to `SSL_write'
ext/ftp/ftp.lo: In function `my_recv':
/usr/src/redhat/BUILD/php-5.0.0/ext/ftp/ftp.c:1313: undefined reference
to `SSL_read'
/usr/src/redhat/BUILD/php-5.0.0/ext/ftp/ftp.c:1315: undefined reference
to `SSL_read'
ext/ftp/ftp.lo: In function `data_accept':
/usr/src/redhat/BUILD/php-5.0.0/ext/ftp/ftp.c:1561: undefined reference
to `SSLv23_client_method'
/usr/src/redhat/BUILD/php-5.0.0/ext/ftp/ftp.c:1561: undefined reference
to `SSL_CTX_new'
/usr/src/redhat/BUILD/php-5.0.0/ext/ftp/ftp.c:1567: undefined reference
to `SSL_new'
/usr/src/redhat/BUILD/php-5.0.0/ext/ftp/ftp.c:1570: undefined reference
to `SSL_CTX_free'
/usr/src/redhat/BUILD/php-5.0.0/ext/ftp/ftp.c:1575: undefined reference
to `SSL_set_fd'
/usr/src/redhat/BUILD/php-5.0.0/ext/ftp/ftp.c:1578: undefined reference
to `SSL_copy_session_id'
/usr/src/redhat/BUILD/php-5.0.0/ext/ftp/ftp.c:1581: undefined reference
to `SSL_connect'
/usr/src/redhat/BUILD/php-5.0.0/ext/ftp/ftp.c:1583: undefined reference
to `SSL_shutdown'
ext/ftp/ftp.lo: In function `data_close':
/usr/src/redhat/BUILD/php-5.0.0/ext/ftp/ftp.c:1607: undefined reference
to `SSL_shutdown'
/usr/src/redhat/BUILD/php-5.0.0/ext/ftp/ftp.c:1616: undefined reference
to `SSL_shutdown'
collect2: ld returned 1 exit status
make: *** [sapi/cli/php] Error 1

Expected result:

Normal compile.

Actual result:
--
Failed compile.





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


#29575 [NEW]: output_buffering off can't be set in php.ini

2004-08-08 Thread intreg at zoom dot co dot uk
From: intreg at zoom dot co dot uk
Operating system: Debian GNU/Linux
PHP version:  4.3.8
PHP Bug Type: PHP options/info functions
Bug description:  output_buffering off can't be set in php.ini

Description:

output_buffering = Off
output_buffering=off

tried both of these but phpinfo still seems to show 'no value' for this
directive.

If you want to see if anyone else has managed to successfully switch it
off, then a quick browse through google using a search string as follows:

output_buffering 4.3.8 off

didn't produce any examples I could find [lots of 'no value' and 4096 and
0 but seemingly no 'off']. Just off to try making apache override the php
setting, otherwise it's back to 4.3.7 [the web developer does his own
flushing and I'm not about to tell him that he can no longer do this]

Regards,
Gary.


-- 
Edit bug report at http://bugs.php.net/?id=29575edit=1
-- 
Try a CVS snapshot (php4):  http://bugs.php.net/fix.php?id=29575r=trysnapshot4
Try a CVS snapshot (php5):  http://bugs.php.net/fix.php?id=29575r=trysnapshot5
Fixed in CVS:   http://bugs.php.net/fix.php?id=29575r=fixedcvs
Fixed in release:   http://bugs.php.net/fix.php?id=29575r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=29575r=needtrace
Need Reproduce Script:  http://bugs.php.net/fix.php?id=29575r=needscript
Try newer version:  http://bugs.php.net/fix.php?id=29575r=oldversion
Not developer issue:http://bugs.php.net/fix.php?id=29575r=support
Expected behavior:  http://bugs.php.net/fix.php?id=29575r=notwrong
Not enough info:http://bugs.php.net/fix.php?id=29575r=notenoughinfo
Submitted twice:http://bugs.php.net/fix.php?id=29575r=submittedtwice
register_globals:   http://bugs.php.net/fix.php?id=29575r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=29575r=php3
Daylight Savings:   http://bugs.php.net/fix.php?id=29575r=dst
IIS Stability:  http://bugs.php.net/fix.php?id=29575r=isapi
Install GNU Sed:http://bugs.php.net/fix.php?id=29575r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=29575r=float


#29568 [Opn-Fbk]: GD causes an segmentation fault

2004-08-08 Thread iliaa
 ID:   29568
 Updated by:   [EMAIL PROTECTED]
 Reported By:  bram at x-plose dot be
-Status:   Open
+Status:   Feedback
 Bug Type: GD related
 Operating System: debian
 PHP Version:  4.3.8
 New Comment:

Please try using this CVS snapshot:

  http://snaps.php.net/php4-STABLE-latest.tar.gz
 
For Windows:
 
  http://snaps.php.net/win32/php4-win32-STABLE-latest.zip




Previous Comments:


[2004-08-08 04:29:32] bram at x-plose dot be

Description:

When i open an php script that uses GD it shows an segmentation fault
in error.log 

Server software: Apache/1.3.26 (deb package) (Unix) Debian GNU/Linux
PHP/4.3.8 

The script is comming from php.net so i dont supose there's an error in
it.

I included /usr/local/lib/php in php.ini and i added extension = gd.so

'./configure' '--with-jpeg-dir=../jpeg-6b/' '--with-pdflib'
'--with-tiff-dir=../tiff-v3.6.1/' '--with-png-dir=../libpng-1.2.5/'
'--with-zlib-dir=../zlib-1.1.4/' '--enable-static-pdflib'
'--enable-gd-imgstrttf' '--with-gd' '--with-mysql' '--with-apxs'
'--enable-fast-cgi-redirect'
'--with-freetype-dir=/usr/local/freetype2/' '--with-iconv'
'--with-gettext' 



Reproduce code:
---
?php
   header(Content-type: image/png);
   $string = $_GET['text'];
   $im= imagecreatefrompng(banners/bannerxplose.test.png);
   $orange = imagecolorallocate($im, 220, 210, 60);
   $px= (imagesx($im) - 7.5 * strlen($string)) / 2;
   imagestring($im, 3, $px, 9, $string, $orange);
   imagepng($im);
   imagedestroy($im);
?


Actual result:
--
I only get, Cant find server and in error.log i find
[Sun Aug  8 04:12:51 2004] [notice] child pid 24310 exit signal
Segmentation fault (11)
[Sun Aug  8 04:12:51 2004] [notice] child pid 2085 exit signal
Segmentation fault (11)






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


#29566 [Opn-Fbk]: foreach/string handling strangeness (crash)

2004-08-08 Thread iliaa
 ID:   29566
 Updated by:   [EMAIL PROTECTED]
 Reported By:  stefan at hotpaenz dot de
-Status:   Open
+Status:   Feedback
 Bug Type: Reproducible crash
 Operating System: Linux 2.6.3
 PHP Version:  5CVS-2004-08-07 (dev)
 New Comment:

Please try using this CVS snapshot:

  http://snaps.php.net/php4-STABLE-latest.tar.gz
 
For Windows:
 
  http://snaps.php.net/win32/php4-win32-STABLE-latest.zip

Works fine with latest CVS. 


Previous Comments:


[2004-08-08 00:01:51] stefan at hotpaenz dot de

Description:

Consider the following code. Of course it isn't useful,  
but nevertheless it shouldn't crash PHP.  
 
Perhaps this is related to bug 28487 (another crash,  
affecting real-world scripts) because the same function  
zend_switch_free_handler is involved.  
 
Perhaps this is the same bug as 28574, which was closed as 
the problem went away. The crash I am reporting now occurs 
with a current snapshot (200408071830). 
 

Reproduce code:
---
?
$var=This is a string;

$dummy=;
unset($dummy);

foreach($var['nosuchkey'] as $v) {
}


Expected result:

Warning:  Invalid argument supplied for foreach() in 
crash.php on line 7 
 
[no crash of course] 
 

Actual result:
--
Warning:  Invalid argument supplied for foreach() in 
crash.php on line 7 
Segmentation fault (core dumped) 
 
[backtrace follows] 
 
#0  _efree (ptr=0x75736f6e) 
at /root/php/200408071830/php5-5.0.0/Zend/zend_alloc.c:285 
285  CALCULATE_REAL_SIZE_AND_CACHE_INDEX(p-size); 
 
(gdb) bt 
 
#0  _efree (ptr=0x75736f6e) 
at /root/php/200408071830/php5-5.0.0/Zend/zend_alloc.c:285 
 
#1  0x082424f8 in _zval_ptr_dtor (zval_ptr=0xbfffd698) 
at /root/php/200408071830/php5-5.0.0/Zend/zend_execute_API.c:396 
 
#2  0x0827288b in zend_switch_free_handler 
(execute_data=0xbfffd710, opline=0x872749c, 
op_array=0x8722f24, tsrm_ls=0x8431018) 
at /root/php/200408071830/php5-5.0.0/Zend/zend_execute.c:210 
 
#3  0x0826ce85 in execute (op_array=0x8722f24, 
tsrm_ls=0x8431018) 
at /root/php/200408071830/php5-5.0.0/Zend/zend_execute.c:1400 
 
#4  0x0824d971 in zend_execute_scripts (type=8, 
tsrm_ls=0x8431018, retval=0x0, file_count=3) 
at /root/php/200408071830/php5-5.0.0/Zend/zend.c:1068 
 
#5  0x08210ab4 in php_execute_script 
(primary_file=0xbae0, tsrm_ls=0x8431018) 
at /root/php/200408071830/php5-5.0.0/main/main.c:1631 
 
#6  0x08279bec in main (argc=2, argv=0xbba4) 
at /root/php/200408071830/php5-5.0.0/sapi/cgi/cgi_main.c:1568 
 





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


#29557 [Opn-Bgs]: strtotime error

2004-08-08 Thread iliaa
 ID:   29557
 Updated by:   [EMAIL PROTECTED]
 Reported By:  javier at evaloportunidades dot insp dot mx
-Status:   Open
+Status:   Bogus
 Bug Type: *General Issues
 Operating System: Debian GNU/Linux 3.0 2.6.7
 PHP Version:  5.0.0
 New Comment:

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

The code takes 1 second to run, so of course the timestamp 
with 1 second precision will be the same. 


Previous Comments:


[2004-08-07 00:10:46] javier at evaloportunidades dot insp dot mx

Description:

   We use the strtotime function to get a value that is used as primary
key on a database table. But with PHP 5.0.0 the strtotime function is
returning duplicate values.


Here is the configure line:
---
'./configure' '--disable-cli' '--disable-cgi' '--without-pear'
'--without-mysql' '--with-pgsql'
'--with-apxs2=/usr/local/apache2/bin/apxs' '--enable-memory-limit'
---


With PHP 4 we didn't face this problem.


Cheers,

Javier



Reproduce code:
---
?php 
for ($i=0;$i10;$i++)
{
$aux = strtotime(now);
echo $aux .br;
}
?

Actual result:
--
1091768400
1091768400
1091768400
1091768400
1091768400
1091768400
1091768400
1091768400
1091768400
1091768400





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


#29329 [Com]: configure missing -L$MYSQL_LIB_DIR when checking for mysql_stmt_field_count

2004-08-08 Thread yrob at mail dot crpower dot com
 ID:   29329
 Comment by:   yrob at mail dot crpower dot com
 Reported By:  beardie at dsvr dot net
 Status:   Open
 Bug Type: *Compile Issues
 Operating System: Linux
 PHP Version:  5.0.0
 New Comment:

Having the 'shared' statement didn't work at all for me.
Did not work: --with-mysqli=shared,/usr/local/mysql
Did work: --with-mysqli=/usr/local/mysql

Otherwise, I configured both mysql and mysqli using MySQL 5.0, but I
get Segmentation faults while running scripts that contain mysql
functions.  mysqli functions run just fine, however.  These are the
specifications I used for configuring, which ran fine, so did the make
and make install:
--with-mysql=/usr/local/mysql
--with-mysqli=/usr/local/mysql/bin/mysql_config


Previous Comments:


[2004-07-22 15:53:22] beardie at dsvr dot net

Description:

When running ./configure with the following options (amongst others):

  --with-mysql=shared,/opt/mysql-4.1
  --with-mysqli=shared,/opt/mysql-4.1/bin/mysql_config

I get the following failure message:

checking for mysql_stmt_field_count in -lmysqlclient... no
configure: error: MySQLI doesn't support versions  4.1.3 anymore.
Please update your libraries.

Which is resolved by applying the following patch to configure:

--- orig/configure  2004-07-22 14:27:15.0 +0100
+++  new/configure  2004-07-22 14:27:10.0 +0100
@@ -54963,7 +54963,7 @@
   echo $ac_n (cached) $ac_c 16
 else
   ac_save_LIBS=$LIBS
-LIBS=-lmysqlclient  $LIBS
+LIBS=-L$MYSQL_LIB_DIR -lmysqlclient  $LIBS
 cat  conftest.$ac_ext EOF
 #line 54969 configure
 #include confdefs.h
@@ -55196,7 +55196,7 @@
   echo $ac_n (cached) $ac_c 16
 else
   ac_save_LIBS=$LIBS
-LIBS=-lmysqlclient  $LIBS
+LIBS=-L$MYSQL_LIB_DIR -lmysqlclient  $LIBS
 cat  conftest.$ac_ext EOF
 #line 55202 configure
 #include confdefs.h







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


#25708 [Csd]: extract($GLOBALS, EXTR_REFS); can corrupt the $GLOBALS array.

2004-08-08 Thread moriyoshi
 ID:   25708
 Updated by:   [EMAIL PROTECTED]
 Reported By:  cdragon at draconic dot com
 Status:   Closed
 Bug Type: Variables related
 Operating System: Windows 2000 Server
 PHP Version:  4CVS-2003-09-30 (stable)
 New Comment:

Closely related to bug #29493.



Previous Comments:


[2003-10-02 18:49:47] [EMAIL PROTECTED]

This bug has been fixed in CVS.

In case this was a PHP problem, snapshots of the sources are packaged
every three hours; this change will be in the next snapshot. You can
grab the snapshot at http://snaps.php.net/.
 
In case this was a documentation problem, the fix will show up soon at
http://www.php.net/manual/.

In case this was a PHP.net website problem, the change will show
up on the PHP.net site and on the mirror sites in short time.
 
Thank you for the report, and for helping us make PHP better.





[2003-09-30 21:36:52] cdragon at draconic dot com

Well, thank you for your quick (but rude) response.

It is certainly not useless (or stupid) to extract references to
globals.  Extracting them without using the REFS flag creates deep
copies of every variable (if I understand things correctly), which is
very wasteful of resources.  More importantly, you can't modify the
contents of a global string unless you extract with REFS or use an
alternate method.  For example:

$var = x;
extrTest();
print var=$varp;

function extrTest() {
  extract($GLOBALS);
  //global $var;
  //extract($GLOBALS, EXTR_REFS);
  //$GLOBALS[var] = y;
  $var = y;
}

Will print var=x instead of the desired var=y (which you can get
using any of the commented-out lines).  Since there are obviously other
syntactic alternatives, I don't _have_ to use the REFS method.  However,
I would certainly consider it a serious bug that you can cause PHP to
access violation and exhibit randomish, hard to diagnose errors  by
doing something that actually _works most of the time_, serves a valid
purpose, seems like it should work (without knowing some things about
PHP's inner workings), and is not even cautioned against anywhere in
the documentation that I can find.



[2003-09-30 20:57:15] [EMAIL PROTECTED]

In short: Don't do this.

Longer version: GLOBALS is special variable, using extract() on it is
a) pointless, b) stupid, c) useless.

GLOBALS references itself in it, when you try to extract it's contents
as references, you'll end up with circular references which of course
will cause a crash.




[2003-09-30 18:23:05] cdragon at draconic dot com

Description:

Using extract($GLOBALS, EXTR_REFS); can cause the left hand side of two
globals set by-value equal to one-another to become corrupted in the
$GLOBALS array.  Hard to explain in English, but easier to see in the
code below.

Reproduce code:
---
$sortColumn = Affinity;
// Using $lastSortColumn = substr($sortColumn, 0); fixes the bug
$lastSortColumn = $sortColumn;

print sort= . $GLOBALS['sortColumn'] .  lastsort= .
$GLOBALS['lastSortColumn'] . p;
extractGlobs();
print sort= . $GLOBALS['sortColumn'] .  lastsort= .
$GLOBALS['lastSortColumn'] . p;

function extractGlobs()
{
  // Commenting out the line below fixes the bug.  So does not using
the EXTR_REFS flag.
  extract($GLOBALS, EXTR_REFS);
}

Expected result:

sort=Affinity lastsort=Affinity
sort=Affinity lastsort=Affinity


Actual result:
--
sort=Affinity lastsort=Affinity
sort=Affinity lastsort=

or, randomly, you get an access violation instead:

PHP has encountered an Access Violation at 02CFF32F
(the 02CFF32F is variable)





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


#29493 [Opn-Ver]: extract(array, EXTR_REFS) fails if array has more than one referring symbol

2004-08-08 Thread moriyoshi
 ID:   29493
 Updated by:   [EMAIL PROTECTED]
 Reported By:  msm at manley dot org
-Status:   Open
+Status:   Verified
 Bug Type: Unknown/Other Function
 Operating System: Linux, FreeBSD
 PHP Version:  5.0.0
-Assigned To:  
+Assigned To:  moriyoshi
 New Comment:

Seems a side-effect of the fix I did for bug #25708.



Previous Comments:


[2004-08-06 16:35:22] msm at manley dot org

Sent patch to [EMAIL PROTECTED] that passes all of the PHP distribution
testcases for bug 25708 and all of the testcases above.



[2004-08-05 00:44:03] msm at manley dot org

That patch is no good. It causes the testcase for bug 25708 to fail.



[2004-08-04 23:46:02] msm at manley dot org

The problem lies in extract()'s use of the SEPARATE_ZVAL macro in
ext/standard/array.c. That macro actually makes a full copy of a ZVAL
if the ZVAL's refcount is  1. 

I assume that's used when doing lazy copies, normally.

The existing extract() function uses SEPARATE_ZVAL_TO_MAKE_IS_REF to
set is_ref = 1 in the ZVAL. When the refcount on the extract()ed array
is 1, no copy is made and the extracted variables are refs to the array
member. When the refcount is  1, a copy of the array entry gets made by
SEPARATE_ZVAL and the extracted variable end up as refs to the copy.

Here is a patch that I believe fixes the problem. So far a modified
version of PHP 5.0.0 has passed all the testcases with this patch in
place.



--- array.c Wed Aug  4 15:54:40 2004
+++ array.c.msm Wed Aug  4 16:42:01 2004
@@ -1372,7 +1372,7 @@
if (extract_refs) {
zval **orig_var;

-  
SEPARATE_ZVAL_TO_MAKE_IS_REF(entry);
+   (*(entry))-is_ref = 1;
zval_add_ref(entry);

if
(zend_hash_find(EG(active_symbol_table), final_name.c,
final_name.len+1, (void **) orig_var) == SUCCESS) {



[2004-08-03 22:59:58] msm at manley dot org

Realizing I'm mostly conversing with myself here:

I'm not completely certain, but I think the issue is on line 1375 of
ext/standard/array.c

SEPARATE_ZVAL_TO_MAKE_IS_REF(entry);

If I follow the logic back through the twisty little maze of zend.h
macros, it would appear that when that macro is called and the refcount
on the original entry is  1, SEPARATE_ZVAL ends up copying the entry
entirely.

But that would mean the individual entries in a array/hash have the
same refcount as the array in general. Perhaps that's true? 

At this point I am in way deeper than I can figure, having never even
looked at the PHP source before today.



[2004-08-03 20:04:19] msm at manley dot org

I shortened my testcases down to the following:

?php
rc1(); rc2(); rc3();

function rc1()
{
  echo \n\n1: array copy by value\n;
  $a = array( 'foo' = 'bar');
  $b = $a;
  $b['foo'] = 'diff';
  print_r($a);
  echo \n-\nnow extract from a with EXTR_REFS\n;
  extract($a,EXTR_REFS);
  echo post extract, foo = $foo\n;
  $foo = 'noo';
  echo post reassign, foo = $foo\n;
  print_r($a);
  print_r($b);
}

function rc2()
{
  echo \n\n2: array copy by reference\n;
  $a = array( 'foo' = 'bar');
  $b = $a;
  print_r($a);
  echo \n-\nnow extract from a with EXTR_REFS\n;
  extract($a,EXTR_REFS);
  echo post extract, foo = $foo\n;
  $foo = 'noo';
  echo post reassign, foo = $foo\n;
  print_r($a);
}

function rc3()
{
  echo \n\n3: array copy by reference then unset copy\n;
  $a = array( 'foo' = 'bar');
  $b = $a;
  unset($b);
  print_r($a);
  echo \n-\nnow extract from a with EXTR_REFS\n;
  extract($a,EXTR_REFS);
  echo post extract, foo = $foo\n;
  $foo = 'noo';
  echo post reassign, foo = $foo\n;
  print_r($a);
}
?

Testcases 1 and 3 pass - $foo is a ref to $a['foo']. Testcase 2 fails
-- $foo does not appear to be a ref to $a['foo'].



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

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


#29359 [Fbk-NoF]: php_ini.c:486: 'alphasort' undeclared

2004-08-08 Thread php-bugs
 ID:   29359
 Updated by:   [EMAIL PROTECTED]
 Reported By:   bonk_371 at hotmail dot com
-Status:   Feedback
+Status:   No Feedback
 Bug Type: Compile Failure
 Operating System: QNX 6.3.0
 PHP Version:  5.0.0
 New Comment:

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.


Previous Comments:


[2004-07-29 11:18:01] [EMAIL PROTECTED]

Supply more information, please.
Error messages, your fix and other info will help much.
What does your ./configure say about alphasort (./configure ... | grep
-i alpha) ?



[2004-07-24 06:43:01] bonk_371 at hotmail dot com

I implemented the user's fix for this bug posted for 4.3.3 and it
worked.



[2004-07-23 23:46:35] bonk_371 at hotmail dot com

it also fails to detect iconv on QNX 6.3.0 (I just disabled it in the
configure to get around it - not sure it will work...)



[2004-07-23 23:15:32]   bonk_371 at hotmail dot com

Description:

A bug previously reported, and fixed for php4.3.3 on QNX6 has
returned.

make fails on line 486 of php_ini.c

Yes this is genuine and unreported for php5.0.0, yes it was previously
reported for older versions and fixed, but it has returned (was
forgotten?)

Reproduce code:
---
see current PHP 5.0.0 source distribution:
http://ca3.php.net/get/php-5.0.0.tar.gz/from/ca2.php.net/mirror

Expected result:

I expected the make to complete sucessfully.

Actual result:
--
It failed





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


#29560 [Fbk-Opn]: Listening on non-blocking socket leaks memory

2004-08-08 Thread info at tphnet dot com
 ID:   29560
 User updated by:  info at tphnet dot com
 Reported By:  info at tphnet dot com
-Status:   Feedback
+Status:   Open
 Bug Type: Sockets related
 Operating System: Windows XP SP1
 PHP Version:  5.0.0
 New Comment:

Tested using:

PHP 5.1.0-dev (cli) (built: Aug  8 2004 16:31:06)

The memory leak is still there, as described in my previous reply.


Previous Comments:


[2004-08-08 01:47:37] [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

Try a snapshot, as a couple of peername related bugs were fixed
recently.



[2004-08-07 19:23:22] info at tphnet dot com

I can confirm the memory leak that I described in my original bug
report has disappeard.

BUT, I found a new memory leak inside the stream_socket_accept()
function. If you set the third argument peername to a variable, the
function will leak a little bit of memory everytime it's called. The
effect is the same as with the original bug in socket_accpet().
Just modify the example in my previous reply by changing

$new_connection = @stream_socket_accept($socket, 0);

into

$new_connection = @stream_socket_accept($socket, 0, $peer);

and see what happens. In my case (Windows XP, php 5.0.0 CLI) the script
starts leaking memory.



[2004-08-07 17:55:35] info at tphnet dot com

I changed to code to the following:

?php

$socket = stream_socket_server('tcp://localhost:1234', $errno,
$errstr);
stream_set_blocking($socket, 0);

while(true){

$new_connection = @stream_socket_accept($socket, 0);

unset($new_connection);}

?

There is no memory leak anymore and everything is working as expected.
It appears the problem is solved.



[2004-08-07 15:07:44] [EMAIL PROTECTED]

Urgh, ignore that (clicked wrong link).
The sockets extension is unmaintained.
Try stream_socket_create() and fiends instead.



[2004-08-07 14:50:11] [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/29560

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


#29576 [NEW]: Fsockopen function working incorrectly?

2004-08-08 Thread admin at php2tor dot com
From: admin at php2tor dot com
Operating system: Fedora Core 1
PHP version:  4.3.8
PHP Bug Type: Network related
Bug description:  Fsockopen function working incorrectly?

Description:

I'm using Fedora Core 1 and PHP 4.3.8

I'm using the fsockopen function to check status of port for a windows
environment. I'm going thru the WAN to check this port which is two hops
away. For some reason I had a routing issue to the destination network. I
tried to ping the server from my windows workstation and I would get reply
from the router (as opposed to just getting a request timeout message)
saying the destination network was unavailable. Anyway, when I ran the
script that checks the server (from the fedora machine), the php script
would report the server as up, when in reality it couldn't be reached.

I'm guessing cause the router respoded with reply messages that the
fsockopen function assumes a connection is made? 

Reproduce code:
---
$host = '192.168.1.1';
$port = '445';
$timeout = '2';

$fp = fsockopen($host, $port, $errno. $errstr, $timeout);

if ($fp)
{
print 'server_up.gif';

}else{

  print 'server_down.gif';

}









Expected result:

Should show the host is not reachable and print the device is down.

Actual result:
--
given the conditions mentioned above, the server should show down, but the
fsockopen says its up.

-- 
Edit bug report at http://bugs.php.net/?id=29576edit=1
-- 
Try a CVS snapshot (php4):  http://bugs.php.net/fix.php?id=29576r=trysnapshot4
Try a CVS snapshot (php5):  http://bugs.php.net/fix.php?id=29576r=trysnapshot5
Fixed in CVS:   http://bugs.php.net/fix.php?id=29576r=fixedcvs
Fixed in release:   http://bugs.php.net/fix.php?id=29576r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=29576r=needtrace
Need Reproduce Script:  http://bugs.php.net/fix.php?id=29576r=needscript
Try newer version:  http://bugs.php.net/fix.php?id=29576r=oldversion
Not developer issue:http://bugs.php.net/fix.php?id=29576r=support
Expected behavior:  http://bugs.php.net/fix.php?id=29576r=notwrong
Not enough info:http://bugs.php.net/fix.php?id=29576r=notenoughinfo
Submitted twice:http://bugs.php.net/fix.php?id=29576r=submittedtwice
register_globals:   http://bugs.php.net/fix.php?id=29576r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=29576r=php3
Daylight Savings:   http://bugs.php.net/fix.php?id=29576r=dst
IIS Stability:  http://bugs.php.net/fix.php?id=29576r=isapi
Install GNU Sed:http://bugs.php.net/fix.php?id=29576r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=29576r=float


#29577 [NEW]: Mysqli constant not defined but in documentation

2004-08-08 Thread auroraeosrose at hotmail dot com
From: auroraeosrose at hotmail dot com
Operating system: Winxp pro sp1
PHP version:  5CVS-2004-08-09 (dev)
PHP Bug Type: MySQL related
Bug description:  Mysqli constant not defined but in documentation

Description:

Trying to use MYSQLI_CLIENT_FOUND_ROWS with mysqli_real_connect and
getting Use of undefined constant error.  The flag supposedly exists
according to the docs, but when looking at the mysqli source files it's
never defined :)  It should either be deleted from the docs, or defined
somewhere if it was simply forgotten




-- 
Edit bug report at http://bugs.php.net/?id=29577edit=1
-- 
Try a CVS snapshot (php4):  http://bugs.php.net/fix.php?id=29577r=trysnapshot4
Try a CVS snapshot (php5):  http://bugs.php.net/fix.php?id=29577r=trysnapshot5
Fixed in CVS:   http://bugs.php.net/fix.php?id=29577r=fixedcvs
Fixed in release:   http://bugs.php.net/fix.php?id=29577r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=29577r=needtrace
Need Reproduce Script:  http://bugs.php.net/fix.php?id=29577r=needscript
Try newer version:  http://bugs.php.net/fix.php?id=29577r=oldversion
Not developer issue:http://bugs.php.net/fix.php?id=29577r=support
Expected behavior:  http://bugs.php.net/fix.php?id=29577r=notwrong
Not enough info:http://bugs.php.net/fix.php?id=29577r=notenoughinfo
Submitted twice:http://bugs.php.net/fix.php?id=29577r=submittedtwice
register_globals:   http://bugs.php.net/fix.php?id=29577r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=29577r=php3
Daylight Savings:   http://bugs.php.net/fix.php?id=29577r=dst
IIS Stability:  http://bugs.php.net/fix.php?id=29577r=isapi
Install GNU Sed:http://bugs.php.net/fix.php?id=29577r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=29577r=float


#29577 [Opn]: Mysqli constant not defined but in documentation

2004-08-08 Thread auroraeosrose at hotmail dot com
 ID:   29577
 User updated by:  auroraeosrose at hotmail dot com
 Reported By:  auroraeosrose at hotmail dot com
 Status:   Open
 Bug Type: MySQL related
 Operating System: Winxp pro sp1
 PHP Version:  5CVS-2004-08-09 (dev)
 New Comment:

somewhere around line 452 of mysqli.c adding
REGISTER_LONG_CONSTANT(MYSQLI_CLIENT_FOUND_ROWS, CLIENT_FOUND_ROWS,
CONST_CS | CONST_PERSISTENT); should fix it :)


Previous Comments:


[2004-08-09 02:30:39] auroraeosrose at hotmail dot com

Description:

Trying to use MYSQLI_CLIENT_FOUND_ROWS with mysqli_real_connect and
getting Use of undefined constant error.  The flag supposedly exists
according to the docs, but when looking at the mysqli source files it's
never defined :)  It should either be deleted from the docs, or defined
somewhere if it was simply forgotten








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


#29579 [NEW]: checking whether IMAP works... no

2004-08-08 Thread idler at idler dot no-ip dot org
From: idler at idler dot no-ip dot org
Operating system: Slackware 10.0.0 Kernel 2.6.7
PHP version:  4.3.8
PHP Bug Type: Compile Failure
Bug description:  checking whether IMAP works... no

Description:

checking whether IMAP works... no
configure: error: build test failed. Please check the config.log for
details.

I think this problem appear more than one times. I cannot build my php
with imap successfully from the version of 4.3.4 to now.
I've followed the instruction exactly from
http://hk2.php.net/manual/en/ref.imap.php.
I've also looked for solutions for this problem from internet and this bug
database, but they seem cannot help.

My configure line:
CFLAGS=-O3 -mcpu=pentium3 -march=pentium3 ./configure
--prefix=/usr/local --disable-static --with-apxs=/usr/sbin/apxs
--sysconfdir=/etc --enable-discard-path
--with-config-file-path=/etc/apache --enable-safe-mode --with-openssl
--with-mhash --enable-bcmath --with-bz2 --with-pic --enable-calendar
--enable-ctype --with-gdbm --with-db4 --enable-dbase --enable-ftp
--with-iconv --with-exif --with-gd --enable-gd-native-ttf
--with-jpeg-dir=/usr --with-png --with-gmp --with-mysql=/usr
--with-xml=shared,/usr --with-gettext=shared,/usr --with-expat-dir=/usr
--enable-wddx --with-mm=/usr --enable-trans-sid --enable-shmop
--enable-sockets --with-regex=php --enable-sysvsem --enable-sysvshm
--enable-yp --enable-memory-limit --with-tsrm-pthreads --enable-shared
--disable-debug --with-zlib=/usr --with-tiff-dir=/usr --with-curl
--with-db4 --with-dom=/usr --with-zlib-dir --enable-exif
--with-freetype-dir=shared,/usr/local --with-kerberos --with-ldap=shared
--with-mcrypt --with-mysql-sock
--with-pdflib=shared,/usr/local/src/PDFlib-6.0.0-Linux/bind/c
--with-tiff-dir=/usr --with-mhash --with-zip --with-swf=shared
--enable-zend-multibyte --enable-mbstring
--with-imap=/usr/local/src/imap-2004a

Ths last lines of config.log:
(It doesn't provide any special error message, it only say undefined
reference.)
configure:40604: checking for crypt in -lcrypt
configure:41054: checking whether SSL libraries are needed for c-client
configure:41184: gcc -o conftest -O3 -mcpu=pentium3 -march=pentium3 
-L/usr/lib -ldb-4.2  -Wl,-rpath,/usr/local/lib -L/usr/local/lib conftest.c
-lc-client
-lcrypt -lpam -lgmp -lfreetype -lpng -lz -ljpeg -lz -ldb-4.2 -lgdbm -lcurl
-lbz2 -lz -lresolv -lm -ldl -lnsl  -lssl -lcrypto -ldl -lcurl -lssl
-lcrypto -ldl
-lssl -lcrypto -ldl -lz -lxml2 -lz -lm 15
/tmp/ccUkdOqm.o(.text+0xa): In function `main':
: undefined reference to `auth_gssapi_valid'
collect2: ld returned 1 exit status
configure: failed program was:
#line 41159 configure
#include confdefs.h

void mm_log(void){}
void mm_dlog(void){}
void mm_flags(void){}
void mm_fatal(void){}
void mm_critical(void){}
void mm_nocritical(void){}
void mm_notify(void){}
void mm_login(void){}
void mm_diskerror(void){}
void mm_status(void){}
void mm_lsub(void){}
void mm_list(void){}
void mm_exists(void){}
void mm_searched(void){}
void mm_expunged(void){}
char auth_gssapi_valid();
int main() {
  auth_gssapi_valid();
  return 0;
}

configure:41210: checking whether IMAP works
configure:41243: gcc -o conftest -O3 -mcpu=pentium3 -march=pentium3 
-L/usr/lib -ldb-4.2  -Wl,-rpath,/usr/local/lib -L/usr/local/lib conftest.c
-lc-client
-lcrypt -lpam -lgmp -lfreetype -lpng -lz -ljpeg -lz -ldb-4.2 -lgdbm -lcurl
-lbz2 -lz -lresolv -lm -ldl -lnsl  -lssl -lcrypto -ldl -lcurl -lssl
-lcrypto -ldl
-lssl -lcrypto -ldl -lz -lxml2 -lz -lm 15
/tmp/ccqx1Zdw.o(.text+0xa): In function `main':
: undefined reference to `mail_newbody'
collect2: ld returned 1 exit status
configure: failed program was:
#line 41218 configure
#include confdefs.h

void mm_log(void){}
void mm_dlog(void){}
void mm_flags(void){}
void mm_fatal(void){}
void mm_critical(void){}
void mm_nocritical(void){}
void mm_notify(void){}
void mm_login(void){}
void mm_diskerror(void){}
void mm_status(void){}
void mm_lsub(void){}
void mm_list(void){}
void mm_exists(void){}
void mm_searched(void){}
void mm_expunged(void){}
char mail_newbody();
int main() {
  mail_newbody();
  return 0;
}




-- 
Edit bug report at http://bugs.php.net/?id=29579edit=1
-- 
Try a CVS snapshot (php4):  http://bugs.php.net/fix.php?id=29579r=trysnapshot4
Try a CVS snapshot (php5):  http://bugs.php.net/fix.php?id=29579r=trysnapshot5
Fixed in CVS:   http://bugs.php.net/fix.php?id=29579r=fixedcvs
Fixed in release:   http://bugs.php.net/fix.php?id=29579r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=29579r=needtrace
Need Reproduce Script:  http://bugs.php.net/fix.php?id=29579r=needscript
Try newer version:  http://bugs.php.net/fix.php?id=29579r=oldversion
Not developer issue:http://bugs.php.net/fix.php?id=29579r=support
Expected behavior:  

#29580 [NEW]: Typo in zend_hash.c

2004-08-08 Thread juergennagel at web dot de
From: juergennagel at web dot de
Operating system: Gentoo Linux (Linux 2.4.7)
PHP version:  5.0.0
PHP Bug Type: Compile Failure
Bug description:  Typo in zend_hash.c

Description:

On line 165 of zend_hash.c there's a right parenthesis too 
many. 

Reproduce code:
---
#if HARDENED_PHP_HASH_PROTECT
if (zend_hash_canary_inited)) {
zend_hash_canary = zend_canary();
zend_hash_canary_inited = 1;
}
ht-canary = zend_hash_canary;
#endif

the second line should be:
if (zend_hash_canary_inited) {

Expected result:

 


-- 
Edit bug report at http://bugs.php.net/?id=29580edit=1
-- 
Try a CVS snapshot (php4):  http://bugs.php.net/fix.php?id=29580r=trysnapshot4
Try a CVS snapshot (php5):  http://bugs.php.net/fix.php?id=29580r=trysnapshot5
Fixed in CVS:   http://bugs.php.net/fix.php?id=29580r=fixedcvs
Fixed in release:   http://bugs.php.net/fix.php?id=29580r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=29580r=needtrace
Need Reproduce Script:  http://bugs.php.net/fix.php?id=29580r=needscript
Try newer version:  http://bugs.php.net/fix.php?id=29580r=oldversion
Not developer issue:http://bugs.php.net/fix.php?id=29580r=support
Expected behavior:  http://bugs.php.net/fix.php?id=29580r=notwrong
Not enough info:http://bugs.php.net/fix.php?id=29580r=notenoughinfo
Submitted twice:http://bugs.php.net/fix.php?id=29580r=submittedtwice
register_globals:   http://bugs.php.net/fix.php?id=29580r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=29580r=php3
Daylight Savings:   http://bugs.php.net/fix.php?id=29580r=dst
IIS Stability:  http://bugs.php.net/fix.php?id=29580r=isapi
Install GNU Sed:http://bugs.php.net/fix.php?id=29580r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=29580r=float


#29580 [Opn-Bgs]: Typo in zend_hash.c

2004-08-08 Thread gschlossnagle
 ID:   29580
 Updated by:   [EMAIL PROTECTED]
 Reported By:  juergennagel at web dot de
-Status:   Open
+Status:   Bogus
 Bug Type: Compile Failure
 Operating System: Gentoo Linux (Linux 2.4.7)
 PHP Version:  5.0.0
 New Comment:

Sorry, but your problem does not imply a bug in PHP itself.  For a
list of more appropriate places to ask for help using PHP, please
visit http://www.php.net/support.php as this bug system is not the
appropriate forum for asking support questions. 

Thank you for your interest in PHP.

hardened php is not part of the PHP project, you should 
report this to the hardened php developer.


Previous Comments:


[2004-08-09 03:20:54] juergennagel at web dot de

Description:

On line 165 of zend_hash.c there's a right parenthesis too 
many. 

Reproduce code:
---
#if HARDENED_PHP_HASH_PROTECT
if (zend_hash_canary_inited)) {
zend_hash_canary = zend_canary();
zend_hash_canary_inited = 1;
}
ht-canary = zend_hash_canary;
#endif

the second line should be:
if (zend_hash_canary_inited) {

Expected result:

 






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


#27406 [Bgs-Opn]: php_check_syntax behavior

2004-08-08 Thread philip
 ID:   27406
 Updated by:   [EMAIL PROTECTED]
 Reported By:  thomas at stauntons dot org
-Status:   Bogus
+Status:   Open
-Bug Type: Zend Engine 2 problem
+Bug Type: Unknown/Other Function
 Operating System: OS X
-PHP Version:  5.0.0b4 (beta4)
+PHP Version:  5.0.0
 Assigned To:  iliaa
 New Comment:

So should this function actually execute the code (like an include())
or should it be a simple lint check (identical to php -l).  The doc
team assumed the later.  Please advise with specific information on how
this should be documented or if this is indeed a bug, say so.

http://cvs.php.net/co.php/phpdoc/en/reference/misc/functions/php-check-syntax.xml



Previous Comments:


[2004-08-08 18:59:20] phpbug at bigredspark dot com

Bogus? Could someone document this function so we know what the
proper usage is? Is this funtion meant to load the file into the
current scope as it's syntax is checked? If so, please say so in the
documentation. Otherwise, I have another bug report to file.

original.php
?php
$bool = php_check_syntax('checkme.php');
foo();
$bar = new Bar;
$bar-foo();
?

checkme.php
?php
function foo()
{ echo checkme::foo\n; }
class Bar {
function foo()
{ echo checkme::bar::foo\n; }
}
?

results in

checkme::foo
checkme::bar::foo

for example, when my assumption of how the function works should have
the code results in undefined function and class errors.



[2004-04-13 13:12:03] [EMAIL PROTECTED]

Don't misuse the function.




[2004-02-26 15:18:57] [EMAIL PROTECTED]

Ilia, maybe this function wasn't such a good idea after all?
Here's the first misuse of it already..




[2004-02-26 11:00:17] thomas at stauntons dot org

Description:

I am writing a class that will include another file 
containing a class that needs to implement a specific 
interface. When calling php_check_syntax on the file its 
behavious differs depending on whether or not the class 
implements my interface. If the file implements my 
interface the class will not show up in 
get_declared_classes() and an include() of the file will 
work, but if the class doesn't implement my interface the 
class will be in get_declared_classes() and the include 
will fail with 'cannot redeclareclass'

Reproduce code:
---
in Main.php
?php
interface MustImplement {}
if (!php_check_syntax('includeme.php'))
die('Bad Syntax\n');
else include('includeme.php');
?
in includeme.php (Case 1)
?php
class AClass implements MustImplement
{}
?
in includeme.php (Case 2)
?php
class AClass
{}
?

Expected result:

Case 1 of includeme.php will work OK, php_syntax_check will 
succeed and include will load the file OK, AClass will be 
available. 

Case 2 will fail, php_syntax_check will work but include 
will fail with 'cannot redeclare class'  Illegal 
Instruction

Actual result:
--
Just as Above. 





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


#29577 [Opn-Asn]: Mysqli constant not defined but in documentation

2004-08-08 Thread georg
 ID:   29577
 Updated by:   [EMAIL PROTECTED]
 Reported By:  auroraeosrose at hotmail dot com
-Status:   Open
+Status:   Assigned
 Bug Type: MySQL related
 Operating System: Winxp pro sp1
 PHP Version:  5CVS-2004-08-09 (dev)
-Assigned To:  
+Assigned To:  georg


Previous Comments:


[2004-08-09 02:39:53] auroraeosrose at hotmail dot com

somewhere around line 452 of mysqli.c adding
REGISTER_LONG_CONSTANT(MYSQLI_CLIENT_FOUND_ROWS, CLIENT_FOUND_ROWS,
CONST_CS | CONST_PERSISTENT); should fix it :)



[2004-08-09 02:30:39] auroraeosrose at hotmail dot com

Description:

Trying to use MYSQLI_CLIENT_FOUND_ROWS with mysqli_real_connect and
getting Use of undefined constant error.  The flag supposedly exists
according to the docs, but when looking at the mysqli source files it's
never defined :)  It should either be deleted from the docs, or defined
somewhere if it was simply forgotten








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


#29577 [Asn-Csd]: Mysqli constant not defined but in documentation

2004-08-08 Thread georg
 ID:   29577
 Updated by:   [EMAIL PROTECTED]
 Reported By:  auroraeosrose at hotmail dot com
-Status:   Assigned
+Status:   Closed
 Bug Type: MySQL related
 Operating System: Winxp pro sp1
 PHP Version:  5CVS-2004-08-09 (dev)
 Assigned To:  georg
 New Comment:

This bug has been fixed in CVS.

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




Previous Comments:


[2004-08-09 02:39:53] auroraeosrose at hotmail dot com

somewhere around line 452 of mysqli.c adding
REGISTER_LONG_CONSTANT(MYSQLI_CLIENT_FOUND_ROWS, CLIENT_FOUND_ROWS,
CONST_CS | CONST_PERSISTENT); should fix it :)



[2004-08-09 02:30:39] auroraeosrose at hotmail dot com

Description:

Trying to use MYSQLI_CLIENT_FOUND_ROWS with mysqli_real_connect and
getting Use of undefined constant error.  The flag supposedly exists
according to the docs, but when looking at the mysqli source files it's
never defined :)  It should either be deleted from the docs, or defined
somewhere if it was simply forgotten








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


#29576 [Opn-Fbk]: Fsockopen function working incorrectly?

2004-08-08 Thread wez
 ID:   29576
 Updated by:   [EMAIL PROTECTED]
 Reported By:  admin at php2tor dot com
-Status:   Open
+Status:   Feedback
 Bug Type: Network related
 Operating System: Fedora Core 1
 PHP Version:  4.3.8
 New Comment:

Run this:

strace -e trace=network php yourscript.php

and paste the output here.

Also, please try running telnet from the fedora machine to that IP and
port combo to see if it does the same thing.


Previous Comments:


[2004-08-09 02:25:14] admin at php2tor dot com

Description:

I'm using Fedora Core 1 and PHP 4.3.8

I'm using the fsockopen function to check status of port for a windows
environment. I'm going thru the WAN to check this port which is two
hops away. For some reason I had a routing issue to the destination
network. I tried to ping the server from my windows workstation and I
would get reply from the router (as opposed to just getting a request
timeout message) saying the destination network was unavailable.
Anyway, when I ran the script that checks the server (from the fedora
machine), the php script would report the server as up, when in reality
it couldn't be reached.

I'm guessing cause the router respoded with reply messages that the
fsockopen function assumes a connection is made? 

Reproduce code:
---
$host = '192.168.1.1';
$port = '445';
$timeout = '2';

$fp = fsockopen($host, $port, $errno. $errstr, $timeout);

if ($fp)
{
print 'server_up.gif';

}else{

  print 'server_down.gif';

}









Expected result:

Should show the host is not reachable and print the device is down.

Actual result:
--
given the conditions mentioned above, the server should show down, but
the fsockopen says its up.





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