#20268 [Com]: 64-bit PHP 4.3 (extensive long vs int problems)

2003-03-12 Thread j-devenish at users dot sourceforge dot net
 ID:   20268
 Comment by:   j-devenish at users dot sourceforge dot net
 Reported By:  bdabney at dallasnews dot com
 Status:   Critical
 Bug Type: Scripting Engine problem
 Operating System: any 64bit
 PHP Version:  4CVS-2002-11-05
 New Comment:

FWIW, I installed a Stable (4.3.x-dev) snapshot! After ./configure
modifications (relating to hard-coded library paths -- that affects
64-bit RedHat, too, so maybe it will get fixed) it compiled and
installed without crashing. Importantly, this out-of-the-box PHP
actually serves files without crashing (though I get compile warnings
regarding ostensibly non 64 bit-clean code).

One odd thing though: Apache reports that it is running 4.3.0-pre2. In
contrast, Apache reports 4.3.2-dev when I have my php4 (PHP_4_3)
checkout installed.

After modifying the Makefile to run the 'test' target, that does
something, too. It results in a few core dumps, and a few tests still
assume that values are limited to 32-bit precision, but 4.3.2 is still
a step up for anyone who hasn't been able to use PHP 4.3 yet.


Previous Comments:


[2003-03-10 08:56:43] [EMAIL PROTECTED]

Most, if not all issues should now be fixed.
Please give the latest stable snapshot a go.
(http://snaps.php.net/)




[2003-03-04 19:51:26] [EMAIL PROTECTED]

Need to be addressed before 4.3.2 goes out the door.




[2003-02-23 04:36:04] [EMAIL PROTECTED]

http://news.php.net/article.php?group=php.bugsarticle=24417
http://news.php.net/article.php?group=php.bugsarticle=24418





[2003-02-23 03:44:18] j-devenish at users dot sourceforge dot net

Sigh.

Since my entire post of 10/11 Nov has been deleted, and I did not
receive an e-mail copy of my post via the bug submission system, I have
no record of what I said. Presumably I stated that I, too, had
encountered the problem, that I couldn't even install PHP 4.3, that it
was due to int/long size mismatches on LP64 platforms, and then
indicated the strategy I had used to work around it (via patches).

I posted patches and test result information (for HEAD of the day and
also for 4.3.0pre2) to php-dev on 11 November 2002. Thread subject was
64-bit PHP 4.3 (extensive long vs int problems). Those patches are
now out of date because (on the downside) further int/long problems
have crept in and (on the upside) some test cases have been improved.



[2003-02-23 03:17:09] [EMAIL PROTECTED]

[To: j-devenish at users dot sourceforge dot net]

PLEASE do NOT add such long diffs to bug reports!
Instead put them on some site and add an URL to them here.

(I deleted those comments from here now since they're pretty useless as
the bug system mangles them anyway)




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

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



#22655 [NEW]: problems with unset

2003-03-12 Thread stanislav at shramko dot com
From: stanislav at shramko dot com
Operating system: WinXP
PHP version:  4.3.0
PHP Bug Type: Class/Object related
Bug description:  problems with unset

I was very discouraged about the behavior of unset() function with
variables which are
contained in objects in the same time. Also I'm slightly mad about
references to NULL and so on.

?php

// two test classes

class a
{

var $a = null;

function a( $b )
{
$this-a = $b;
}

}

class b
{
var $b = 5;
}

// -- the main part 

// alas, I need to use destructors

$b = new b();
$a = new a( $b );
var_dump( $a ); // checking the object's state
$b-b = 3; // changing it
var_dump( $a ); // Note that value was changed...
unset( $b ); // what are we waiting for?
var_dump( $a ); // but the object's field wasn't affected
$b = null;
var_dump( $a ); // there's no way to destroy this blamed property

echo \n;
// but in case if we will try to assign a null value to this field whilst

// the object is in it's initial state, we're getting another results

$b = new b();
$a = new a( $b );
var_dump( $a );
$b-b = 3;
var_dump( $a ); // Note that value was changed...
$b = null;
var_dump( $a ); // I see, it's a great way to dispose a field of an object
:)
// this reference to NULL looks pretty well, isn't it? :)

?

I've lost the sence of the whole situation at this point.

Regards,
Stanislav.
-- 
Edit bug report at http://bugs.php.net/?id=22655edit=1
-- 
Try a CVS snapshot: http://bugs.php.net/fix.php?id=22655r=trysnapshot
Fixed in CVS:   http://bugs.php.net/fix.php?id=22655r=fixedcvs
Fixed in release:   http://bugs.php.net/fix.php?id=22655r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=22655r=needtrace
Try newer version:  http://bugs.php.net/fix.php?id=22655r=oldversion
Not developer issue:http://bugs.php.net/fix.php?id=22655r=support
Expected behavior:  http://bugs.php.net/fix.php?id=22655r=notwrong
Not enough info:http://bugs.php.net/fix.php?id=22655r=notenoughinfo
Submitted twice:http://bugs.php.net/fix.php?id=22655r=submittedtwice
register_globals:   http://bugs.php.net/fix.php?id=22655r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=22655r=php3
Daylight Savings:   http://bugs.php.net/fix.php?id=22655r=dst
IIS Stability:  http://bugs.php.net/fix.php?id=22655r=isapi
Install GNU Sed:http://bugs.php.net/fix.php?id=22655r=gnused



#22656 [NEW]: socket_set_blocking() won't work?

2003-03-12 Thread thejoshes at josh dot com
From: thejoshes at josh dot com
Operating system: OS X 10.2.3
PHP version:  4.3.1
PHP Bug Type: Sockets related
Bug description:  socket_set_blocking() won't work?

The following script produces this error:

bWarning/b:  socket_set_blocking(): supplied resource is not a valid
stream resource in b/Users/josha/test/noblock.php/b on line
b10/bbr /

Even though the socket connection will work fine... I expect this to work,
since $s is indeed a valid stream resource, right?

#!/usr/local/bin/php
?php

$HOST = 'localhost';
$PORT = 4005;

# set up the server
$s = socket_create(AF_INET, SOCK_STREAM, 0);
$ret = socket_bind($s, $HOST, $PORT);
$ret = socket_set_blocking($s, false); // why is this an issue?
$ret = socket_listen($s, 1);
echo Waiting for connection(s) on PORT $PORT...\n;

while (!$done) {
$u = pollNewConn();
echo $u\n;
}

function pollNewConn() {
global $s;

if ($conn = socket_accept($s)) {
return Connected;
} else {
return No connection;
}
} 
?
-- 
Edit bug report at http://bugs.php.net/?id=22656edit=1
-- 
Try a CVS snapshot: http://bugs.php.net/fix.php?id=22656r=trysnapshot
Fixed in CVS:   http://bugs.php.net/fix.php?id=22656r=fixedcvs
Fixed in release:   http://bugs.php.net/fix.php?id=22656r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=22656r=needtrace
Try newer version:  http://bugs.php.net/fix.php?id=22656r=oldversion
Not developer issue:http://bugs.php.net/fix.php?id=22656r=support
Expected behavior:  http://bugs.php.net/fix.php?id=22656r=notwrong
Not enough info:http://bugs.php.net/fix.php?id=22656r=notenoughinfo
Submitted twice:http://bugs.php.net/fix.php?id=22656r=submittedtwice
register_globals:   http://bugs.php.net/fix.php?id=22656r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=22656r=php3
Daylight Savings:   http://bugs.php.net/fix.php?id=22656r=dst
IIS Stability:  http://bugs.php.net/fix.php?id=22656r=isapi
Install GNU Sed:http://bugs.php.net/fix.php?id=22656r=gnused



#22633 [Bgs]: mm save_handler does not work

2003-03-12 Thread ermannov at netscape dot net
 ID:   22633
 User updated by:  ermannov at netscape dot net
 Reported By:  ermannov at netscape dot net
 Status:   Bogus
 Bug Type: Session related
 Operating System: Windows NT 4
 PHP Version:  4CVS-2003-03-11 (stable)
 New Comment:

Italian version of ther manual doesn't say it. Is this a documentation
problem?


Previous Comments:


[2003-03-11 20:52:03] [EMAIL PROTECTED]

MM save_handler is not available on windows, as is said on
the manual too:

http://www.php.net/manual/fi/ref.session.php



[2003-03-11 05:11:19] ermannov at netscape dot net

I made two scripts, first one has got a link to second one.
If session.save_handler=mm, on Page 2 I can see $_SESSION is null. The
scripts work when session.save_handler=files.
It also happens with Windows 98 SE.

pag1.php
?php
session_start();
$_SESSION['variable']=1;
?
html
head
title
Page 1
/title
/head
body
?php
var_dump($_SESSION);
?
a href=pag2.phpPage 2/a
/body
/html

pag2.php
?php
session_start();
?
html
head
title
Page 2
/title
/head
body
?php
var_dump($_SESSION);
?
/body
/html

Modules:
extension=php_cpdf.dll
extension=php_dbx.dll
extension=php_exif.dll
extension=php_java.dll
extension=php_mhash.dll
extension=php_mssql.dll
extension=php_openssl.dll
extension=php_pdf.dll
extension=php_mcrypt.dll

Session configuration:
session.save_handler  = mm
session.save_path = c:/temp
session.use_cookies   = 1
session.name  = PHPSESSID  
session.auto_start= 0   
session.cookie_lifetime   = 0   
session.cookie_path   = /   
session.cookie_domain = 
session.serialize_handler = php 
session.gc_probability= 5   
session.gc_maxlifetime= 600
session.referer_check = 
session.entropy_length= 0   
session.entropy_file  = 
session.cache_limiter = nocache 
session.cache_expire  = 180 
session.use_trans_sid = 1
url_rewriter.tags =
a=href,area=href,frame=src,input=src,form=fakeentry




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



#22636 [Bgs]: the function mysql_query makes errors in PHP variables

2003-03-12 Thread real_mctl at yahoo dot fr
 ID:   22636
 User updated by:  real_mctl at yahoo dot fr
 Reported By:  real_mctl at yahoo dot fr
 Status:   Bogus
 Bug Type: MySQL related
 Operating System: Linux Red Hat 7.2
 PHP Version:  4.3.1
 New Comment:

?
function fSelectionnerNiveauSuivi($tabNiveauSuivi)
{
$succes=false;
if ( ($idLienCnx=fConnecterBase(CONFIG_SUJET)) != false) //
fConnecterBase() works properly, parses a constant who contains
identifiers for the connection to the database
{
if (($resultat = fSelectNiveauSuivi($idLienCnx))!= false) 
{
$succes=true;
while ($ligne=mysql_fetch_object($resultat))
{

$tabNiveauSuivi['idNiveauSuivi'][]=$ligne-idNiveauSuivi;
$tabNiveauSuivi['nom'][]=$ligne-nom;

}
$succes = fLiberer($resultat,$succes); // fLiberer() 
free the
memory (works properly)
}
$succes=fDeconnecterBase($idLienCnx,$succes); // 
fDeconnecterBase()
close the connection with the base
}
return $succes ;
}

function fSelectNiveauSuivi($idLienCnx)
{
$requete=SELECT * FROM NiveauSuivi ORDER BY nom ;
$resultat=fEmettreRequete($requete,$idLienCnx) ;
return $resultat ;
}

function fEmettreRequete($requete,$idLienCnx) 
{
// Emission de la requête
$resultat = @mysql_query($requete,$idLienCnx);

if ($resultat==false) 
{
// Requête en erreur
fEnregistrerErreur(mysql_errno(), mysql_error() .  Requete: .
$requete) ; // fEnregistrerErreur() mails the webmaster that an error
occured when quering the database
}

// Retour
return $resultat ;
}

$succes = fSelectionnerNiveauSuivi($tabNiveauSuivi) ;
?

OK !
The script works perfect with PHP 4.1.2 but with 4.3.1, it does not
work
One other detail : the functions listed above are in different include
files and the include instruction is always called when necessary.
After all, if I reload the page with the script, i have no problem

Is this bogus again ??

Thanks


Previous Comments:


[2003-03-11 20:39:34] [EMAIL PROTECTED]

Can't reproduce. You're doing something wrong obviously.




[2003-03-11 14:40:06] real_mctl at yahoo dot fr

no need to copy the entire code (huge app).
the code before and after mysql_query is correct.



[2003-03-11 11:20:17] [EMAIL PROTECTED]

And add a _FULL_ but short example script here, not just 2 lines from
one..




[2003-03-11 11:19:37] [EMAIL PROTECTED]

huh? What if you remove that @ from the mysql_query() call?




[2003-03-11 10:21:14] real_mctl at yahoo dot fr

It's simple, my entreprise updated the version of PHP, from 4.1.2 to
4.3.1.
The problem is that when the function mysql_query is executing some
query, this function overwrite all data on my PHP script even the query
itself !

An example (the query is indeed correct) :

$query = select * from table ;
$result = @mysql_query($query,$idCnx) ;
The execution of the query crashes, return 1 (don't return a ressource
id) and owerwrite the content of $query to an empty value !


Thanks




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



#22636 [Bgs]: the function mysql_query makes errors in PHP variables

2003-03-12 Thread real_mctl at yahoo dot fr
 ID:   22636
 User updated by:  real_mctl at yahoo dot fr
 Reported By:  real_mctl at yahoo dot fr
 Status:   Bogus
 Bug Type: MySQL related
 Operating System: Linux Red Hat 7.2
 PHP Version:  4.3.1
 New Comment:

a


Previous Comments:


[2003-03-12 02:49:25] real_mctl at yahoo dot fr

?
function fSelectionnerNiveauSuivi($tabNiveauSuivi)
{
$succes=false;
if ( ($idLienCnx=fConnecterBase(CONFIG_SUJET)) != false) //
fConnecterBase() works properly, parses a constant who contains
identifiers for the connection to the database
{
if (($resultat = fSelectNiveauSuivi($idLienCnx))!= false) 
{
$succes=true;
while ($ligne=mysql_fetch_object($resultat))
{

$tabNiveauSuivi['idNiveauSuivi'][]=$ligne-idNiveauSuivi;
$tabNiveauSuivi['nom'][]=$ligne-nom;

}
$succes = fLiberer($resultat,$succes); // fLiberer() 
free the
memory (works properly)
}
$succes=fDeconnecterBase($idLienCnx,$succes); // 
fDeconnecterBase()
close the connection with the base
}
return $succes ;
}

function fSelectNiveauSuivi($idLienCnx)
{
$requete=SELECT * FROM NiveauSuivi ORDER BY nom ;
$resultat=fEmettreRequete($requete,$idLienCnx) ;
return $resultat ;
}

function fEmettreRequete($requete,$idLienCnx) 
{
// Emission de la requête
$resultat = @mysql_query($requete,$idLienCnx);

if ($resultat==false) 
{
// Requête en erreur
fEnregistrerErreur(mysql_errno(), mysql_error() .  Requete: .
$requete) ; // fEnregistrerErreur() mails the webmaster that an error
occured when quering the database
}

// Retour
return $resultat ;
}

$succes = fSelectionnerNiveauSuivi($tabNiveauSuivi) ;
?

OK !
The script works perfect with PHP 4.1.2 but with 4.3.1, it does not
work
One other detail : the functions listed above are in different include
files and the include instruction is always called when necessary.
After all, if I reload the page with the script, i have no problem

Is this bogus again ??

Thanks



[2003-03-11 20:39:34] [EMAIL PROTECTED]

Can't reproduce. You're doing something wrong obviously.




[2003-03-11 14:40:06] real_mctl at yahoo dot fr

no need to copy the entire code (huge app).
the code before and after mysql_query is correct.



[2003-03-11 11:20:17] [EMAIL PROTECTED]

And add a _FULL_ but short example script here, not just 2 lines from
one..




[2003-03-11 11:19:37] [EMAIL PROTECTED]

huh? What if you remove that @ from the mysql_query() call?




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

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



#22642 [Fbk-Csd]: After saving a session var in a var, nulling the session var clears the 2nd var

2003-03-12 Thread dave at orangechicken dot com
 ID:   22642
 User updated by:  dave at orangechicken dot com
 Reported By:  dave at orangechicken dot com
-Status:   Feedback
+Status:   Closed
 Bug Type: Session related
 Operating System: Linux / Apache 1.3.27
 PHP Version:  4.3.1
 New Comment:

I'm uber-tarded. I found the solution an hour later or so (and it's the
same one suggested above). I used an .htaccess file to turn
register_globals off. I had been working in my dev environment so long
(with register_globals off in php.ini) that I didn't even think about
that when I moved to the live environment (which defaults to on).

My bad. Case closed.


Previous Comments:


[2003-03-11 21:07:22] [EMAIL PROTECTED]

Please provide a short but complete example script.

And is register_globals=off ?
And what about session.bug_compat_42 and session.bug_compat_warn?

Put 'error_reporting(E_ALL);' as first line in your script,
you propably get some errors..





[2003-03-11 15:54:35] dave at orangechicken dot com

OK, the summary was too short to concisely enter what I mean. Here's
the real version:

After assigning a stored $_SESSION var to another variable, assigning
null to the $_SESSION var clears the other variable too.

This worked before 4.3.1 (possibly occurred in 4.3.0 - we skipped from
4.2.7 to 4.3.1).

Here's a snippet where the problem occurs. $_SESSION[ 'login_redirect'
] contains the value 'checkout.php'.


$redirect = $_SESSION[ 'login_redirect' ];
echo $redirect; // outputs checkout.php
$_SESSION[ 'login_redirect' ] = null;
echo $redirect; // outputs nothing


Here's the configure string
'./configure' '--with-apxs=/usr/local/apache/bin/apxs' '--with-xml'
'--enable-bcmath' '--enable-calendar' '--with-curl' '--enable-ftp'
'--with-gd' '--with-jpeg-dir=/usr/local' '--with-png-dir=/usr'
'--with-xpm-dir=/usr/X11R6' '--with-imap' '--with-imap-ssl'
'--with-kerberos' '--with-mcrypt' '--enable-magic-quotes'
'--with-mysql' '--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'








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



#22656 [Opn-Bgs]: socket_set_blocking() won't work?

2003-03-12 Thread wez
 ID:   22656
 Updated by:   [EMAIL PROTECTED]
 Reported By:  thejoshes at josh dot com
-Status:   Open
+Status:   Bogus
 Bug Type: Sockets related
 Operating System: OS X 10.2.3
 PHP Version:  4.3.1
 New Comment:

I was going to suggest reading the manual, however this point is not
made clear:

socket_set_blocking() has nothing to do with the sockets extension, and
that is the reason that we changed its name:

http://www.php.net/manual/en/function.socket-set-blocking.php

http://www.php.net/manual/en/function.stream-set-blocking.php

To acheive non-blocking ext/sockets, you need to call this function:
http://www.php.net/manual/en/function.socket-set-nonblock.php


Previous Comments:


[2003-03-12 02:32:21] thejoshes at josh dot com

The following script produces this error:

bWarning/b:  socket_set_blocking(): supplied resource is not a
valid stream resource in b/Users/josha/test/noblock.php/b on line
b10/bbr /

Even though the socket connection will work fine... I expect this to
work, since $s is indeed a valid stream resource, right?

#!/usr/local/bin/php
?php

$HOST = 'localhost';
$PORT = 4005;

# set up the server
$s = socket_create(AF_INET, SOCK_STREAM, 0);
$ret = socket_bind($s, $HOST, $PORT);
$ret = socket_set_blocking($s, false); // why is this an issue?
$ret = socket_listen($s, 1);
echo Waiting for connection(s) on PORT $PORT...\n;

while (!$done) {
$u = pollNewConn();
echo $u\n;
}

function pollNewConn() {
global $s;

if ($conn = socket_accept($s)) {
return Connected;
} else {
return No connection;
}
} 
?




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



#22635 [Bgs-Opn]: 1.1.1970 24 hours in [gm]mktime

2003-03-12 Thread jsteen at timecom dot com
 ID:   22635
 User updated by:  jsteen at timecom dot com
 Reported By:  jsteen at timecom dot com
-Status:   Bogus
+Status:   Open
 Bug Type: Date/time related
 Operating System: win32
 PHP Version:  4.3.1
 New Comment:

WE F...ING KNOW mktime, gmmktime etc. WORK FINE ON *NIX!
THIS IS A WIN REPORT!

[flame: on]
is it a new policy on bugs.php.net to NOT read post
headers/declarations, write works fine with linux as answer, and put
the bug on 'BOGUS'?

i'm among the many users that are pissed that all the
timestamp-functions are buggy on win. ok. fine. deal. but then please
take our reports seriously and put a proper comment in the man! i
really begin to wonder whether you're not just too lazy to seriously
deal with it if i get this sorts of answers.
[flame: off]

so why does 1.1.1970 not have 24h?

please omit any of the usual answers, like:
- works fine for linux
- blame MS


Previous Comments:


[2003-03-11 11:15:13] [EMAIL PROTECTED]

Works fine with Linux.




[2003-03-11 07:53:26] jsteen at timecom dot com

1.1.1970 does not have 24 hours!

-
for ($i = 1 ; $i 365; $i++){
$date = mktime(0,0,0,1,$i,1970);
$date1 = mktime(0,0,0,1,$i+1,1970);

echo br $i:  .gmdate(Y m d, $date) .  ;
echo ($date1 - $date ) /3600 . h;
}
-
1: 23.000278 h
2: 1970 01 01 24 h
3: 1970 01 02 24 h
4: 1970 01 03 24 h
...


-
for ($i = 1 ; $i 365; $i++){
$date = gmmktime(0,0,0,1,$i,1970);
$date1 = gmmktime(0,0,0,1,$i+1,1970);
echo br $i:  .gmdate(Y m d, $date) .  ;
echo ($date1 - $date ) /3600 . h;
}
-
1: 24.000278 h
2: 1970 01 02 24 h
3: 1970 01 03 24 h
4: 1970 01 04 24 h
...

-










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



#22657 [NEW]: Weak parsing in rfc1867.c

2003-03-12 Thread vesely at tana dot it
From: vesely at tana dot it
Operating system: Any
PHP version:  4.3.0
PHP Bug Type: HTTP related
Bug description:  Weak parsing in rfc1867.c

Hi,
watch out rfc1867.c around line 342, in function
next_line() there is (was?) the following code:

if (ptr) {
/* ... */   
} else {
/* ... */

line[self-bufsize] = 0;
self-buf_begin = ptr;/* === */
self-bytes_in_buffer = 0;
}

ptr is obviously NULL, buf_begin should never be NULL
or the program may crash. So this is a potential
vulnerability for DOS attackers who submit long lines.

Since you're there, would you mind to check why at line
721, in the rfc1867_post_handler function, there is

boundary_end = strchr(boundary, ',');

Shouldn't it be ';' (semicolon) rather than ',' (comma)?
(Just wandering)
-- 
Edit bug report at http://bugs.php.net/?id=22657edit=1
-- 
Try a CVS snapshot: http://bugs.php.net/fix.php?id=22657r=trysnapshot
Fixed in CVS:   http://bugs.php.net/fix.php?id=22657r=fixedcvs
Fixed in release:   http://bugs.php.net/fix.php?id=22657r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=22657r=needtrace
Try newer version:  http://bugs.php.net/fix.php?id=22657r=oldversion
Not developer issue:http://bugs.php.net/fix.php?id=22657r=support
Expected behavior:  http://bugs.php.net/fix.php?id=22657r=notwrong
Not enough info:http://bugs.php.net/fix.php?id=22657r=notenoughinfo
Submitted twice:http://bugs.php.net/fix.php?id=22657r=submittedtwice
register_globals:   http://bugs.php.net/fix.php?id=22657r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=22657r=php3
Daylight Savings:   http://bugs.php.net/fix.php?id=22657r=dst
IIS Stability:  http://bugs.php.net/fix.php?id=22657r=isapi
Install GNU Sed:http://bugs.php.net/fix.php?id=22657r=gnused



#12418 [Com]: ndbm - driver initialization

2003-03-12 Thread b0nks at nerim dot net
 ID:   12418
 Comment by:   b0nks at nerim dot net
 Reported By:  r dot greil at jusline dot com
 Status:   Bogus
 Bug Type: DBM/DBA related
 Operating System: Suse 7.1
 PHP Version:  4.0.6
 New Comment:

The bug is also present in the lastest version
I've tested under Debian Potato 3.0 (kernel 2.2.22) and under Windows
XP: Same pb.
ndbm is bogus, but the db2 type seems to be bogus too..


Previous Comments:


[2002-05-25 09:02:18] [EMAIL PROTECTED]

Thank you for taking the time to report a problem with PHP.
Unfortunately your version of PHP is too old -- the problem
might already be fixed. Please download a new PHP
version from http://www.php.net/downloads.php

If you are able to reproduce the bug with one of the latest
versions of PHP, please change the PHP version on this bug report
to the version you tested and change the status back to Open.
Again, thank you for your continued support of PHP.





[2001-07-27 06:26:04] r dot greil at jusline dot com

$handle = dbm_open(/usr/local/berkeley/nu, c, ndbm);


Error: 
  Warning: driver initialization failed in
/usr/local/apache/htdocs/test.php on line 2

My compilation:
  ./configure --with-apache=../apache_1.3.19 --with-ndbm --enable-dba
enable-track-vars




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



#16173 [Com]: https headers (Content-type) not working

2003-03-12 Thread vukko at cequrux dot com
 ID:   16173
 Comment by:   vukko at cequrux dot com
 Reported By:  phpbug at aelea dot com
 Status:   Bogus
 Bug Type: IIS related
 Operating System: win2k SP2
 PHP Version:  4.1.2
 New Comment:

I experienced this problem on a FreeBSD platform with Apache 1.3.27 and
PHP 4.2.3.
I originally thought it was the 'Set-Cookie: ' header because removing
my session_start(); function fixed the problem, but then I noticed that
this also caused the following header to be sent:
'Cache-Control: no-store, no-cache, must-revalidate, post-check=0,
pre-check=0'
I then changed the 'session.cache_limiter' directive in php.ini from
'nocache' to 'private' which fixed the problem. This is the header it
sends:
'Cache-Control: private, max-age=10800, pre-check=10800'
After some more experimaentation, it would appear to be the 'no-cache'
part of the 'Cache-Control: ' header that is causing the problem.
--Marko.


Previous Comments:


[2003-02-08 18:38:14] rq at erasethis dot uosis dot mif dot vu dot lt
dot removeme

Well, seems like the workaround from the user end is just choosing an
appropriate encoding when viewing a webpage. I was trying to see a
squirrelmail login page from my home box thru https and it did not
display. When i chose view source, i can see everything in notepad.
Then i found that under View  Encoding the selected option is
Estonian(ISO) which is marked gray (as unavailable). When I changed the
encoding to any else (even if it wasn't right for that page), i could
see that page. 
in my case, the server is FreeBSD + apache-ssl + php, and the client is
my home box running Win98+IE6.0



[2002-11-13 06:54:18] rupert dot schlick at gmx dot net

the relevant article is:
http://support.microsoft.com/default.aspx?scid=kb;en-us;316431



[2002-08-16 03:01:21] [EMAIL PROTECTED]

This is an Internet Explorer Bug. Search the Microsoft Knowledgebase.
It has something to do with the caching headers.



[2002-08-15 18:08:50] caetin at u dot washington dot edu

this isn't just an issue in https and windows, its also http, and also
on linux. If you have session_start in there and just put out a
content-type and content-disposition, it will barf on you if you try to
choose open instead of save .. save works fine. If you take out
the session-start() it works great. If you use the headers trick noted
two posts up, it also works great. 

Tested under ie4/5/5.5/6 ns4.78/4.79/6



[2002-07-10 15:14:16] jeffcool at hotmail dot com

Apache 1.3.26 and PHP 4.2.1 

I also came across this issue, and [EMAIL PROTECTED] headers (minus
the last one) FIX the problem.  However in trying to tack down the
issue I found that taking out the session check on the page also fixed
the problem?  It seems odd that using sessions would change the
behavior of IE.



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

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



#22656 [Bgs-Opn]: socket_set_blocking() won't work?

2003-03-12 Thread thejoshes at josh dot com
 ID:   22656
 User updated by:  thejoshes at josh dot com
 Reported By:  thejoshes at josh dot com
-Status:   Bogus
+Status:   Open
 Bug Type: Sockets related
 Operating System: OS X 10.2.3
 PHP Version:  4.3.1
 New Comment:

Interesting. When I use socket_set_nonblock($s); instead, I get the
following error, repeatedly:

bWarning/b:  socket_accept() unable to accept incoming connection
[35]: Resource temporarily unavailable in
b/Users/josha/test/noblock.php/b on line b27/b


Previous Comments:


[2003-03-12 03:29:39] [EMAIL PROTECTED]

I was going to suggest reading the manual, however this point is not
made clear:

socket_set_blocking() has nothing to do with the sockets extension, and
that is the reason that we changed its name:

http://www.php.net/manual/en/function.socket-set-blocking.php

http://www.php.net/manual/en/function.stream-set-blocking.php

To acheive non-blocking ext/sockets, you need to call this function:
http://www.php.net/manual/en/function.socket-set-nonblock.php



[2003-03-12 02:32:21] thejoshes at josh dot com

The following script produces this error:

bWarning/b:  socket_set_blocking(): supplied resource is not a
valid stream resource in b/Users/josha/test/noblock.php/b on line
b10/bbr /

Even though the socket connection will work fine... I expect this to
work, since $s is indeed a valid stream resource, right?

#!/usr/local/bin/php
?php

$HOST = 'localhost';
$PORT = 4005;

# set up the server
$s = socket_create(AF_INET, SOCK_STREAM, 0);
$ret = socket_bind($s, $HOST, $PORT);
$ret = socket_set_blocking($s, false); // why is this an issue?
$ret = socket_listen($s, 1);
echo Waiting for connection(s) on PORT $PORT...\n;

while (!$done) {
$u = pollNewConn();
echo $u\n;
}

function pollNewConn() {
global $s;

if ($conn = socket_accept($s)) {
return Connected;
} else {
return No connection;
}
} 
?




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



#22623 [Fbk-Opn]: In MSSQL 2000 Server real type is read as unknown type

2003-03-12 Thread tolochanov at elit dot lviv dot net
 ID:   22623
 User updated by:  tolochanov at elit dot lviv dot net
 Reported By:  tolochanov at elit dot lviv dot net
-Status:   Feedback
+Status:   Open
 Bug Type: MSSQL related
 Operating System: Windows 2000 Professional SP3
 PHP Version:  4.3.1
 New Comment:

Latest Linux version works good.
Latest Windows version still don't read type 'real' correctly.


Previous Comments:


[2003-03-11 11:04:54] [EMAIL PROTECTED]

Thanks? Did it work with the snapshot?




[2003-03-11 02:46:20] tolochanov at elit dot lviv dot net

Thanks!



[2003-03-10 09:22:23] [EMAIL PROTECTED]

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





[2003-03-10 07:59:29] tolochanov at elit dot lviv dot net

I used  mssql_fetch_row() function.



[2003-03-10 07:54:49] tolochanov at elit dot lviv dot net

SQL 2000 Server on Win2000 Adv Server
Apache 2.0.43,PHP 4.3.1 on Win 2000 SP3

   While attempting to read field which contains data of 'real' type
(for ex. - 24,00 168,00 etc.), I get some sort of '1.36741241919E-304'
or other number near zero on every attempt. If I set that field to
SmallInt, the reading is OK.
   Function mssql_field_type() returns type 'unknown'.




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



#22658 [NEW]: Spontaneous start of new session and lost of session data

2003-03-12 Thread misha at family dot intes dot odessa dot ua
From: misha at family dot intes dot odessa dot ua
Operating system: Linux Red Hat 7.3 , Windows 98
PHP version:  4.3.0
PHP Bug Type: Session related
Bug description:  Spontaneous start of new session and lost of session data

People of the world!

Who can help me and save from shame?

I developed Web-site written on PHP which intensively uses
session mechanism. I have a copy of this site on my
home computer with Windows-98 (Apache 1.3.24 and PHP 4.3.0
are generated). Real site works on the server with
Linux Red Hat 7.3, Apache 1.3.22, PHP 4.2.2 .

When using Internet Explorer in both variants (local
copy or real site) I suffer from the next effect:
Sequential enter on the page generated by the same
PHP script which uses session data can occur about
20 times without errors. The next visit of this page
produces new session (I can check this) and all my
parameters stored in session are lost.

When working with Netscape Navigator everything is OK.

Does anybody know the solution?

Michael.
-- 
Edit bug report at http://bugs.php.net/?id=22658edit=1
-- 
Try a CVS snapshot: http://bugs.php.net/fix.php?id=22658r=trysnapshot
Fixed in CVS:   http://bugs.php.net/fix.php?id=22658r=fixedcvs
Fixed in release:   http://bugs.php.net/fix.php?id=22658r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=22658r=needtrace
Try newer version:  http://bugs.php.net/fix.php?id=22658r=oldversion
Not developer issue:http://bugs.php.net/fix.php?id=22658r=support
Expected behavior:  http://bugs.php.net/fix.php?id=22658r=notwrong
Not enough info:http://bugs.php.net/fix.php?id=22658r=notenoughinfo
Submitted twice:http://bugs.php.net/fix.php?id=22658r=submittedtwice
register_globals:   http://bugs.php.net/fix.php?id=22658r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=22658r=php3
Daylight Savings:   http://bugs.php.net/fix.php?id=22658r=dst
IIS Stability:  http://bugs.php.net/fix.php?id=22658r=isapi
Install GNU Sed:http://bugs.php.net/fix.php?id=22658r=gnused



#22658 [Opn-Bgs]: Spontaneous start of new session and lost of session data

2003-03-12 Thread magnus
 ID:   22658
 Updated by:   [EMAIL PROTECTED]
 Reported By:  misha at family dot intes dot odessa dot ua
-Status:   Open
+Status:   Bogus
 Bug Type: Session related
 Operating System: Linux Red Hat 7.3 , Windows 98
 PHP Version:  4.3.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.

.


Previous Comments:


[2003-03-12 07:26:17] misha at family dot intes dot odessa dot ua

People of the world!

Who can help me and save from shame?

I developed Web-site written on PHP which intensively uses
session mechanism. I have a copy of this site on my
home computer with Windows-98 (Apache 1.3.24 and PHP 4.3.0
are generated). Real site works on the server with
Linux Red Hat 7.3, Apache 1.3.22, PHP 4.2.2 .

When using Internet Explorer in both variants (local
copy or real site) I suffer from the next effect:
Sequential enter on the page generated by the same
PHP script which uses session data can occur about
20 times without errors. The next visit of this page
produces new session (I can check this) and all my
parameters stored in session are lost.

When working with Netscape Navigator everything is OK.

Does anybody know the solution?

Michael.




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



#22649 [Opn]: odbc_connect FATAL: erealloc()

2003-03-12 Thread ottawasixtyseven at hotmail dot com
 ID:   22649
 User updated by:  ottawasixtyseven at hotmail dot com
 Reported By:  ottawasixtyseven at hotmail dot com
 Status:   Open
 Bug Type: ODBC related
 Operating System: Windows
 PHP Version:  4CVS-2003-03-11 (stable)
 New Comment:

My programmers said my description was note quite accurate. Here is the
programmers version of our problem:

I can't get our application running on the latest snapshot. I can run
phpinfo() but when I try to use
 $DB  = odbc_connect ( 'database', '', ''); and then try to create a
table I get errors:

include('common.php'); // this include has
$DB = odbc_connect ('dsn' ,'', '');
i do an echo of $DB in common.php and get Resource id #3
then in the main script.
echo THE VALUE OF THE DB IS : $DB;

$SQL = CREATE TABLE $TableName ($TableColumns);
if ( !odbc_exec ( $DB, $SQL ) )
{
  echo FAILURE OF '$SQL' !br\n;
  $Errors++;
}
else
{
  echo OK! br\n;
}

when i echo $DB again just before the odbc_exec I get:
FATAL: erealloc(): Unable to allocate 1331643757 bytes
I have tried installing the latest snapshot on three separate servers.

Two that were already running PHP 4.3 and one clean server.

this code works on all other versions of php except the latest
snapshot.

Ottawa


Previous Comments:


[2003-03-11 22:17:20] ottawasixtyseven at hotmail dot com

I can't get our application running on the latest snapshot. I can run
phpinfo() but when I try to use $DB  = odbc_connect ( 'database', '',
'' ); and then try to create a table I get errors:

echo THE VALUE OF THE DB IS : $DB;

$SQL = CREATE TABLE $TableName ($TableColumns);
if ( !odbc_exec ( $DB, $SQL ) )
{
  echo FAILURE OF '$SQL' !br\n;
  $Errors++;
}
else
{
  echo OK! br\n;
}

For the first echo statement above I get Resource id #3
When I try to create the table I get:
FATAL: erealloc(): Unable to allocate 1331643757 bytes

I have tried installing the latest snapshot on three separate servers.
Two that were already running PHP 4.3 and one clean server.

Ottawa





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



#22658 [Bgs]: Spontaneous start of new session and lost of session data

2003-03-12 Thread misha at family dot intes dot odessa dot ua
 ID:   22658
 User updated by:  misha at family dot intes dot odessa dot ua
 Reported By:  misha at family dot intes dot odessa dot ua
 Status:   Bogus
 Bug Type: Session related
 Operating System: Linux Red Hat 7.3 , Windows 98
 PHP Version:  4.3.0
 New Comment:

I have thought that you boys want PHP working everywhere successfully.


Previous Comments:


[2003-03-12 07:36:38] [EMAIL PROTECTED]

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.

.



[2003-03-12 07:26:17] misha at family dot intes dot odessa dot ua

People of the world!

Who can help me and save from shame?

I developed Web-site written on PHP which intensively uses
session mechanism. I have a copy of this site on my
home computer with Windows-98 (Apache 1.3.24 and PHP 4.3.0
are generated). Real site works on the server with
Linux Red Hat 7.3, Apache 1.3.22, PHP 4.2.2 .

When using Internet Explorer in both variants (local
copy or real site) I suffer from the next effect:
Sequential enter on the page generated by the same
PHP script which uses session data can occur about
20 times without errors. The next visit of this page
produces new session (I can check this) and all my
parameters stored in session are lost.

When working with Netscape Navigator everything is OK.

Does anybody know the solution?

Michael.




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



#21672 [Com]: error_log directive doens't work as expected

2003-03-12 Thread rubens_gomes at hotmail dot com
 ID:   21672
 Comment by:   rubens_gomes at hotmail dot com
 Reported By:  me at hansspaans dot nl
 Status:   Bogus
 Bug Type: PHP options/info functions
 Operating System: Linux
 PHP Version:  4.3.0
 New Comment:

I also have the same problem.  I have php 4.3.1 running with apache
1.3.27 on Sun Solaris.  The error_log directive in php.ini does NOT
appear to work, as the PHP logs are being sent to apache error_log file
instead.

Rubens.


Previous Comments:


[2003-01-18 17:30:10] h-wolters at nl dot linux dot org

Jani,

Maybe Hans wasn't clear enough and you got confused by the word error
log.

He mentioned the following error:

ErrorLog /path/file

The output is currently being sent to the apache error log

Kind regards,

Hans (a.k.a. onki, having the same problem)



[2003-01-17 21:05:00] [EMAIL PROTECTED]

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.

Works fine here (and on one Xserver too :)




[2003-01-15 16:37:23] me at hansspaans dot nl

The error_log directive in php.ini doesn't work as expected. If I set
the error_log directive to a file that 
exist and is writeable for apache it will not be used. Apache will put
the php-errors in his errorlog 
instead of the one in php.ini. I also tested it on a php 4.1.2 system
it has also the same issue.





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



#22649 [Opn]: odbc_connect FATAL: erealloc()

2003-03-12 Thread ottawasixtyseven at hotmail dot com
 ID:   22649
 User updated by:  ottawasixtyseven at hotmail dot com
 Reported By:  ottawasixtyseven at hotmail dot com
 Status:   Open
 Bug Type: ODBC related
 Operating System: Windows
 PHP Version:  4CVS-2003-03-11 (stable)
 New Comment:

This is fixed in the latest 4.3 snapshot March 12 2003.

Thank you for the quick response.

Ottawa


Previous Comments:


[2003-03-12 07:38:15] ottawasixtyseven at hotmail dot com

My programmers said my description was note quite accurate. Here is the
programmers version of our problem:

I can't get our application running on the latest snapshot. I can run
phpinfo() but when I try to use
 $DB  = odbc_connect ( 'database', '', ''); and then try to create a
table I get errors:

include('common.php'); // this include has
$DB = odbc_connect ('dsn' ,'', '');
i do an echo of $DB in common.php and get Resource id #3
then in the main script.
echo THE VALUE OF THE DB IS : $DB;

$SQL = CREATE TABLE $TableName ($TableColumns);
if ( !odbc_exec ( $DB, $SQL ) )
{
  echo FAILURE OF '$SQL' !br\n;
  $Errors++;
}
else
{
  echo OK! br\n;
}

when i echo $DB again just before the odbc_exec I get:
FATAL: erealloc(): Unable to allocate 1331643757 bytes
I have tried installing the latest snapshot on three separate servers.

Two that were already running PHP 4.3 and one clean server.

this code works on all other versions of php except the latest
snapshot.

Ottawa



[2003-03-11 22:17:20] ottawasixtyseven at hotmail dot com

I can't get our application running on the latest snapshot. I can run
phpinfo() but when I try to use $DB  = odbc_connect ( 'database', '',
'' ); and then try to create a table I get errors:

echo THE VALUE OF THE DB IS : $DB;

$SQL = CREATE TABLE $TableName ($TableColumns);
if ( !odbc_exec ( $DB, $SQL ) )
{
  echo FAILURE OF '$SQL' !br\n;
  $Errors++;
}
else
{
  echo OK! br\n;
}

For the first echo statement above I get Resource id #3
When I try to create the table I get:
FATAL: erealloc(): Unable to allocate 1331643757 bytes

I have tried installing the latest snapshot on three separate servers.
Two that were already running PHP 4.3 and one clean server.

Ottawa





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



#22659 [NEW]: set_error_handler(foo) doesn't care if foo exists

2003-03-12 Thread steil at zweitwerk dot com
From: steil at zweitwerk dot com
Operating system: Linux
PHP version:  4.2.3
PHP Bug Type: Unknown/Other Function
Bug description:  set_error_handler(foo) doesn't care if foo exists

What I mean is the following

?php
// first call returns nothing
$ret1 = set_error_handler(unknown_function);
var_dump($ret1);

// second call returns unknown_function
$ret2 = set_error_handler(another_unknown_function);
var_dump($ret2);
?

The documentation says set_error_handler() would return FALSE if an error
occurs. Therefore, both of the above calls should return FALSE since
setting the error handler to an unknown function is certainly an error.

As a consequence I am not able to check if the call to set_error_handler()
has been successful.
-- 
Edit bug report at http://bugs.php.net/?id=22659edit=1
-- 
Try a CVS snapshot: http://bugs.php.net/fix.php?id=22659r=trysnapshot
Fixed in CVS:   http://bugs.php.net/fix.php?id=22659r=fixedcvs
Fixed in release:   http://bugs.php.net/fix.php?id=22659r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=22659r=needtrace
Try newer version:  http://bugs.php.net/fix.php?id=22659r=oldversion
Not developer issue:http://bugs.php.net/fix.php?id=22659r=support
Expected behavior:  http://bugs.php.net/fix.php?id=22659r=notwrong
Not enough info:http://bugs.php.net/fix.php?id=22659r=notenoughinfo
Submitted twice:http://bugs.php.net/fix.php?id=22659r=submittedtwice
register_globals:   http://bugs.php.net/fix.php?id=22659r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=22659r=php3
Daylight Savings:   http://bugs.php.net/fix.php?id=22659r=dst
IIS Stability:  http://bugs.php.net/fix.php?id=22659r=isapi
Install GNU Sed:http://bugs.php.net/fix.php?id=22659r=gnused



#22660 [NEW]: $_GLOBALS variable

2003-03-12 Thread pierre dot thierry at moine-fou dot org
From: pierre dot thierry at moine-fou dot org
Operating system: Debian 3.0r1 GNU/Linux 2.4.19
PHP version:  4.3.1
PHP Bug Type: Feature/Change Request
Bug description:  $_GLOBALS variable

For consistency with other autoglobals, $GLOBALS shoudl also be accessible
by $_GLOBALS. (or become $_GLOBALS, but this would break many scripts...)
-- 
Edit bug report at http://bugs.php.net/?id=22660edit=1
-- 
Try a CVS snapshot: http://bugs.php.net/fix.php?id=22660r=trysnapshot
Fixed in CVS:   http://bugs.php.net/fix.php?id=22660r=fixedcvs
Fixed in release:   http://bugs.php.net/fix.php?id=22660r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=22660r=needtrace
Try newer version:  http://bugs.php.net/fix.php?id=22660r=oldversion
Not developer issue:http://bugs.php.net/fix.php?id=22660r=support
Expected behavior:  http://bugs.php.net/fix.php?id=22660r=notwrong
Not enough info:http://bugs.php.net/fix.php?id=22660r=notenoughinfo
Submitted twice:http://bugs.php.net/fix.php?id=22660r=submittedtwice
register_globals:   http://bugs.php.net/fix.php?id=22660r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=22660r=php3
Daylight Savings:   http://bugs.php.net/fix.php?id=22660r=dst
IIS Stability:  http://bugs.php.net/fix.php?id=22660r=isapi
Install GNU Sed:http://bugs.php.net/fix.php?id=22660r=gnused



#22649 [Opn-Csd]: odbc_connect FATAL: erealloc()

2003-03-12 Thread moriyoshi
 ID:   22649
 Updated by:   [EMAIL PROTECTED]
 Reported By:  ottawasixtyseven at hotmail dot com
-Status:   Open
+Status:   Closed
 Bug Type: ODBC related
 Operating System: Windows
 PHP Version:  4CVS-2003-03-11 (stable)
 New Comment:

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.

FYI: The bug was caused by wrong pointer reference passed to spprintf()
(patched by Ilia).


Previous Comments:


[2003-03-12 09:40:30] ottawasixtyseven at hotmail dot com

This is fixed in the latest 4.3 snapshot March 12 2003.

Thank you for the quick response.

Ottawa



[2003-03-12 07:38:15] ottawasixtyseven at hotmail dot com

My programmers said my description was note quite accurate. Here is the
programmers version of our problem:

I can't get our application running on the latest snapshot. I can run
phpinfo() but when I try to use
 $DB  = odbc_connect ( 'database', '', ''); and then try to create a
table I get errors:

include('common.php'); // this include has
$DB = odbc_connect ('dsn' ,'', '');
i do an echo of $DB in common.php and get Resource id #3
then in the main script.
echo THE VALUE OF THE DB IS : $DB;

$SQL = CREATE TABLE $TableName ($TableColumns);
if ( !odbc_exec ( $DB, $SQL ) )
{
  echo FAILURE OF '$SQL' !br\n;
  $Errors++;
}
else
{
  echo OK! br\n;
}

when i echo $DB again just before the odbc_exec I get:
FATAL: erealloc(): Unable to allocate 1331643757 bytes
I have tried installing the latest snapshot on three separate servers.

Two that were already running PHP 4.3 and one clean server.

this code works on all other versions of php except the latest
snapshot.

Ottawa



[2003-03-11 22:17:20] ottawasixtyseven at hotmail dot com

I can't get our application running on the latest snapshot. I can run
phpinfo() but when I try to use $DB  = odbc_connect ( 'database', '',
'' ); and then try to create a table I get errors:

echo THE VALUE OF THE DB IS : $DB;

$SQL = CREATE TABLE $TableName ($TableColumns);
if ( !odbc_exec ( $DB, $SQL ) )
{
  echo FAILURE OF '$SQL' !br\n;
  $Errors++;
}
else
{
  echo OK! br\n;
}

For the first echo statement above I get Resource id #3
When I try to create the table I get:
FATAL: erealloc(): Unable to allocate 1331643757 bytes

I have tried installing the latest snapshot on three separate servers.
Two that were already running PHP 4.3 and one clean server.

Ottawa





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



#22575 [Fbk-Opn]: Arguments passed to function changes!

2003-03-12 Thread public at hverdag dot dk
 ID:   22575
 User updated by:  public at hverdag dot dk
 Reported By:  public at hverdag dot dk
-Status:   Feedback
+Status:   Open
 Bug Type: Session related
 Operating System: Windows 2000
 PHP Version:  4.3.1
 New Comment:

That's a problem since it's a quite complex page divided into sections
where you have to enter and submit 3-4 times before you come to the
section where the error occurs.

And when I just take those function calls out and put in a seperate
page the problem never occurs!

I call the function several times like this:

$enterSQL .= field_to_sql('category', 'autovalue');

Then on the very first line within the function I echo the two values
out to the browser and suddenly the first argument has the value
'autovalue' instead of 'category'! 

Couldn't that seem like a memory problem since it doesn't remember the
values correctly? I don't understand how it can be session related -
espacially when the values passed to the function are static - not
variables!


Previous Comments:


[2003-03-09 17:49:32] [EMAIL PROTECTED]

Please provide a full script (short!) that clearly demonstrates the
problem and can be simply cut'n'pasted from this report.




[2003-03-09 16:28:52] public at hverdag dot dk

Enabling all error/warnings/notices only gives some undefined variables
and indexes, and it's the same notices whether the page executes
correct or not. So I cannot see any problem there.

Talking about a session problem, how would that be?



[2003-03-06 22:05:02] [EMAIL PROTECTED]

It's most likely caused by sessions.
Try adding 'error_reporting(E_ALL);' as first line
in the script and see what errors you get.




[2003-03-06 14:48:15] public at hverdag dot dk

I have one function (see it below) where I pass 2 arguments. But
sometimes (yes, only sometimes!) when inside the function myfield has
the same value as myvalue instead of it's own value. In other words, it
simply changes the values of the arguments!

I have a long script where I at one point have a line like this several
times to build up my SQL statement, calling this function:

  $enterSQL .= field_to_sql('category', 'autovalue');

But when I check the value of these two arguments inside the function
both arguments have the value 'autovalue'!

This happens inside my long script and it can happen usually two times
(meaning: after a page reload) but the third time (second reload) the
problem is gone and script executes as expected! And if I try to call
this function from another simple page the problem never occurs.

I'm using sessions but I cannot see how that should affect any of this
(meaning, page reload should not affect anything).

Here is the function (which is located in an included file in the above
mentioned script):

  function field_to_sql($myfield, $myvalue) {
echo br+. $myfield . +. $myvalue .+;
#this outputs wrong value for the myfield variable!
if ($myvalue == 'autovalue') {
$myvalue_var_name = 'value_' . $myfield;
global $$myvalue_var_name;
if (!isset($$myvalue_var_name)) {   echo 'Warning, 
variable is not
set';
}
$myvalue = $$myvalue_var_name;
}
$myvalue = str_replace(', \', $myvalue);
if ($myvalue == '') {
return `$myfield` = null, ;
} else {
return `$myfield` = '$myvalue', ;
}
  }





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



#22661 [NEW]: mysql_list_tables selects database

2003-03-12 Thread lucifer at vengeance dot et dot tudelft dot nl
From: lucifer at vengeance dot et dot tudelft dot nl
Operating system: PHP: WinXP MySQL: Win2k
PHP version:  4.2.3
PHP Bug Type: MySQL related
Bug description:  mysql_list_tables selects database

the function mysql_list_tables changes the database subsequent queries
will run on; an example:

$link = mysql_connect( host, user, password );
mysql_select_db( db1, $link );

/* now db1 is selected */
print ** tables in selected database before mysql_list_tables **BR
$q = mysql_query( show tables );
while( $row = mysql_fetch_array( $q ) ) {
  print $row[0].BR;
}

$tables = mysql_list_tables( db2 );

/* now db2 is selected */
print ** tables in selected database after mysql_list_tables **BR
$q = mysql_query( show tables );
while( $row = mysql_fetch_array( $q ) ) {
  print $row[0].BR;
}

-- 
Edit bug report at http://bugs.php.net/?id=22661edit=1
-- 
Try a CVS snapshot: http://bugs.php.net/fix.php?id=22661r=trysnapshot
Fixed in CVS:   http://bugs.php.net/fix.php?id=22661r=fixedcvs
Fixed in release:   http://bugs.php.net/fix.php?id=22661r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=22661r=needtrace
Try newer version:  http://bugs.php.net/fix.php?id=22661r=oldversion
Not developer issue:http://bugs.php.net/fix.php?id=22661r=support
Expected behavior:  http://bugs.php.net/fix.php?id=22661r=notwrong
Not enough info:http://bugs.php.net/fix.php?id=22661r=notenoughinfo
Submitted twice:http://bugs.php.net/fix.php?id=22661r=submittedtwice
register_globals:   http://bugs.php.net/fix.php?id=22661r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=22661r=php3
Daylight Savings:   http://bugs.php.net/fix.php?id=22661r=dst
IIS Stability:  http://bugs.php.net/fix.php?id=22661r=isapi
Install GNU Sed:http://bugs.php.net/fix.php?id=22661r=gnused



#22661 [Opn]: mysql_list_tables selects database

2003-03-12 Thread lucifer at vengeance dot et dot tudelft dot nl
 ID:   22661
 User updated by:  lucifer at vengeance dot et dot tudelft dot nl
 Reported By:  lucifer at vengeance dot et dot tudelft dot nl
 Status:   Open
 Bug Type: MySQL related
 Operating System: PHP: WinXP MySQL: Win2k
 PHP Version:  4.2.3
 New Comment:

sorry for the parsing errors in the example; i saw them too late :)


Previous Comments:


[2003-03-12 10:45:33] lucifer at vengeance dot et dot tudelft dot nl

the function mysql_list_tables changes the database subsequent
queries will run on; an example:

$link = mysql_connect( host, user, password );
mysql_select_db( db1, $link );

/* now db1 is selected */
print ** tables in selected database before mysql_list_tables **BR
$q = mysql_query( show tables );
while( $row = mysql_fetch_array( $q ) ) {
  print $row[0].BR;
}

$tables = mysql_list_tables( db2 );

/* now db2 is selected */
print ** tables in selected database after mysql_list_tables **BR
$q = mysql_query( show tables );
while( $row = mysql_fetch_array( $q ) ) {
  print $row[0].BR;
}





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



#22662 [NEW]: shell_exec not working on windows XP

2003-03-12 Thread pjaleysen at hotmail dot com
From: pjaleysen at hotmail dot com
Operating system: Windows XP
PHP version:  4.2.3
PHP Bug Type: Output Control
Bug description:  shell_exec not working on windows XP

Hi,
shell_exec(),as well as exec(),system(), can only handle 'native' DOS
applications like ping,copy,attrib etc.
either directly as a command, or though a *.bat file.

Executing other (DOS) applications like pkzip (for DOS) or (rar for dos)
don't seem to work.
There is a thread of this issue at www.devshed.com
(http://forums.devshed.com/t55038/s.html)

I am using:
-Windows XP
-Apache 1.3.27
-PHP4.3

All with the default configurations.

Kind regards
Patrick
-- 
Edit bug report at http://bugs.php.net/?id=22662edit=1
-- 
Try a CVS snapshot: http://bugs.php.net/fix.php?id=22662r=trysnapshot
Fixed in CVS:   http://bugs.php.net/fix.php?id=22662r=fixedcvs
Fixed in release:   http://bugs.php.net/fix.php?id=22662r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=22662r=needtrace
Try newer version:  http://bugs.php.net/fix.php?id=22662r=oldversion
Not developer issue:http://bugs.php.net/fix.php?id=22662r=support
Expected behavior:  http://bugs.php.net/fix.php?id=22662r=notwrong
Not enough info:http://bugs.php.net/fix.php?id=22662r=notenoughinfo
Submitted twice:http://bugs.php.net/fix.php?id=22662r=submittedtwice
register_globals:   http://bugs.php.net/fix.php?id=22662r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=22662r=php3
Daylight Savings:   http://bugs.php.net/fix.php?id=22662r=dst
IIS Stability:  http://bugs.php.net/fix.php?id=22662r=isapi
Install GNU Sed:http://bugs.php.net/fix.php?id=22662r=gnused



#22662 [Opn]: shell_exec not working on windows XP

2003-03-12 Thread andrew
 ID:   22662
 Updated by:   [EMAIL PROTECTED]
 Reported By:  pjaleysen at hotmail dot com
 Status:   Open
 Bug Type: Output Control
 Operating System: Windows XP
 PHP Version:  4.2.3
 New Comment:

How are you passing your params to shell_exec() ?

I know from personal experience, that shell_exec() requires me to load
command.com to the interpreter, such as:

print shell_exec('cmd version');

This *should* print out your windows version...

~ Andrew Heebner


Previous Comments:


[2003-03-12 11:33:24] pjaleysen at hotmail dot com

Hi,
shell_exec(),as well as exec(),system(), can only handle 'native' DOS
applications like ping,copy,attrib etc.
either directly as a command, or though a *.bat file.

Executing other (DOS) applications like pkzip (for DOS) or (rar for
dos) don't seem to work.
There is a thread of this issue at www.devshed.com
(http://forums.devshed.com/t55038/s.html)

I am using:
-Windows XP
-Apache 1.3.27
-PHP4.3

All with the default configurations.

Kind regards
Patrick




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



#22662 [Opn]: shell_exec not working on windows XP

2003-03-12 Thread andrew
 ID:   22662
 Updated by:   [EMAIL PROTECTED]
 Reported By:  pjaleysen at hotmail dot com
 Status:   Open
 Bug Type: Output Control
 Operating System: Windows XP
 PHP Version:  4.2.3
 New Comment:

Sorry, that should be shell_exec('cmd ver');

~ Andrew Heebner


Previous Comments:


[2003-03-12 11:45:52] [EMAIL PROTECTED]

How are you passing your params to shell_exec() ?

I know from personal experience, that shell_exec() requires me to load
command.com to the interpreter, such as:

print shell_exec('cmd version');

This *should* print out your windows version...

~ Andrew Heebner



[2003-03-12 11:33:24] pjaleysen at hotmail dot com

Hi,
shell_exec(),as well as exec(),system(), can only handle 'native' DOS
applications like ping,copy,attrib etc.
either directly as a command, or though a *.bat file.

Executing other (DOS) applications like pkzip (for DOS) or (rar for
dos) don't seem to work.
There is a thread of this issue at www.devshed.com
(http://forums.devshed.com/t55038/s.html)

I am using:
-Windows XP
-Apache 1.3.27
-PHP4.3

All with the default configurations.

Kind regards
Patrick




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



#22660 [Opn-Fbk]: $_GLOBALS variable

2003-03-12 Thread andrew
 ID:   22660
 Updated by:   [EMAIL PROTECTED]
 Reported By:  pierre dot thierry at moine-fou dot org
-Status:   Open
+Status:   Feedback
 Bug Type: Feature/Change Request
 Operating System: Debian 3.0r1 GNU/Linux 2.4.19
 PHP Version:  4.3.1
 New Comment:

I move to opt against this, as BC would be broken with scripts using
$_GLOBALS against an older version of php.  It'd be good for
consistency, but sometimes we have to substitute consistency for
compatibility.

$GLOBALS is also kind of a variable of it's own.  It contains all
globals, as opposed to the individual superglobals containing their
sets.  $GLOBALS serves it's purpose just fine.

~ Andrew Heebner


Previous Comments:


[2003-03-12 10:15:53] pierre dot thierry at moine-fou dot org

For consistency with other autoglobals, $GLOBALS shoudl also be
accessible by $_GLOBALS. (or become $_GLOBALS, but this would break
many scripts...)




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



#22662 [Opn]: shell_exec not working on windows XP

2003-03-12 Thread pjaleysen at hotmail dot com
 ID:   22662
 User updated by:  pjaleysen at hotmail dot com
 Reported By:  pjaleysen at hotmail dot com
 Status:   Open
 Bug Type: Output Control
 Operating System: Windows XP
 PHP Version:  4.2.3
 New Comment:

like I said, the native  Windows commands work correctly. I tried
putting cmd before a command, but invain.

This is a brief summary of the forum thread, found at
http://forums.devshed.com/t55038/s.html):

//---
I am trying to use pkzip to compress documents.
I am running a windows PC, so I am trying to execute a DOS command.

I have so far:
?php
$pkzip=C:/Progra~1/Apache~1/Apache/readwr~1/pkzip.exe;
$pkzipdirectory=C:/Progra~1/Apache~1/Apache/readwr~1/;
$command=$pkzip. .$pkzipdirectory.myzip.zip.
.$pkzipdirectory.mydoc.doc;


shell_exec($command);
?
It doesnt work
//-
shouldn't have to as long as cmd.exe is in your path.
can't believe its not really.

maybe try a little test like this and see what you get back,
then you'll know if its a path problem.

?php

$test = shell_exec(ping 192.168.0.1);
echo $test;

?
//--
The ping works ok!
I can do the standard commands alright.
I tried:
1)using absolute directories (like above)
2) changing path=, to include the pkzip file (A dos version of pkzip)
3) changing to the 'long' directory notation (e.g progra~1 = program
files)
//-
Executing commands in the shell from a PHP script only works 
when the program you are trying to execute resides in your 
system directory (windows 2000: c:\winnt\system32).
//-
I might have a clue!?!?
e.g. I have a batchfile saying:

echo this batchfile works

running this with:
?php
$test=shell_exec(run.bat );
echo $test;
?
echoos 'echo this batchfile works'

Shouldnt the 'echo' NOT be there in the echo $test? 
It's like it is just reading the line, instead of executing it...
//


Previous Comments:


[2003-03-12 11:47:40] [EMAIL PROTECTED]

Sorry, that should be shell_exec('cmd ver');

~ Andrew Heebner



[2003-03-12 11:45:52] [EMAIL PROTECTED]

How are you passing your params to shell_exec() ?

I know from personal experience, that shell_exec() requires me to load
command.com to the interpreter, such as:

print shell_exec('cmd version');

This *should* print out your windows version...

~ Andrew Heebner



[2003-03-12 11:33:24] pjaleysen at hotmail dot com

Hi,
shell_exec(),as well as exec(),system(), can only handle 'native' DOS
applications like ping,copy,attrib etc.
either directly as a command, or though a *.bat file.

Executing other (DOS) applications like pkzip (for DOS) or (rar for
dos) don't seem to work.
There is a thread of this issue at www.devshed.com
(http://forums.devshed.com/t55038/s.html)

I am using:
-Windows XP
-Apache 1.3.27
-PHP4.3

All with the default configurations.

Kind regards
Patrick




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



#22635 [Com]: 1.1.1970 24 hours in [gm]mktime

2003-03-12 Thread michael dot mauch at gmx dot de
 ID:   22635
 Comment by:   michael dot mauch at gmx dot de
 Reported By:  jsteen at timecom dot com
 Status:   Open
 Bug Type: Date/time related
 Operating System: win32
 PHP Version:  4.3.1
 New Comment:

Please read the fine manual. From
http://www.php.net/manual/en/function.mktime.php:

on systems where time_t is a 32bit signed integer, as most common
today, the valid range for year is somewhere between 1902 and 2037.

If you are using values outside this range, you get undefined
behaviour.


Previous Comments:


[2003-03-12 03:34:12] jsteen at timecom dot com

WE F...ING KNOW mktime, gmmktime etc. WORK FINE ON *NIX!
THIS IS A WIN REPORT!

[flame: on]
is it a new policy on bugs.php.net to NOT read post
headers/declarations, write works fine with linux as answer, and put
the bug on 'BOGUS'?

i'm among the many users that are pissed that all the
timestamp-functions are buggy on win. ok. fine. deal. but then please
take our reports seriously and put a proper comment in the man! i
really begin to wonder whether you're not just too lazy to seriously
deal with it if i get this sorts of answers.
[flame: off]

so why does 1.1.1970 not have 24h?

please omit any of the usual answers, like:
- works fine for linux
- blame MS



[2003-03-11 11:15:13] [EMAIL PROTECTED]

Works fine with Linux.




[2003-03-11 07:53:26] jsteen at timecom dot com

1.1.1970 does not have 24 hours!

-
for ($i = 1 ; $i 365; $i++){
$date = mktime(0,0,0,1,$i,1970);
$date1 = mktime(0,0,0,1,$i+1,1970);

echo br $i:  .gmdate(Y m d, $date) .  ;
echo ($date1 - $date ) /3600 . h;
}
-
1: 23.000278 h
2: 1970 01 01 24 h
3: 1970 01 02 24 h
4: 1970 01 03 24 h
...


-
for ($i = 1 ; $i 365; $i++){
$date = gmmktime(0,0,0,1,$i,1970);
$date1 = gmmktime(0,0,0,1,$i+1,1970);
echo br $i:  .gmdate(Y m d, $date) .  ;
echo ($date1 - $date ) /3600 . h;
}
-
1: 24.000278 h
2: 1970 01 02 24 h
3: 1970 01 03 24 h
4: 1970 01 04 24 h
...

-










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



#22663 [NEW]: Variable $ID contains 3 initially

2003-03-12 Thread public at hverdag dot dk
From: public at hverdag dot dk
Operating system: Windows 2000
PHP version:  4.3.1
PHP Bug Type: Variables related
Bug description:  Variable $ID contains 3 initially

Why on earth does the variable $ID contain the value 3 on a totally blank
page where neither other script has been processed or session started???!

This is not so big a problem in itself, but if I use $ID as a session
variable it even overwrites this value - now, THIS is a problem!

I cannot find any place where it says that one shouldn't use this variable
name.
-- 
Edit bug report at http://bugs.php.net/?id=22663edit=1
-- 
Try a CVS snapshot: http://bugs.php.net/fix.php?id=22663r=trysnapshot
Fixed in CVS:   http://bugs.php.net/fix.php?id=22663r=fixedcvs
Fixed in release:   http://bugs.php.net/fix.php?id=22663r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=22663r=needtrace
Try newer version:  http://bugs.php.net/fix.php?id=22663r=oldversion
Not developer issue:http://bugs.php.net/fix.php?id=22663r=support
Expected behavior:  http://bugs.php.net/fix.php?id=22663r=notwrong
Not enough info:http://bugs.php.net/fix.php?id=22663r=notenoughinfo
Submitted twice:http://bugs.php.net/fix.php?id=22663r=submittedtwice
register_globals:   http://bugs.php.net/fix.php?id=22663r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=22663r=php3
Daylight Savings:   http://bugs.php.net/fix.php?id=22663r=dst
IIS Stability:  http://bugs.php.net/fix.php?id=22663r=isapi
Install GNU Sed:http://bugs.php.net/fix.php?id=22663r=gnused



#22663 [Opn]: Variable $ID contains 3 initially

2003-03-12 Thread public at hverdag dot dk
 ID:   22663
 User updated by:  public at hverdag dot dk
 Reported By:  public at hverdag dot dk
 Status:   Open
 Bug Type: Variables related
 Operating System: Windows 2000
 PHP Version:  4.3.1
 New Comment:

CORRECTION: I was NOT using $ID as a session variable though. But if I
do it gives strange and totally off error messages about different
places in my script where the script is perfectly correct.


Previous Comments:


[2003-03-12 13:09:01] public at hverdag dot dk

Why on earth does the variable $ID contain the value 3 on a totally
blank page where neither other script has been processed or session
started???!

This is not so big a problem in itself, but if I use $ID as a session
variable it even overwrites this value - now, THIS is a problem!

I cannot find any place where it says that one shouldn't use this
variable name.




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



#22665 [NEW]: UDM_PARAM_PAGE_SIZE can not be retrieved.

2003-03-12 Thread jon at jellybob dot co dot uk
From: jon at jellybob dot co dot uk
Operating system: FreeBSD 4.6
PHP version:  4.3.0
PHP Bug Type: mnoGoSearch related
Bug description:  UDM_PARAM_PAGE_SIZE can not be retrieved.

When I attempt to retrieve the parameter UDM_PARAM_PAGE_SIZE from a search
result, it gives the error Unknown mnoGoSearch param name.

The search is returning valid results.
-- 
Edit bug report at http://bugs.php.net/?id=22665edit=1
-- 
Try a CVS snapshot: http://bugs.php.net/fix.php?id=22665r=trysnapshot
Fixed in CVS:   http://bugs.php.net/fix.php?id=22665r=fixedcvs
Fixed in release:   http://bugs.php.net/fix.php?id=22665r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=22665r=needtrace
Try newer version:  http://bugs.php.net/fix.php?id=22665r=oldversion
Not developer issue:http://bugs.php.net/fix.php?id=22665r=support
Expected behavior:  http://bugs.php.net/fix.php?id=22665r=notwrong
Not enough info:http://bugs.php.net/fix.php?id=22665r=notenoughinfo
Submitted twice:http://bugs.php.net/fix.php?id=22665r=submittedtwice
register_globals:   http://bugs.php.net/fix.php?id=22665r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=22665r=php3
Daylight Savings:   http://bugs.php.net/fix.php?id=22665r=dst
IIS Stability:  http://bugs.php.net/fix.php?id=22665r=isapi
Install GNU Sed:http://bugs.php.net/fix.php?id=22665r=gnused



#22635 [Opn-Bgs]: 1.1.1970 24 hours in [gm]mktime

2003-03-12 Thread andrew
 ID:   22635
 Updated by:   [EMAIL PROTECTED]
 Reported By:  jsteen at timecom dot com
-Status:   Open
+Status:   Bogus
 Bug Type: Date/time related
 Operating System: win32
 PHP Version:  4.3.1
 New Comment:

jsteen at timecom dot com:

If you're pissed that the time functions are so 'buggy' on Win32, then
why don't you step into the ring and help us debug it?  Become part of
the community, but don't drive the community away because you didn't
get an answer you wanted.

Please reopen this bug as you feel necessary, but i'm marking it as a
bogus report due to the fact that it's an imcompatibility between Win32
and *nix systems, and also the fact that we can

I'd finally like to redirect you to
http://www.php.net/manual/en/function.mktime.php so you can read the
user comments.  Apparently different windows systems handle the
timestamp differently.  As said earlier, it's an incompatibility.

~ Andrew Heebner
~ Andrew Heebner


Previous Comments:


[2003-03-12 12:32:28] michael dot mauch at gmx dot de

Please read the fine manual. From
http://www.php.net/manual/en/function.mktime.php:

on systems where time_t is a 32bit signed integer, as most common
today, the valid range for year is somewhere between 1902 and 2037.

If you are using values outside this range, you get undefined
behaviour.



[2003-03-12 03:34:12] jsteen at timecom dot com

WE F...ING KNOW mktime, gmmktime etc. WORK FINE ON *NIX!
THIS IS A WIN REPORT!

[flame: on]
is it a new policy on bugs.php.net to NOT read post
headers/declarations, write works fine with linux as answer, and put
the bug on 'BOGUS'?

i'm among the many users that are pissed that all the
timestamp-functions are buggy on win. ok. fine. deal. but then please
take our reports seriously and put a proper comment in the man! i
really begin to wonder whether you're not just too lazy to seriously
deal with it if i get this sorts of answers.
[flame: off]

so why does 1.1.1970 not have 24h?

please omit any of the usual answers, like:
- works fine for linux
- blame MS



[2003-03-11 11:15:13] [EMAIL PROTECTED]

Works fine with Linux.




[2003-03-11 07:53:26] jsteen at timecom dot com

1.1.1970 does not have 24 hours!

-
for ($i = 1 ; $i 365; $i++){
$date = mktime(0,0,0,1,$i,1970);
$date1 = mktime(0,0,0,1,$i+1,1970);

echo br $i:  .gmdate(Y m d, $date) .  ;
echo ($date1 - $date ) /3600 . h;
}
-
1: 23.000278 h
2: 1970 01 01 24 h
3: 1970 01 02 24 h
4: 1970 01 03 24 h
...


-
for ($i = 1 ; $i 365; $i++){
$date = gmmktime(0,0,0,1,$i,1970);
$date1 = gmmktime(0,0,0,1,$i+1,1970);
echo br $i:  .gmdate(Y m d, $date) .  ;
echo ($date1 - $date ) /3600 . h;
}
-
1: 24.000278 h
2: 1970 01 02 24 h
3: 1970 01 03 24 h
4: 1970 01 04 24 h
...

-










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



#22666 [NEW]: POST only passing a limited number of form variables

2003-03-12 Thread lbravo at nc dot rr dot com
From: lbravo at nc dot rr dot com
Operating system: WIndows 2000
PHP version:  4.3.0
PHP Bug Type: *General Issues
Bug description:  POST only passing a limited number of form variables

I encountered a problem when passing about 20+ variables in the context of
form variables.  The same problem occurs if using arrays in the context of
form variables.  Only a certain number are passed, generally those that
appear first before the submit are passed, the exact number seems to vary
some what.  I have created simple php scripts and tested with the same
results.  I am not sure if the actual naming makes a difference or not,
the results seem to vary depending on how you try to set up the test. I am
very puzzled, with this behavior.
-- 
Edit bug report at http://bugs.php.net/?id=22666edit=1
-- 
Try a CVS snapshot: http://bugs.php.net/fix.php?id=22666r=trysnapshot
Fixed in CVS:   http://bugs.php.net/fix.php?id=22666r=fixedcvs
Fixed in release:   http://bugs.php.net/fix.php?id=22666r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=22666r=needtrace
Try newer version:  http://bugs.php.net/fix.php?id=22666r=oldversion
Not developer issue:http://bugs.php.net/fix.php?id=22666r=support
Expected behavior:  http://bugs.php.net/fix.php?id=22666r=notwrong
Not enough info:http://bugs.php.net/fix.php?id=22666r=notenoughinfo
Submitted twice:http://bugs.php.net/fix.php?id=22666r=submittedtwice
register_globals:   http://bugs.php.net/fix.php?id=22666r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=22666r=php3
Daylight Savings:   http://bugs.php.net/fix.php?id=22666r=dst
IIS Stability:  http://bugs.php.net/fix.php?id=22666r=isapi
Install GNU Sed:http://bugs.php.net/fix.php?id=22666r=gnused



#22657 [Opn-Bgs]: Weak parsing in rfc1867.c

2003-03-12 Thread sesser
 ID:   22657
 Updated by:   [EMAIL PROTECTED]
 Reported By:  vesely at tana dot it
-Status:   Open
+Status:   Bogus
 Bug Type: HTTP related
 Operating System: Any
 PHP Version:  4.3.0
 New Comment:

buf_begin can be NULL, no DOS possible - BOGUS1

searching for ',' is correct this works around a bug
in some IE version - BOGUS2


Previous Comments:


[2003-03-12 03:44:37] vesely at tana dot it

Hi,
watch out rfc1867.c around line 342, in function
next_line() there is (was?) the following code:

if (ptr) {
/* ... */   
} else {
/* ... */

line[self-bufsize] = 0;
self-buf_begin = ptr;/* === */
self-bytes_in_buffer = 0;
}

ptr is obviously NULL, buf_begin should never be NULL
or the program may crash. So this is a potential
vulnerability for DOS attackers who submit long lines.

Since you're there, would you mind to check why at line
721, in the rfc1867_post_handler function, there is

boundary_end = strchr(boundary, ',');

Shouldn't it be ';' (semicolon) rather than ',' (comma)?
(Just wandering)




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



#22529 [Com]: snmpset is not working

2003-03-12 Thread jamuel at my740il dot com
 ID:   22529
 Comment by:   jamuel at my740il dot com
 Reported By:  mb at solstaden dot net
 Status:   Open
 Bug Type: SNMP related
 Operating System: FreeBSD 4.8 Prerelease
 PHP Version:  4CVS-2003-03-04 (stable)
 New Comment:

I am getting the same error message with the latest (today's) 4.3 snap
shot.  From a php script I can either specify the entire OID
numerically or the entire symbolic OID--I just can't use the shortened
symbolic OID:

snmpset(10.1.1.1, private, .1.3.6.1.2.1.1.5.0, s, MyBox) --
works OK

snmpset(10.1.1.1, private,
.iso.org.dod.internet.mgmt.mib-2.system.sysName.0, s, MyBox) --
works OK

snmpset(10.1.1.1, private, system.sysName.0, s, MyBox) --
BROKEN

snmpset(10.1.1.1, private, sysName.0, s, MyBox) -- BROKEN

Linux 2.4
NetSNMP 5.0.8-pre1
PHP 4.3.2-dev [from phpinfo()]

Any help would be appreciated.

Regards,

JPS


Previous Comments:


[2003-03-05 00:21:50] mb at solstaden dot net

I did upgrade!

Sorry to say, same error.
I tried with system.sysContact.0 and sysCobtact.0

Warning: snmpset() [function.snmpset]: Invalid object identifier:
system.sysContact.0 in /usr/local/www/data/snmp.php on line 27

Warning: snmpset() [function.snmpset]: Error in packet: (noSuchName)
There is no such variable name in this MIB. in
/usr/local/www/data/snmp.php on line 27

Warning: snmpset() [function.snmpset]: This name does not exist:
SNMPv2-SMI::mib-2 in /usr/local/www/data/snmp.php on line 27

Magnus



[2003-03-04 19:23:43] [EMAIL PROTECTED]

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



[2003-03-04 04:12:55] mb at solstaden dot net

Hi!

I found out that, instead of typing in the OID as a string,

system.sysContact.0, u type it as numeric, .1.3.6.1.2.1.1.4.0

then it snmpset works.

Does not help me much but maybe some smarter person.

/Magnus



[2003-03-04 00:22:34] mb at solstaden dot net

I tried a verey simple php script:

echo snmpget( 81.26.237.10, public, system.sysContact.0 );

snmpset( 81.26.237.10, private, system.sysContact.0, s, kalle
);

snmpget works:

snmpset fails:

ouput as follows:

STRING: [EMAIL PROTECTED]
Warning: snmpset() [function.snmpset]: Invalid object identifier:
system.sysContact.0 in /usr/local/www/data/snmp.php on line 17

Warning: snmpset() [function.snmpset]: Error in packet: (noSuchName)
There is no such variable name in this MIB. in
/usr/local/www/data/snmp.php on line 17

Warning: snmpset() [function.snmpset]: This name does not exist:
SNMPv2-SMI::mib-2 in /usr/local/www/data/snmp.php on line 17

I did a tcpdump:

07:04:22.160998 gk.s.port80.se.1556 
as1-1-1--11.eklandahage4.molndal.bostream.net.snmp:  GetRequest(28) 
system.sysDescr.0
07:04:22.179314 as1-1-1--11.eklandahage4.molndal.bostream.net.snmp 
gk.s.port80.se.1556:  GetResponse(39)  system.sysDescr.0=Ericsson DR
07:04:22.180077 gk.s.port80.se.1557 
as1-1-1--11.eklandahage4.molndal.bostream.net.snmp:  GetRequest(28) 
system.sysContact.0
07:04:22.194298 as1-1-1--11.eklandahage4.molndal.bostream.net.snmp 
gk.s.port80.se.1557:  GetResponse(39) 
system.sysContact.0=[EMAIL PROTECTED]
07:04:22.194991 gk.s.port80.se.1558 
as1-1-1--11.eklandahage4.molndal.bostream.net.snmp:  C=private
SetRequest(30)  =kalle
07:04:22.209407 as1-1-1--11.eklandahage4.molndal.bostream.net.snmp 
gk.s.port80.se.1558:  C=private GetResponse(30)  [EMAIL PROTECTED] =kalle

Am I doing anything wrong? Normally it is my fault.
If u think I have found a bug, I will do my best to
help u.

Magnus Benngard










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



#22642 [Csd-Bgs]: After saving a session var in a var, nulling the session var clears the 2nd var

2003-03-12 Thread sniper
 ID:   22642
 Updated by:   [EMAIL PROTECTED]
 Reported By:  dave at orangechicken dot com
-Status:   Closed
+Status:   Bogus
 Bug Type: Session related
 Operating System: Linux / Apache 1.3.27
 PHP Version:  4.3.1
 New Comment:

Not PHP bug.



Previous Comments:


[2003-03-12 03:27:08] dave at orangechicken dot com

I'm uber-tarded. I found the solution an hour later or so (and it's the
same one suggested above). I used an .htaccess file to turn
register_globals off. I had been working in my dev environment so long
(with register_globals off in php.ini) that I didn't even think about
that when I moved to the live environment (which defaults to on).

My bad. Case closed.



[2003-03-11 21:07:22] [EMAIL PROTECTED]

Please provide a short but complete example script.

And is register_globals=off ?
And what about session.bug_compat_42 and session.bug_compat_warn?

Put 'error_reporting(E_ALL);' as first line in your script,
you propably get some errors..





[2003-03-11 15:54:35] dave at orangechicken dot com

OK, the summary was too short to concisely enter what I mean. Here's
the real version:

After assigning a stored $_SESSION var to another variable, assigning
null to the $_SESSION var clears the other variable too.

This worked before 4.3.1 (possibly occurred in 4.3.0 - we skipped from
4.2.7 to 4.3.1).

Here's a snippet where the problem occurs. $_SESSION[ 'login_redirect'
] contains the value 'checkout.php'.


$redirect = $_SESSION[ 'login_redirect' ];
echo $redirect; // outputs checkout.php
$_SESSION[ 'login_redirect' ] = null;
echo $redirect; // outputs nothing


Here's the configure string
'./configure' '--with-apxs=/usr/local/apache/bin/apxs' '--with-xml'
'--enable-bcmath' '--enable-calendar' '--with-curl' '--enable-ftp'
'--with-gd' '--with-jpeg-dir=/usr/local' '--with-png-dir=/usr'
'--with-xpm-dir=/usr/X11R6' '--with-imap' '--with-imap-ssl'
'--with-kerberos' '--with-mcrypt' '--enable-magic-quotes'
'--with-mysql' '--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'








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



#19263 [Com]: huge POST data corrupt

2003-03-12 Thread nvainio+phpnet at iki dot fi
 ID:   19263
 Comment by:   nvainio+phpnet at iki dot fi
 Reported By:  erwin at isiz dot com
 Status:   Bogus
 Bug Type: Apache2 related
 Operating System: Solaris 8
 PHP Version:  4CVS-2002-09-06
 New Comment:

For me, the solution was to leave SetOutputFilter and SetInputFilter
as-is and comment out AddType application/x-httpd-php .php instead.
Can't say why but it works for me (Apache 2.0.44 and PHP 4.3.1).


Previous Comments:


[2003-01-08 14:21:36] colreid at zasx dot com

People are asking me what I did, so here it is:
My Apache2 package has a directory which it uses for included files
with httpd.conf (the path to this directory in my installation is
/etc/httpd/conf.d).
In there is a file called php.conf, and basically I just commented out
the whole thing except for one line:

LoadModule php4_module modules/libphp4.so

This section here:
#Files *.php
#SetOutputFilter PHP
#SetInputFilter PHP
#LimitRequestBody 524288
#/Files
liked to munge uploads.

Also, in the httpd.conf file I added the line:
AddType application/x-httpd-php .php .html .htm .inc

And that's it.  I restarted apache and uploads decided to be nice.  :)



[2002-10-17 17:50:39] colreid at zasx dot com

never mind, I found it, in an included file.  Fixed.  You guys rule!



[2002-10-17 16:31:42] colreid at zasx dot com

I'm running php 4.2.2 and apache 2.0.40 on RedHat 8.0, and I don't have
those SetInputFilter or SetOutputFilter commands in my httpd.conf, yet
I am experiencing the problem originally reported.  Small files work
OK, but larger ones get mangled.  I've been banging my head against the
wall trying to figure out how to fix this, and have noticed others out
there posting to the newsgroups with the same problem, but none of the
suggested solutions work for me.



[2002-09-10 01:49:05] erwin at isiz dot com

I've found the problem:

don't add SetOutputFilter PHP and SetInputFilter PHP to the Apache
config. Only use AddType application/x-httpd-php .php

Grtz Erwin



[2002-09-06 08:03:33] erwin at isiz dot com

Hi,

I've gave this the summary huge POST data, because I've found two
bugs, which are, in my opinion, related.

The first one: 
If I upload a file using the file upload example from the php website,
all I get are corrupted files. The resulting files are about two times
bigger then the input files. The amount of bytes on the output varies a
little bit. This does not happens with files of 10 Kb, but different
files which vary from 60-120 Kb got corrupted.

The second one:
If I post text in a textarea, nothing goes wrong. But if I post a lot
of text in a textarea, parts of the text is copied into the text
itself. For instance, I copied the source of http://www.php.net (normal
HTML source) in a textarea. Posted the data to info.php (this script
only has the phpinfo() function, so I can see all data). The sourcecode
of the php website is 376 lines long. The result is about 734 lines.
This is around twice as big (The site looks really weird ;-))

Again, I think these two are related. They only occured in conjunction
with Apache 2.0.40 (didn't test other Apache 2 releases). I'm sure that
the bug is a PHP bug, because Perl code doesn't have this problem (but
I rather use PHP)
I did test it with php-4.2.2, which gave me the same results.

PHP Configure line:
'./configure' '--with-mysql=/usr/local/mysql' '--enable-track-vars'
'--with-openssl=/usr/local/ssl/' '--with-zlib' '--enable-ftp'
'--with-gd' '--enable-gd-native-ttf' '--with-pdflib'
'--with-jpeg-dir=/usr/local' '--with-png-dir=/usr/local'
'--with-freetype-dir=/usr/local' '--prefix=/usr/local/httpd/php'
'--with-zlib-dir=/usr' '--with-apxs2=/usr/local/httpd/bin/apxs'

Greets,
Erwin




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



#22579 [Opn]: fopen() number in URL = Bad file descriptor

2003-03-12 Thread ottawasixtyseven at hotmail dot com
 ID:   22579
 User updated by:  ottawasixtyseven at hotmail dot com
 Reported By:  ottawasixtyseven at hotmail dot com
 Status:   Open
 Bug Type: Filesystem function related
 Operating System: ALL
 PHP Version:  4.3.0
 New Comment:

Fixed in latest snapshot. Thank you.

Ottawa


Previous Comments:


[2003-03-11 22:01:04] ottawasixtyseven at hotmail dot com

OK. Just wanted to let you know we're trying to test the latest
snapshot to see if it fixes the fopen problem. I guess we'll have to
weed out the odbc parts.



[2003-03-11 12:49:15] [EMAIL PROTECTED]

I can't get our application running on the latest snapshot. I can run
phpinfo() but when I try to $DB  = odbc_connect I get errors. More
specifically, when I first echo $DB I get Resource id #3 when echo
it
again I get
FATAL: erealloc(): Unable to allocate 1331643757 bytes

I have tried installing the latest snapshot on three separate servers.
Two that were already running PHP 4.3 and one clean server.

I'm not able to test if the latest snapshot has fixed the fopen() bug.
Any ideas why my odbc_connect is failing?



What does odbc have to do with fopen() problem?
Test with separate script which doesn't have odbc stuff in it..

And the odbc problem, open a new report about that one.




[2003-03-06 20:50:16] ottawasixtyseven at hotmail dot com

This bug has been reported a few times but keeps getting closed. It is
still a problem in PHP 4.3.0 

Also see closed bug http://bugs.php.net/bug.php?id=9862

There is a serious problem with fopen when there are numbers in the
URL: http://www.xxx.com:8080/some.php?Origin=aDocNum=1

Result:

Warning: fopen() [function.fopen]: php_hostconnect: connect failed in
C:\phpfiles\some.php on line 150

Warning: fopen(http://www.xxx.com:8080/some.php?Origin=aDocNum=1)
[function.fopen]: failed to create stream: Bad file descriptor in
C:\phpfiles\some.php on line 150


Remove the port number in the URL and it works fine:
http://www.xxx.com/some.php?Origin=aDocNum=1

This seems to be a random bug that occurs on some machines and not
others. We can reproduce it 100% of the time if someone wants to check
on our server.

Please don't just test this on one machine and report back that it
works for you. There is something wrong here and we really need to get
to the bottom of it. It's not a redirection problem.

Thanks. Keep up the great work!

Ottawa




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



#22659 [Opn-Ver]: set_error_handler(foo) doesn't care if foo exists

2003-03-12 Thread sniper
 ID:   22659
 Updated by:   [EMAIL PROTECTED]
 Reported By:  steil at zweitwerk dot com
-Status:   Open
+Status:   Verified
-Bug Type: Unknown/Other Function
+Bug Type: Scripting Engine problem
 Operating System: Linux
-PHP Version:  4.2.3
+PHP Version:  4.3.2RC1
 New Comment:

It returns NULL for me. And this error message:
Warning - set_error_handler() expects argument 1, 'unknown_function',
to be a valid callback




Previous Comments:


[2003-03-12 10:13:47] steil at zweitwerk dot com

What I mean is the following

?php
// first call returns nothing
$ret1 = set_error_handler(unknown_function);
var_dump($ret1);

// second call returns unknown_function
$ret2 = set_error_handler(another_unknown_function);
var_dump($ret2);
?

The documentation says set_error_handler() would return FALSE if an
error occurs. Therefore, both of the above calls should return FALSE
since setting the error handler to an unknown function is certainly an
error.

As a consequence I am not able to check if the call to
set_error_handler() has been successful.




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



#22660 [Fbk-WFx]: $_GLOBALS variable

2003-03-12 Thread sniper
 ID:   22660
 Updated by:   [EMAIL PROTECTED]
 Reported By:  pierre dot thierry at moine-fou dot org
-Status:   Feedback
+Status:   Wont fix
 Bug Type: Feature/Change Request
 Operating System: Debian 3.0r1 GNU/Linux 2.4.19
 PHP Version:  4.3.1
 New Comment:

Will not happen.



Previous Comments:


[2003-03-12 11:53:20] [EMAIL PROTECTED]

I move to opt against this, as BC would be broken with scripts using
$_GLOBALS against an older version of php.  It'd be good for
consistency, but sometimes we have to substitute consistency for
compatibility.

$GLOBALS is also kind of a variable of it's own.  It contains all
globals, as opposed to the individual superglobals containing their
sets.  $GLOBALS serves it's purpose just fine.

~ Andrew Heebner



[2003-03-12 10:15:53] pierre dot thierry at moine-fou dot org

For consistency with other autoglobals, $GLOBALS shoudl also be
accessible by $_GLOBALS. (or become $_GLOBALS, but this would break
many scripts...)




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



#22662 [Opn-Fbk]: shell_exec not working on windows XP

2003-03-12 Thread sniper
 ID:   22662
 Updated by:   [EMAIL PROTECTED]
 Reported By:  pjaleysen at hotmail dot com
-Status:   Open
+Status:   Feedback
 Bug Type: Output Control
 Operating System: Windows XP
 PHP Version:  4.2.3
 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

4.2.3 is way too old.



Previous Comments:


[2003-03-12 11:58:58] pjaleysen at hotmail dot com

like I said, the native  Windows commands work correctly. I tried
putting cmd before a command, but invain.

This is a brief summary of the forum thread, found at
http://forums.devshed.com/t55038/s.html):

//---
I am trying to use pkzip to compress documents.
I am running a windows PC, so I am trying to execute a DOS command.

I have so far:
?php
$pkzip=C:/Progra~1/Apache~1/Apache/readwr~1/pkzip.exe;
$pkzipdirectory=C:/Progra~1/Apache~1/Apache/readwr~1/;
$command=$pkzip. .$pkzipdirectory.myzip.zip.
.$pkzipdirectory.mydoc.doc;


shell_exec($command);
?
It doesnt work
//-
shouldn't have to as long as cmd.exe is in your path.
can't believe its not really.

maybe try a little test like this and see what you get back,
then you'll know if its a path problem.

?php

$test = shell_exec(ping 192.168.0.1);
echo $test;

?
//--
The ping works ok!
I can do the standard commands alright.
I tried:
1)using absolute directories (like above)
2) changing path=, to include the pkzip file (A dos version of pkzip)
3) changing to the 'long' directory notation (e.g progra~1 = program
files)
//-
Executing commands in the shell from a PHP script only works 
when the program you are trying to execute resides in your 
system directory (windows 2000: c:\winnt\system32).
//-
I might have a clue!?!?
e.g. I have a batchfile saying:

echo this batchfile works

running this with:
?php
$test=shell_exec(run.bat );
echo $test;
?
echoos 'echo this batchfile works'

Shouldnt the 'echo' NOT be there in the echo $test? 
It's like it is just reading the line, instead of executing it...
//



[2003-03-12 11:47:40] [EMAIL PROTECTED]

Sorry, that should be shell_exec('cmd ver');

~ Andrew Heebner



[2003-03-12 11:45:52] [EMAIL PROTECTED]

How are you passing your params to shell_exec() ?

I know from personal experience, that shell_exec() requires me to load
command.com to the interpreter, such as:

print shell_exec('cmd version');

This *should* print out your windows version...

~ Andrew Heebner



[2003-03-12 11:33:24] pjaleysen at hotmail dot com

Hi,
shell_exec(),as well as exec(),system(), can only handle 'native' DOS
applications like ping,copy,attrib etc.
either directly as a command, or though a *.bat file.

Executing other (DOS) applications like pkzip (for DOS) or (rar for
dos) don't seem to work.
There is a thread of this issue at www.devshed.com
(http://forums.devshed.com/t55038/s.html)

I am using:
-Windows XP
-Apache 1.3.27
-PHP4.3

All with the default configurations.

Kind regards
Patrick




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



#22662 [Fbk-Opn]: shell_exec not working on windows XP

2003-03-12 Thread pjaleysen at hotmail dot com
 ID:   22662
 User updated by:  pjaleysen at hotmail dot com
 Reported By:  pjaleysen at hotmail dot com
-Status:   Feedback
+Status:   Open
 Bug Type: Program Execution
 Operating System: Windows XP
 PHP Version:  4.2.3
 New Comment:

I have the same problem with php4.3 (at home)


Previous Comments:


[2003-03-12 17:01:50] [EMAIL PROTECTED]

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

4.2.3 is way too old.




[2003-03-12 11:58:58] pjaleysen at hotmail dot com

like I said, the native  Windows commands work correctly. I tried
putting cmd before a command, but invain.

This is a brief summary of the forum thread, found at
http://forums.devshed.com/t55038/s.html):

//---
I am trying to use pkzip to compress documents.
I am running a windows PC, so I am trying to execute a DOS command.

I have so far:
?php
$pkzip=C:/Progra~1/Apache~1/Apache/readwr~1/pkzip.exe;
$pkzipdirectory=C:/Progra~1/Apache~1/Apache/readwr~1/;
$command=$pkzip. .$pkzipdirectory.myzip.zip.
.$pkzipdirectory.mydoc.doc;


shell_exec($command);
?
It doesnt work
//-
shouldn't have to as long as cmd.exe is in your path.
can't believe its not really.

maybe try a little test like this and see what you get back,
then you'll know if its a path problem.

?php

$test = shell_exec(ping 192.168.0.1);
echo $test;

?
//--
The ping works ok!
I can do the standard commands alright.
I tried:
1)using absolute directories (like above)
2) changing path=, to include the pkzip file (A dos version of pkzip)
3) changing to the 'long' directory notation (e.g progra~1 = program
files)
//-
Executing commands in the shell from a PHP script only works 
when the program you are trying to execute resides in your 
system directory (windows 2000: c:\winnt\system32).
//-
I might have a clue!?!?
e.g. I have a batchfile saying:

echo this batchfile works

running this with:
?php
$test=shell_exec(run.bat );
echo $test;
?
echoos 'echo this batchfile works'

Shouldnt the 'echo' NOT be there in the echo $test? 
It's like it is just reading the line, instead of executing it...
//



[2003-03-12 11:47:40] [EMAIL PROTECTED]

Sorry, that should be shell_exec('cmd ver');

~ Andrew Heebner



[2003-03-12 11:45:52] [EMAIL PROTECTED]

How are you passing your params to shell_exec() ?

I know from personal experience, that shell_exec() requires me to load
command.com to the interpreter, such as:

print shell_exec('cmd version');

This *should* print out your windows version...

~ Andrew Heebner



[2003-03-12 11:33:24] pjaleysen at hotmail dot com

Hi,
shell_exec(),as well as exec(),system(), can only handle 'native' DOS
applications like ping,copy,attrib etc.
either directly as a command, or though a *.bat file.

Executing other (DOS) applications like pkzip (for DOS) or (rar for
dos) don't seem to work.
There is a thread of this issue at www.devshed.com
(http://forums.devshed.com/t55038/s.html)

I am using:
-Windows XP
-Apache 1.3.27
-PHP4.3

All with the default configurations.

Kind regards
Patrick




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



#22663 [Opn-Bgs]: Variable $ID contains 3 initially

2003-03-12 Thread sniper
 ID:   22663
 Updated by:   [EMAIL PROTECTED]
 Reported By:  public at hverdag dot dk
-Status:   Open
+Status:   Bogus
 Bug Type: Variables related
 Operating System: Windows 2000
 PHP Version:  4.3.1
 New Comment:

Set register_globals=Off and this problem goes away.
(it's coming from cookie)



Previous Comments:


[2003-03-12 14:26:11] public at hverdag dot dk

CORRECTION: I was NOT using $ID as a session variable though. But if I
do it gives strange and totally off error messages about different
places in my script where the script is perfectly correct.



[2003-03-12 13:09:01] public at hverdag dot dk

Why on earth does the variable $ID contain the value 3 on a totally
blank page where neither other script has been processed or session
started???!

This is not so big a problem in itself, but if I use $ID as a session
variable it even overwrites this value - now, THIS is a problem!

I cannot find any place where it says that one shouldn't use this
variable name.




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



#22526 [Fbk-Opn]: session_start/popen hang

2003-03-12 Thread iberry at raxnet dot net
 ID:   22526
 User updated by:  iberry at raxnet dot net
 Reported By:  iberry at raxnet dot net
-Status:   Feedback
+Status:   Open
 Bug Type: Session related
 Operating System: Windows 2000
 PHP Version:  4.3.0
 New Comment:

I renamed test.php to test.html, and the same problem occurs.

-Ian


Previous Comments:


[2003-03-07 02:14:56] [EMAIL PROTECTED]

What if you name that test.php to test.html..?




[2003-03-06 21:42:28] iberry at raxnet dot net

I checked and 'session.use_trans_sid' was set to '0', so I changed it
to '1', but got the same results.

I took a look at the bug you referenced to, but it is not the same. For
one the file size is not really an issue. And secondly after adding
debug code, I can see that PHP is blocking on the popen() call, not
fpassthru().

-Ian



[2003-03-06 12:51:58] [EMAIL PROTECTED]

Are you sure this isn't same as what we've verified in bug #22154 ?

Do you have session.use_trans_sid = 1 in your php.ini?




[2003-03-06 00:30:24] iberry at raxnet dot net

I tried Apache 1.3.27 with PHP's php4apache.dll and got the same
negative results. The code I originally posted still causes the hang
with this configuration.

-Ian



[2003-03-05 13:49:23] [EMAIL PROTECTED]

Both of the SAPI's you've tried (IIS  Apache 2) are thread based, it
is possible that this problem is specific to multi-threaded
application, and that's why single-threaded SAPIs like CLI/CGI are not
affected by it.
Could you try and see if the problem can be replicated using Apache
1.X?



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

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



#22662 [Opn-Fbk]: shell_exec not working on windows XP

2003-03-12 Thread sniper
 ID:   22662
 Updated by:   [EMAIL PROTECTED]
 Reported By:  pjaleysen at hotmail dot com
-Status:   Open
+Status:   Feedback
 Bug Type: Program Execution
 Operating System: Windows XP
-PHP Version:  4.2.3
+PHP Version:  4.3.0
 New Comment:

Yes, but the snapshot is 4.3.2-dev so try it out.
We're about to release 4.3.2 soon.




Previous Comments:


[2003-03-12 17:04:09] pjaleysen at hotmail dot com

I have the same problem with php4.3 (at home)



[2003-03-12 17:01:50] [EMAIL PROTECTED]

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

4.2.3 is way too old.




[2003-03-12 11:58:58] pjaleysen at hotmail dot com

like I said, the native  Windows commands work correctly. I tried
putting cmd before a command, but invain.

This is a brief summary of the forum thread, found at
http://forums.devshed.com/t55038/s.html):

//---
I am trying to use pkzip to compress documents.
I am running a windows PC, so I am trying to execute a DOS command.

I have so far:
?php
$pkzip=C:/Progra~1/Apache~1/Apache/readwr~1/pkzip.exe;
$pkzipdirectory=C:/Progra~1/Apache~1/Apache/readwr~1/;
$command=$pkzip. .$pkzipdirectory.myzip.zip.
.$pkzipdirectory.mydoc.doc;


shell_exec($command);
?
It doesnt work
//-
shouldn't have to as long as cmd.exe is in your path.
can't believe its not really.

maybe try a little test like this and see what you get back,
then you'll know if its a path problem.

?php

$test = shell_exec(ping 192.168.0.1);
echo $test;

?
//--
The ping works ok!
I can do the standard commands alright.
I tried:
1)using absolute directories (like above)
2) changing path=, to include the pkzip file (A dos version of pkzip)
3) changing to the 'long' directory notation (e.g progra~1 = program
files)
//-
Executing commands in the shell from a PHP script only works 
when the program you are trying to execute resides in your 
system directory (windows 2000: c:\winnt\system32).
//-
I might have a clue!?!?
e.g. I have a batchfile saying:

echo this batchfile works

running this with:
?php
$test=shell_exec(run.bat );
echo $test;
?
echoos 'echo this batchfile works'

Shouldnt the 'echo' NOT be there in the echo $test? 
It's like it is just reading the line, instead of executing it...
//



[2003-03-12 11:47:40] [EMAIL PROTECTED]

Sorry, that should be shell_exec('cmd ver');

~ Andrew Heebner



[2003-03-12 11:45:52] [EMAIL PROTECTED]

How are you passing your params to shell_exec() ?

I know from personal experience, that shell_exec() requires me to load
command.com to the interpreter, such as:

print shell_exec('cmd version');

This *should* print out your windows version...

~ Andrew Heebner



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

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



#22579 [Opn-Csd]: fopen() number in URL = Bad file descriptor

2003-03-12 Thread pollita
 ID:   22579
 Updated by:   [EMAIL PROTECTED]
 Reported By:  ottawasixtyseven at hotmail dot com
-Status:   Open
+Status:   Closed
 Bug Type: Filesystem function related
 Operating System: ALL
 PHP Version:  4.3.0
 New Comment:

Fixed - Closed.


Previous Comments:


[2003-03-12 16:58:52] ottawasixtyseven at hotmail dot com

Fixed in latest snapshot. Thank you.

Ottawa



[2003-03-11 22:01:04] ottawasixtyseven at hotmail dot com

OK. Just wanted to let you know we're trying to test the latest
snapshot to see if it fixes the fopen problem. I guess we'll have to
weed out the odbc parts.



[2003-03-11 12:49:15] [EMAIL PROTECTED]

I can't get our application running on the latest snapshot. I can run
phpinfo() but when I try to $DB  = odbc_connect I get errors. More
specifically, when I first echo $DB I get Resource id #3 when echo
it
again I get
FATAL: erealloc(): Unable to allocate 1331643757 bytes

I have tried installing the latest snapshot on three separate servers.
Two that were already running PHP 4.3 and one clean server.

I'm not able to test if the latest snapshot has fixed the fopen() bug.
Any ideas why my odbc_connect is failing?



What does odbc have to do with fopen() problem?
Test with separate script which doesn't have odbc stuff in it..

And the odbc problem, open a new report about that one.




[2003-03-06 20:50:16] ottawasixtyseven at hotmail dot com

This bug has been reported a few times but keeps getting closed. It is
still a problem in PHP 4.3.0 

Also see closed bug http://bugs.php.net/bug.php?id=9862

There is a serious problem with fopen when there are numbers in the
URL: http://www.xxx.com:8080/some.php?Origin=aDocNum=1

Result:

Warning: fopen() [function.fopen]: php_hostconnect: connect failed in
C:\phpfiles\some.php on line 150

Warning: fopen(http://www.xxx.com:8080/some.php?Origin=aDocNum=1)
[function.fopen]: failed to create stream: Bad file descriptor in
C:\phpfiles\some.php on line 150


Remove the port number in the URL and it works fine:
http://www.xxx.com/some.php?Origin=aDocNum=1

This seems to be a random bug that occurs on some machines and not
others. We can reproduce it 100% of the time if someone wants to check
on our server.

Please don't just test this on one machine and report back that it
works for you. There is something wrong here and we really need to get
to the bottom of it. It's not a redirection problem.

Thanks. Keep up the great work!

Ottawa




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



#22665 [Opn-Fbk]: UDM_PARAM_PAGE_SIZE can not be retrieved.

2003-03-12 Thread sniper
 ID:   22665
 Updated by:   [EMAIL PROTECTED]
 Reported By:  jon at jellybob dot co dot uk
-Status:   Open
+Status:   Feedback
 Bug Type: mnoGoSearch related
 Operating System: FreeBSD 4.6
 PHP Version:  4.3.0
 New Comment:

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.



Previous Comments:


[2003-03-12 14:48:34] jon at jellybob dot co dot uk

When I attempt to retrieve the parameter UDM_PARAM_PAGE_SIZE from a
search result, it gives the error Unknown mnoGoSearch param name.

The search is returning valid results.




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



#22666 [Opn-Fbk]: POST only passing a limited number of form variables

2003-03-12 Thread sniper
 ID:   22666
 Updated by:   [EMAIL PROTECTED]
 Reported By:  lbravo at nc dot rr dot com
-Status:   Open
+Status:   Feedback
 Bug Type: *General Issues
 Operating System: WIndows 2000
 PHP Version:  4.3.0
 New Comment:

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.



Previous Comments:


[2003-03-12 15:55:18] lbravo at nc dot rr dot com

I encountered a problem when passing about 20+ variables in the context
of form variables.  The same problem occurs if using arrays in the
context of form variables.  Only a certain number are passed, generally
those that appear first before the submit are passed, the exact number
seems to vary some what.  I have created simple php scripts and tested
with the same results.  I am not sure if the actual naming makes a
difference or not, the results seem to vary depending on how you try to
set up the test. I am very puzzled, with this behavior.




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



#22655 [Opn-Fbk]: problems with unset

2003-03-12 Thread sniper
 ID:   22655
 Updated by:   [EMAIL PROTECTED]
 Reported By:  stanislav at shramko dot com
-Status:   Open
+Status:   Feedback
-Bug Type: Class/Object related
+Bug Type: Scripting Engine problem
 Operating System: WinXP
 PHP Version:  4.3.0
 New Comment:

And what did you expect the output to be?



Previous Comments:


[2003-03-12 02:15:55] stanislav at shramko dot com

I was very discouraged about the behavior of unset() function with
variables which are
contained in objects in the same time. Also I'm slightly mad about
references to NULL and so on.

?php

// two test classes

class a
{

var $a = null;

function a( $b )
{
$this-a = $b;
}

}

class b
{
var $b = 5;
}

// -- the main part 

// alas, I need to use destructors

$b = new b();
$a = new a( $b );
var_dump( $a ); // checking the object's state
$b-b = 3; // changing it
var_dump( $a ); // Note that value was changed...
unset( $b ); // what are we waiting for?
var_dump( $a ); // but the object's field wasn't affected
$b = null;
var_dump( $a ); // there's no way to destroy this blamed property

echo \n;
// but in case if we will try to assign a null value to this field
whilst 
// the object is in it's initial state, we're getting another results

$b = new b();
$a = new a( $b );
var_dump( $a );
$b-b = 3;
var_dump( $a ); // Note that value was changed...
$b = null;
var_dump( $a ); // I see, it's a great way to dispose a field of an
object :)
// this reference to NULL looks pretty well, isn't it? :)

?

I've lost the sence of the whole situation at this point.

Regards,
Stanislav.




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



#22575 [Opn-Bgs]: Arguments passed to function changes!

2003-03-12 Thread sniper
 ID:   22575
 Updated by:   [EMAIL PROTECTED]
 Reported By:  public at hverdag dot dk
-Status:   Open
+Status:   Bogus
 Bug Type: Session related
 Operating System: Windows 2000
 PHP Version:  4.3.1
 New Comment:

As long as you can't provide any proof, we have to assume
it's not PHP bug but something you're doing wrong. (I'm 99% sure about
this). Try setting register_globals=off for a change..



Previous Comments:


[2003-03-12 10:35:30] public at hverdag dot dk

That's a problem since it's a quite complex page divided into sections
where you have to enter and submit 3-4 times before you come to the
section where the error occurs.

And when I just take those function calls out and put in a seperate
page the problem never occurs!

I call the function several times like this:

$enterSQL .= field_to_sql('category', 'autovalue');

Then on the very first line within the function I echo the two values
out to the browser and suddenly the first argument has the value
'autovalue' instead of 'category'! 

Couldn't that seem like a memory problem since it doesn't remember the
values correctly? I don't understand how it can be session related -
espacially when the values passed to the function are static - not
variables!



[2003-03-09 17:49:32] [EMAIL PROTECTED]

Please provide a full script (short!) that clearly demonstrates the
problem and can be simply cut'n'pasted from this report.




[2003-03-09 16:28:52] public at hverdag dot dk

Enabling all error/warnings/notices only gives some undefined variables
and indexes, and it's the same notices whether the page executes
correct or not. So I cannot see any problem there.

Talking about a session problem, how would that be?



[2003-03-06 22:05:02] [EMAIL PROTECTED]

It's most likely caused by sessions.
Try adding 'error_reporting(E_ALL);' as first line
in the script and see what errors you get.




[2003-03-06 14:48:15] public at hverdag dot dk

I have one function (see it below) where I pass 2 arguments. But
sometimes (yes, only sometimes!) when inside the function myfield has
the same value as myvalue instead of it's own value. In other words, it
simply changes the values of the arguments!

I have a long script where I at one point have a line like this several
times to build up my SQL statement, calling this function:

  $enterSQL .= field_to_sql('category', 'autovalue');

But when I check the value of these two arguments inside the function
both arguments have the value 'autovalue'!

This happens inside my long script and it can happen usually two times
(meaning: after a page reload) but the third time (second reload) the
problem is gone and script executes as expected! And if I try to call
this function from another simple page the problem never occurs.

I'm using sessions but I cannot see how that should affect any of this
(meaning, page reload should not affect anything).

Here is the function (which is located in an included file in the above
mentioned script):

  function field_to_sql($myfield, $myvalue) {
echo br+. $myfield . +. $myvalue .+;
#this outputs wrong value for the myfield variable!
if ($myvalue == 'autovalue') {
$myvalue_var_name = 'value_' . $myfield;
global $$myvalue_var_name;
if (!isset($$myvalue_var_name)) {   echo 'Warning, 
variable is not
set';
}
$myvalue = $$myvalue_var_name;
}
$myvalue = str_replace(', \', $myvalue);
if ($myvalue == '') {
return `$myfield` = null, ;
} else {
return `$myfield` = '$myvalue', ;
}
  }





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



#22667 [NEW]: Sobre el manejo de sessiones

2003-03-12 Thread orgosolm at hotmail dot com
From: orgosolm at hotmail dot com
Operating system: Todos los Sistemas Operativos
PHP version:  4.2.3
PHP Bug Type: PHP options/info functions
Bug description:  Sobre el manejo de sessiones

Hola.

Supongo que esto no sea realmente un bug pero bueno esta fue una forma de
saber sobre alguna de las epscificaciones y cosas que soporta PHP.

Sabemos que en PHP no existe el Global.asa que existe en ASP, la idea es
que de que forma yo pudiera hacer una acccion cualquiera cuando el usuario
aborta su session o cuando la session del usuario expiro, por ejemplo

Quisiera insertar la fecha y la hora en la que el usuario termino la
session tanto como por el TimeOut o abortando por programacion la session.


En concreto lo que me gustaria saber si el PHP tiene algun modulo o
soporta de alguna forma algo donde yo especifique alguna tarea cuando se
vensa el tiempo de espera de la session o cuando esta finalice
normalmente.

-- 
Edit bug report at http://bugs.php.net/?id=22667edit=1
-- 
Try a CVS snapshot: http://bugs.php.net/fix.php?id=22667r=trysnapshot
Fixed in CVS:   http://bugs.php.net/fix.php?id=22667r=fixedcvs
Fixed in release:   http://bugs.php.net/fix.php?id=22667r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=22667r=needtrace
Try newer version:  http://bugs.php.net/fix.php?id=22667r=oldversion
Not developer issue:http://bugs.php.net/fix.php?id=22667r=support
Expected behavior:  http://bugs.php.net/fix.php?id=22667r=notwrong
Not enough info:http://bugs.php.net/fix.php?id=22667r=notenoughinfo
Submitted twice:http://bugs.php.net/fix.php?id=22667r=submittedtwice
register_globals:   http://bugs.php.net/fix.php?id=22667r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=22667r=php3
Daylight Savings:   http://bugs.php.net/fix.php?id=22667r=dst
IIS Stability:  http://bugs.php.net/fix.php?id=22667r=isapi
Install GNU Sed:http://bugs.php.net/fix.php?id=22667r=gnused



#22668 [NEW]: printer_write() doesn't work when you manipulate on text to be written

2003-03-12 Thread rauf at ug dot bcc dot bilkent dot edu dot tr
From: rauf at ug dot bcc dot bilkent dot edu dot tr
Operating system: Windows 2000
PHP version:  4.3.1
PHP Bug Type: Unknown/Other Function
Bug description:  printer_write() doesn't work when you manipulate on text to be 
written

This function (printer_write()) runs perfectly when i use the following:

  ob_start();
  /* put some data on the screen ?/
  echo(some text to be written\n);
  echo(some other text to be written\n);
  echo(another text to be written\n);

  $handle = printer_open(Panasonic KX-P1150);
  printer_set_option($handle, PRINTER_MODE, RAW);
  printer_set_option($handle, PRINTER_COPIES, 1);

  $string = ob_get_contents();
  /* I'm using the data on the screen buffer */

  printer_write($handle, $string);
  printer_close($handle);


I have the following error message when i use the following code:

Warning: couldn't allocate the printerjob [1804] in c:\apache\htdocs\...
on line 148

the code is:

  ob_start();
  /* put some data on the screen ?/
  echo(some text to be written\n);
  echo(some other text to be written\n);
  echo(another text to be written\n);

  $handle = printer_open(Panasonic KX-P1150);
  printer_set_option($handle, PRINTER_MODE, RAW);
  printer_set_option($handle, PRINTER_COPIES, 1);

  $string = ob_get_contents();
  /* I'm using the data on the screen buffer */

  replaceTurkish($string)
  /* this time i'm using this function that replaces
 the Turkish characters with the English ones.
 The function is given below */

  printer_write($handle, $string);
  printer_close($handle);


function replaceTurkish($text)
{
  $text = str_replace(Ð, G, $text);
  $text = str_replace(Ü, U, $text);
  $text = str_replace(Þ, S, $text);
  $text = str_replace(Ý, I, $text);
  $text = str_replace(Ö, O, $text);
  $text = str_replace(Ç, C, $text);
  $text = str_replace(ð, g, $text);
  $text = str_replace(ü, u, $text);
  $text = str_replace(þ, s, $text);
  $text = str_replace(ý, i, $text);
  $text = str_replace(ö, o, $text);
  $text = str_replace(ç, c, $text);
}

--
The same error occurs when I use:
  printer_write($handle, $string);
instead of
  printer_write($handle, $string);

---
I've seen some similar bug reports closed because of the PHP version is
too old. I used the latest stable version but the same problem occurs.
-- 
Edit bug report at http://bugs.php.net/?id=22668edit=1
-- 
Try a CVS snapshot: http://bugs.php.net/fix.php?id=22668r=trysnapshot
Fixed in CVS:   http://bugs.php.net/fix.php?id=22668r=fixedcvs
Fixed in release:   http://bugs.php.net/fix.php?id=22668r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=22668r=needtrace
Try newer version:  http://bugs.php.net/fix.php?id=22668r=oldversion
Not developer issue:http://bugs.php.net/fix.php?id=22668r=support
Expected behavior:  http://bugs.php.net/fix.php?id=22668r=notwrong
Not enough info:http://bugs.php.net/fix.php?id=22668r=notenoughinfo
Submitted twice:http://bugs.php.net/fix.php?id=22668r=submittedtwice
register_globals:   http://bugs.php.net/fix.php?id=22668r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=22668r=php3
Daylight Savings:   http://bugs.php.net/fix.php?id=22668r=dst
IIS Stability:  http://bugs.php.net/fix.php?id=22668r=isapi
Install GNU Sed:http://bugs.php.net/fix.php?id=22668r=gnused



#22668 [Opn]: printer_write() doesn't work when you manipulate on text to be written

2003-03-12 Thread rauf at ug dot bcc dot bilkent dot edu dot tr
 ID:   22668
 User updated by:  rauf at ug dot bcc dot bilkent dot edu dot tr
 Reported By:  rauf at ug dot bcc dot bilkent dot edu dot tr
 Status:   Open
 Bug Type: Unknown/Other Function
 Operating System: Windows 2000
 PHP Version:  4.3.1
 New Comment:

?/ should be */ in the previous post


Previous Comments:


[2003-03-12 18:20:15] rauf at ug dot bcc dot bilkent dot edu dot tr

This function (printer_write()) runs perfectly when i use the
following:

  ob_start();
  /* put some data on the screen ?/
  echo(some text to be written\n);
  echo(some other text to be written\n);
  echo(another text to be written\n);

  $handle = printer_open(Panasonic KX-P1150);
  printer_set_option($handle, PRINTER_MODE, RAW);
  printer_set_option($handle, PRINTER_COPIES, 1);

  $string = ob_get_contents();
  /* I'm using the data on the screen buffer */

  printer_write($handle, $string);
  printer_close($handle);


I have the following error message when i use the following code:

Warning: couldn't allocate the printerjob [1804] in
c:\apache\htdocs\... on line 148

the code is:

  ob_start();
  /* put some data on the screen ?/
  echo(some text to be written\n);
  echo(some other text to be written\n);
  echo(another text to be written\n);

  $handle = printer_open(Panasonic KX-P1150);
  printer_set_option($handle, PRINTER_MODE, RAW);
  printer_set_option($handle, PRINTER_COPIES, 1);

  $string = ob_get_contents();
  /* I'm using the data on the screen buffer */

  replaceTurkish($string)
  /* this time i'm using this function that replaces
 the Turkish characters with the English ones.
 The function is given below */

  printer_write($handle, $string);
  printer_close($handle);


function replaceTurkish($text)
{
  $text = str_replace(Ð, G, $text);
  $text = str_replace(Ü, U, $text);
  $text = str_replace(Þ, S, $text);
  $text = str_replace(Ý, I, $text);
  $text = str_replace(Ö, O, $text);
  $text = str_replace(Ç, C, $text);
  $text = str_replace(ð, g, $text);
  $text = str_replace(ü, u, $text);
  $text = str_replace(þ, s, $text);
  $text = str_replace(ý, i, $text);
  $text = str_replace(ö, o, $text);
  $text = str_replace(ç, c, $text);
}

--
The same error occurs when I use:
  printer_write($handle, $string);
instead of
  printer_write($handle, $string);

---
I've seen some similar bug reports closed because of the PHP version is
too old. I used the latest stable version but the same problem occurs.




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



#22667 [Opn-Bgs]: Sobre el manejo de sessiones

2003-03-12 Thread magnus
 ID:   22667
 Updated by:   [EMAIL PROTECTED]
 Reported By:  orgosolm at hotmail dot com
-Status:   Open
+Status:   Bogus
 Bug Type: PHP options/info functions
 Operating System: Todos los Sistemas Operativos
 PHP Version:  4.2.3
 New Comment:

Please write your bugreports in english!
And upgrade to 4.3.1 or use a snapshot to confirm the
bug still exists there.
Snapshots can be found here: http://snaps.php.net


Previous Comments:


[2003-03-12 17:24:00] orgosolm at hotmail dot com

Hola.

Supongo que esto no sea realmente un bug pero bueno esta fue una forma
de saber sobre alguna de las epscificaciones y cosas que soporta PHP.

Sabemos que en PHP no existe el Global.asa que existe en ASP, la idea
es que de que forma yo pudiera hacer una acccion cualquiera cuando el
usuario aborta su session o cuando la session del usuario expiro, por
ejemplo

Quisiera insertar la fecha y la hora en la que el usuario termino la
session tanto como por el TimeOut o abortando por programacion la
session. 

En concreto lo que me gustaria saber si el PHP tiene algun modulo o
soporta de alguna forma algo donde yo especifique alguna tarea cuando
se vensa el tiempo de espera de la session o cuando esta finalice
normalmente.





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



#22655 [Fbk-Opn]: problems with unset

2003-03-12 Thread stanislav at shramko dot com
 ID:   22655
 User updated by:  stanislav at shramko dot com
 Reported By:  stanislav at shramko dot com
-Status:   Feedback
+Status:   Open
 Bug Type: Scripting Engine problem
 Operating System: WinXP
 PHP Version:  4.3.0
 New Comment:

I thought that the variable should be unset in the class as well, cause
it was passed into constructor by reference. Also it is disposed in the
global scope so should be removed from everywhere. Now it seems that
the variable is unset in the global scope, not in local ones. Such
behavior of PHP seems not very predicable to me. 
The only solution I found is to assign a null value to the variable
manually. It looks like a workaround though, not like the right way to
do things.


Previous Comments:


[2003-03-12 17:15:41] [EMAIL PROTECTED]

And what did you expect the output to be?




[2003-03-12 02:15:55] stanislav at shramko dot com

I was very discouraged about the behavior of unset() function with
variables which are
contained in objects in the same time. Also I'm slightly mad about
references to NULL and so on.

?php

// two test classes

class a
{

var $a = null;

function a( $b )
{
$this-a = $b;
}

}

class b
{
var $b = 5;
}

// -- the main part 

// alas, I need to use destructors

$b = new b();
$a = new a( $b );
var_dump( $a ); // checking the object's state
$b-b = 3; // changing it
var_dump( $a ); // Note that value was changed...
unset( $b ); // what are we waiting for?
var_dump( $a ); // but the object's field wasn't affected
$b = null;
var_dump( $a ); // there's no way to destroy this blamed property

echo \n;
// but in case if we will try to assign a null value to this field
whilst 
// the object is in it's initial state, we're getting another results

$b = new b();
$a = new a( $b );
var_dump( $a );
$b-b = 3;
var_dump( $a ); // Note that value was changed...
$b = null;
var_dump( $a ); // I see, it's a great way to dispose a field of an
object :)
// this reference to NULL looks pretty well, isn't it? :)

?

I've lost the sence of the whole situation at this point.

Regards,
Stanislav.




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



#22659 [Ver-WFx]: set_error_handler(foo) doesn't care if foo exists

2003-03-12 Thread iliaa
 ID:   22659
 Updated by:   [EMAIL PROTECTED]
 Reported By:  steil at zweitwerk dot com
-Status:   Verified
+Status:   Wont fix
 Bug Type: Scripting Engine problem
 Operating System: Linux
 PHP Version:  4.3.2RC1
 New Comment:

Fixing this problem would require the code to check for the function's
existance when set_error_handler() is called. This also would mean that
the error handler would need to be declared in the PHP code BEFORE the
set_error_handler() tries to set that function as the error handler.
This behaviour change would break all of the scripts that declare
error_handler AFTER calling set_error_handler();


Previous Comments:


[2003-03-12 16:59:23] [EMAIL PROTECTED]

It returns NULL for me. And this error message:
Warning - set_error_handler() expects argument 1, 'unknown_function',
to be a valid callback





[2003-03-12 10:13:47] steil at zweitwerk dot com

What I mean is the following

?php
// first call returns nothing
$ret1 = set_error_handler(unknown_function);
var_dump($ret1);

// second call returns unknown_function
$ret2 = set_error_handler(another_unknown_function);
var_dump($ret2);
?

The documentation says set_error_handler() would return FALSE if an
error occurs. Therefore, both of the above calls should return FALSE
since setting the error handler to an unknown function is certainly an
error.

As a consequence I am not able to check if the call to
set_error_handler() has been successful.




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



#22321 [Opn-Csd]: Execute Bit and XBitHack seems to breaks PHP

2003-03-12 Thread iliaa
 ID:   22321
 Updated by:   [EMAIL PROTECTED]
 Reported By:  osw at ld dot pages dot de
-Status:   Open
+Status:   Closed
 Bug Type: Apache2 related
 Operating System: Linux (SuSE 8.0)
 PHP Version:  4.3.0
 New Comment:

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.

This bug has been fixed in CVS, however you will need to use
apache2handler, which can be enabled with --with-apxs2 in the configure
script.


Previous Comments:


[2003-02-21 22:45:29] [EMAIL PROTECTED]

This is not really an XBitHack scenario.  XBitHack is meant for
specifying text/html files as PHP files.  This would mean having an
.html file parsed as a PHP because the execute bit is set.

FWIW, #3 is not a bug.  That is correct behavior.  I'm not sure what
you expect to see for case #3.  xxx is not a method.

However, this should be resolved in the apache2handler SAPI in HEAD of
php5.  This new SAPI still needs to be merged back into 4.x.  It may
make it into 4.4 or later though.

(The apache2filter SAPI can't handle this case cleanly.)



[2003-02-20 04:17:03] osw at ld dot pages dot de

Dear PHP-Developers!

I got a very, very strange problem with PHP 4.3.0, Apache 2.0.44  (see
typscript #3 below) and XBitHack on.

If I set the eXecute flag on PHP-parsed files (for example file with
ending .php) PHP don't work correctly any more:

Simple PHP scripts work perfectly (see typescript #2 below) but more
complex  don't work (the PHP code don't get parsed, see typescript #1
below).

In the httpd.conf I set the XBitHack to on. If I turn it off anything
works fine. Or if I remove the x bit from the files it works fine too.

So I'm not really sure whether this is an Apache problem or a PHP
problem.

Hoping it's a real bug and not just a problem with my installation.

Greetings and many thanks in advance,
Kai Seidler




Small typescript #1:

htdocs # cat test.php
html
body
?
echo hello world!\n;
?
/body
/html
htdocs # ls -l test.php
-rw-r--r--1 root root 60 Feb 20 10:55 test.php
htdocs # lynx -source -dump http://localhost/test.php
html
body
hello world!
/body
/html
htdocs # chmod a+x test.php
htdocs # lynx -source -dump http://localhost/test.php
html
body
?
echo hello world!\n;
?
/body
/html
htdocs # 



Small typescript #2:

htdocs # cat test2.php
?
echo hello world!\n;
?
htdocs # ls -l test2.php 
-rw-r--r--1 root root 30 Feb 20 11:01 test2.php
htdocs # lynx -source -dump http://localhost/test2.php
hello world!
htdocs # chmod a+x test2.php
htdocs # lynx -source -dump http://localhost/test2.php
hello world!
htdocs # 



Small typescript #3:

htdocs # telnet localhost 80
Trying ::1...
Connected to localhost.
Escape character is '^]'.
xxx
!DOCTYPE HTML PUBLIC -//IETF//DTD HTML 2.0//EN
htmlhead
title501 Method Not Implemented/title
/headbody
h1Method Not Implemented/h1
pxxx to /index.html not supported.br /
/p
hr /
addressApache/2.0.44 (Unix) mod_perl/1.99_08 Perl/v5.8.0
mod_ssl/2.0.44 OpenSSL/0.9.7 PHP/4.3.0 DAV/2 Server at localhost Port
80/address
/body/html
Connection closed by foreign host.







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



#22597 [Com]: PHP can't select random rows from MySql

2003-03-12 Thread genius at airmail dot net
 ID:   22597
 Comment by:   genius at airmail dot net
 Reported By:  grugli at mmedia dot is
 Status:   Bogus
 Bug Type: MySQL related
 Operating System: Windows XP
 PHP Version:  4.3.1
 New Comment:

The bug is in mysql as I can reproduce it from the command-line. It
also may be windows-specific ... this bug is often mistaken for not
providing a random seed i.e. rand(now()) but the problem persists even
with the seed.


Previous Comments:


[2003-03-08 05:27:47] [EMAIL PROTECTED]

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.

PHP uses the same api call (mysql_query/mysql_real_query) as in mysql
command line client and it doesn't change the query string.



[2003-03-07 18:42:13] grugli at mmedia dot is

This MySql-query doesn't seem to work.
$Query = select * from $TableName ORDER BY RAND() LIMIT 1;

The only thing that the query returns is the first row and nothing
else.
ORDER BY RAND() works very well from the mysql command line but does
not work right through PHP.

The same bug was reported in september 2001 (Bug #13287) and was closed
by [EMAIL PROTECTED] becuse he thought it was a mysql-bug

I know this is not a MySql-bug. It must be a bug in PHP becuse the
mysql-command line works fine.




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



#22597 [Com]: PHP can't select random rows from MySql

2003-03-12 Thread genius at airmail dot net
 ID:   22597
 Comment by:   genius at airmail dot net
 Reported By:  grugli at mmedia dot is
 Status:   Bogus
 Bug Type: MySQL related
 Operating System: Windows XP
 PHP Version:  4.3.1
 New Comment:

I made the previous comment too quickly, it appears to me that this
indeed is a php (for win32 .. cause it tested on linux w/o problems)
problem.

when running mysql command line this command 'select * from pictures
order by rand()' produces random results, however when calling that
same command from php it always returns the same result.

in my previous post i was running 'select * from pictures order by
rand(now())' from the command line which returns the same result every
time, which lead me to believe the bug was in mysql.

someone please reopen this bug report


Previous Comments:


[2003-03-12 20:45:54] genius at airmail dot net

The bug is in mysql as I can reproduce it from the command-line. It
also may be windows-specific ... this bug is often mistaken for not
providing a random seed i.e. rand(now()) but the problem persists even
with the seed.



[2003-03-08 05:27:47] [EMAIL PROTECTED]

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.

PHP uses the same api call (mysql_query/mysql_real_query) as in mysql
command line client and it doesn't change the query string.



[2003-03-07 18:42:13] grugli at mmedia dot is

This MySql-query doesn't seem to work.
$Query = select * from $TableName ORDER BY RAND() LIMIT 1;

The only thing that the query returns is the first row and nothing
else.
ORDER BY RAND() works very well from the mysql command line but does
not work right through PHP.

The same bug was reported in september 2001 (Bug #13287) and was closed
by [EMAIL PROTECTED] becuse he thought it was a mysql-bug

I know this is not a MySql-bug. It must be a bug in PHP becuse the
mysql-command line works fine.




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



#22670 [NEW]: session_start() URL Bug

2003-03-12 Thread r_stretch at yahoo dot com
From: r_stretch at yahoo dot com
Operating system: Debian
PHP version:  4.3.1
PHP Bug Type: URL related
Bug description:  session_start() URL Bug

Hi there,

It seems that if the index.php starts with session_start() any hyperlinks
that do not begin with http://; within the document will have the
PHPSESSID appended to the end of the hyperlink. Though once you refresh
the same page the PHPSESSID removes itself from the hyperlink.

Example:
 start 
?
//File Name: index.php
session_start();
?
html
headtitleINDEX.PHP/title/head
body
a href=index.phpreload this page/a
/body
/html
- end -

When you hover the cursor over the hyperlink you will see:
http://path_to_URL/index.php?PHPSESSID=hash_characters

Now click that same link and you will see (will refresh the page):
http://path_to_URL/index.php

I install only with MySQL, GD, CGI modules.

Is this a bug or is it working as expected?



-- 
Edit bug report at http://bugs.php.net/?id=22670edit=1
-- 
Try a CVS snapshot: http://bugs.php.net/fix.php?id=22670r=trysnapshot
Fixed in CVS:   http://bugs.php.net/fix.php?id=22670r=fixedcvs
Fixed in release:   http://bugs.php.net/fix.php?id=22670r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=22670r=needtrace
Try newer version:  http://bugs.php.net/fix.php?id=22670r=oldversion
Not developer issue:http://bugs.php.net/fix.php?id=22670r=support
Expected behavior:  http://bugs.php.net/fix.php?id=22670r=notwrong
Not enough info:http://bugs.php.net/fix.php?id=22670r=notenoughinfo
Submitted twice:http://bugs.php.net/fix.php?id=22670r=submittedtwice
register_globals:   http://bugs.php.net/fix.php?id=22670r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=22670r=php3
Daylight Savings:   http://bugs.php.net/fix.php?id=22670r=dst
IIS Stability:  http://bugs.php.net/fix.php?id=22670r=isapi
Install GNU Sed:http://bugs.php.net/fix.php?id=22670r=gnused



#20583 [Com]: Variable values inconsistent with assignment statements.

2003-03-12 Thread junkmail-trash at int0rnet dot net
 ID:   20583
 Comment by:   junkmail-trash at int0rnet dot net
 Reported By:  jseverson at myersinternet dot com
 Status:   Open
 Bug Type: Session related
 Operating System: RedHat 7.2
 PHP Version:  4CVS-2002-11-22 (stable)
 New Comment:

I'm seeing this as well, on PHP 4.3.0 on Darwin -- it's 
definately related to sessions.  

My boss keeps asking why we aren't using Cold Fusion for 
this project.  I'm starting to have trouble coming up with 
a good answer to keep using PHP..


Previous Comments:


[2003-02-26 17:12:56] jseverson at myersinternet dot com

On that same note, we have now rolled back all our servers to an older
version of php as this was bug was becoming impossible to work with.



[2003-02-26 17:12:10] jseverson at myersinternet dot com

Well, unfortunately I have bad news for you. Try using the empty() or
isset() functions on your new $_SESSION global variables. My guess is
they will always return true regardless of whether or not that variable
actually has a value. At least this was my experience when I did the
same thing you did, and went through replacing all my session
functions.

So for instance, in order to replace:

session_is_registered(variable)

you'd have to do:

!empty($_SESSION[variable])

unfortunately, it always returns true!!



[2003-02-26 16:07:22] charlesk at netgaintechnology dot com

I forgot the session_start();  Still the same behaviour

?php
session_start();
$a = 4;
$test = $_SERVER[HTTP_REFERER];
$_SESSION[test] = $test;
$y = 3;
$t = 2;
$a = 5;

echo $a $t $y;
?

Output : 5 2 3

?php
session_start();
$a = 4;
$test = $_SERVER[HTTP_REFERER];
session_register(test);
$y = 3;
$t = 2;
$a = 5;

echo $a $t $y;
?

Output: 5 2 2



[2003-02-09 16:38:22] phpbugs at brianmertens dot com

Maybe this is related to the bug #22117 , that
I reported yesterday?

http://bugs.php.net/bug.php?id=22117



[2003-02-04 13:05:49] jseverson at myersinternet dot com

Just wanted to check in on this bug and see if any progress has been
made...thanks.



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

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



#22670 [Opn-Bgs]: session_start() URL Bug

2003-03-12 Thread sniper
 ID:   22670
 Updated by:   [EMAIL PROTECTED]
 Reported By:  r_stretch at yahoo dot com
-Status:   Open
+Status:   Bogus
-Bug Type: URL related
+Bug Type: Session related
 Operating System: Debian
 PHP Version:  4.3.1
 New Comment:

Yes, it's normal. (the cookie is not set at the first request)




Previous Comments:


[2003-03-12 23:03:05] r_stretch at yahoo dot com

Hi there,

It seems that if the index.php starts with session_start() any
hyperlinks that do not begin with http://; within the document will
have the PHPSESSID appended to the end of the hyperlink. Though once
you refresh the same page the PHPSESSID removes itself from the
hyperlink.

Example:
 start 
?
//File Name: index.php
session_start();
?
html
headtitleINDEX.PHP/title/head
body
a href=index.phpreload this page/a
/body
/html
- end -

When you hover the cursor over the hyperlink you will see:
http://path_to_URL/index.php?PHPSESSID=hash_characters

Now click that same link and you will see (will refresh the page):
http://path_to_URL/index.php

I install only with MySQL, GD, CGI modules.

Is this a bug or is it working as expected?







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



#20583 [Opn-Fbk]: Variable values inconsistent with assignment statements.

2003-03-12 Thread rasmus
 ID:   20583
 Updated by:   [EMAIL PROTECTED]
 Reported By:  jseverson at myersinternet dot com
-Status:   Open
+Status:   Feedback
 Bug Type: Session related
 Operating System: RedHat 7.2
 PHP Version:  4CVS-2002-11-22 (stable)
 New Comment:

What is your php.ini setting for session.bug_compat_42 ?
Does turning that on/off change anything?  


Previous Comments:


[2003-03-13 00:12:36] junkmail-trash at int0rnet dot net

I'm seeing this as well, on PHP 4.3.0 on Darwin -- it's 
definately related to sessions.  

My boss keeps asking why we aren't using Cold Fusion for 
this project.  I'm starting to have trouble coming up with 
a good answer to keep using PHP..



[2003-02-26 17:12:56] jseverson at myersinternet dot com

On that same note, we have now rolled back all our servers to an older
version of php as this was bug was becoming impossible to work with.



[2003-02-26 17:12:10] jseverson at myersinternet dot com

Well, unfortunately I have bad news for you. Try using the empty() or
isset() functions on your new $_SESSION global variables. My guess is
they will always return true regardless of whether or not that variable
actually has a value. At least this was my experience when I did the
same thing you did, and went through replacing all my session
functions.

So for instance, in order to replace:

session_is_registered(variable)

you'd have to do:

!empty($_SESSION[variable])

unfortunately, it always returns true!!



[2003-02-26 16:07:22] charlesk at netgaintechnology dot com

I forgot the session_start();  Still the same behaviour

?php
session_start();
$a = 4;
$test = $_SERVER[HTTP_REFERER];
$_SESSION[test] = $test;
$y = 3;
$t = 2;
$a = 5;

echo $a $t $y;
?

Output : 5 2 3

?php
session_start();
$a = 4;
$test = $_SERVER[HTTP_REFERER];
session_register(test);
$y = 3;
$t = 2;
$a = 5;

echo $a $t $y;
?

Output: 5 2 2



[2003-02-09 16:38:22] phpbugs at brianmertens dot com

Maybe this is related to the bug #22117 , that
I reported yesterday?

http://bugs.php.net/bug.php?id=22117



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

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



#18291 [Com]: exec() arguments (+suggested solution)

2003-03-12 Thread soren at vejrum dot dk
 ID:   18291
 Comment by:   soren at vejrum dot dk
 Reported By:  php dot hc at saustrup dot net
 Status:   Verified
 Bug Type: Program Execution
 Operating System: RedHat Linux 7.3
 PHP Version:  4.3.0-dev
 New Comment:

Same/similar problem in PHP 3.1.0 (on RedHat Linux 7.2).


Previous Comments:


[2002-07-19 20:56:56] [EMAIL PROTECTED]

Seems like safe-mode does mess up the parameters.
I'm not sure if this is actually the correct behaviour...




[2002-07-19 20:09:28] php dot hc at saustrup dot net

I tried what you suggested, and this is what came out:

Script 1: 213
Script 2: 213

I'm a security freak, so I have safe_mode enabled. Apparently safe_mode
is infact the cause of this error, because when I disabled it in
php.ini, the two scripts worked like you suggested:

Script 1: 213 123
Script 2: 213

Please test this yourself and post the results.



[2002-07-12 18:51:52] [EMAIL PROTECTED]

FYI: PHP uses popen(), not execve()..

In 4.2.1 there is pcntl_exec() which behaves similarly to
the system execve. Maybe that's what you want to use..?


Try these scripts:

shell_args_1arg.php:
?php echo exec('./test.sh 213 123'); ?

shell_args_2arg.php:
?php echo exec('./test.sh 213 123'); ?

test.sh:
8
#!/bin/sh

echo $1
8





[2002-07-12 08:31:07] php dot hc at saustrup dot net

And just to make it perfectly clear what arguments my binary is
getting:

Arg1: 1
Arg2: 2
Arg3: 3
Arg4: a
Arg5: b
Arg6: c
Arg7: 4
Arg8: 5
Arg9: 6



[2002-07-12 08:28:20] php dot hc at saustrup dot net

As far as I can see, it's not even required by the exec()'ing user to
have a valid shell in /etc/passwd, so I very much expect that the
binary is being exec()'d directly, without the use of a shell.
If you check out the man page for the execve() function, you'll see
that arguments are actually submitted as an array, and not as a whole
string. If they were infact passed through a shell (I believe the
backticks and passthru() does this), escapeshellarg() might have been
the solution - but not in this case. I tried it, but exec() apparently
still splits up the string where it finds whitespaces (escaped or not),
and passes it on to ie. execve().

And just to make it perfectly clear what I want:

Binary: /usr/bin/binary
Arg1: 1
Arg2: 2
Arg3: 3
Arg4: a b c
Arg5: 4
Arg6: 5
Arg7: 6



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

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



#22566 [NoF-Opn]: imap_mail hang the script

2003-03-12 Thread lmstudio at 1system dot ru
 ID:   22566
 User updated by:  lmstudio at 1system dot ru
 Reported By:  lmstudio at 1system dot ru
-Status:   No Feedback
+Status:   Open
 Bug Type: IMAP related
 Operating System: Windows 2000 Pro
-PHP Version:  4.3.1
+PHP Version:  4.3.2
 New Comment:

Sorry for delay.
I installed new version - my prombler still present.

On http://www.lmstudio.arctel.ru/mail_output.html
now you can find the whole PHP script for testing.


Previous Comments:


[2003-03-11 20:17:20] [EMAIL PROTECTED]

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





[2003-03-06 12:54:36] [EMAIL PROTECTED]

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



[2003-03-06 04:18:01] lmstudio at 1system dot ru

The whole content for the 4-th param. for imap_mail can be found at
http://www.lmstudio.arctel.ru/mail_output.html



[2003-03-06 01:22:56] lmstudio at 1system dot ru

I try to send email from my PHP script with imap_mail function. My mail
consists a simple message part and attachment as ~250KB file. I compose
mail header with imap_compose function, here it's output:

From: [EMAIL PROTECTED]
Reply-To: [EMAIL PROTECTED]
MIME-Version: 1.0
Content-Type: MULTIPART/mixed; BOUNDARY=90-31600-1046934660=:2764
X-Mailer: PHP4.3.1

--90-31600-1046934660=:2764
Content-Type: TEXT/plain; CHARSET=Windows-1251

Hello !!!
--90-31600-1046934660=:2764
Content-Type: IMAGE/gif
Content-Transfer-Encoding: BASE64
Content-Description: img.gif
Content-Disposition: attachment; filename=img.gif

R0lGODlhTwKeBPcAAPP1+d7v/9zv99bv/+bm/97m/97m99bm/9bm997e
/97e98nn/tbe/9fg7Nbe987e/87e99nW/9bW99bW78He/c7W/9bW5M7W987W
787W5sXW987W3sXW787O/9vH/8XW5s7O97vW/87O77rW98XO/87N5sXO98/P
... ~250KB ...
99mbRu95/3vgM2f4xB++8IGP/N4rP/jFZ77vnR/940s/+dRfvvWbP33tV3/7
1+9+9rkffu+LH/zjN3/50TMP/e+rn/zsP7/702/89sv//fSP//PtD3/955//
+Pc/9vfv/9av/wCQAAdQAOeP+YIgIAAAOw==

--90-31600-1046934660=:2764--

And imap_mail hang the script.
Help, please.




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



#22657 [Bgs]: Weak parsing in rfc1867.c

2003-03-12 Thread vesely at tana dot it
 ID:   22657
 User updated by:  vesely at tana dot it
 Reported By:  vesely at tana dot it
 Status:   Bogus
 Bug Type: HTTP related
 Operating System: Any
 PHP Version:  4.3.0
 New Comment:

 buf_begin can be NULL, no DOS possible - BOGUS1

it is not initialized to NULL, it is never tested for not
being NULL, and around line 232, function fill_buffer

  if (self-bytes_in_buffer  0  self-buf_begin != self-buffer) {
memmove(self-buffer, self-buf_begin, self-bytes_in_buffer);
}

should grant the job will be done. Why do you say
it can be NULL? If I have some more time next week
I'll try and prepare a proof of concept.

  searching for ',' is correct this works around a bug
  in some IE version - BOGUS2

Ha ha! I should have guessed it... :-)


Previous Comments:


[2003-03-12 16:06:33] [EMAIL PROTECTED]

buf_begin can be NULL, no DOS possible - BOGUS1

searching for ',' is correct this works around a bug
in some IE version - BOGUS2



[2003-03-12 03:44:37] vesely at tana dot it

Hi,
watch out rfc1867.c around line 342, in function
next_line() there is (was?) the following code:

if (ptr) {
/* ... */   
} else {
/* ... */

line[self-bufsize] = 0;
self-buf_begin = ptr;/* === */
self-bytes_in_buffer = 0;
}

ptr is obviously NULL, buf_begin should never be NULL
or the program may crash. So this is a potential
vulnerability for DOS attackers who submit long lines.

Since you're there, would you mind to check why at line
721, in the rfc1867_post_handler function, there is

boundary_end = strchr(boundary, ',');

Shouldn't it be ';' (semicolon) rather than ',' (comma)?
(Just wandering)




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



#22671 [NEW]: IMG SRC not able to get SESSION values

2003-03-12 Thread ronneil at restricted dot dyndns dot org
From: ronneil at restricted dot dyndns dot org
Operating system: FreeBSD 4.7 and Redhat 7.3
PHP version:  4.3.0
PHP Bug Type: Session related
Bug description:  IMG SRC not able to get SESSION values

I am trying to retrieve values from a SESSION variable array. To retrieve,
I am using img src=somefile.php. Unfortunately, I am not able to see any
value. Below are 2 sample php files to recreate the error. test1.php
calls test2.php via img src TAG.

Currently in production, I have a working code
(http://restricted.dyndns.org/codes/ocishow1.php) that uses almost same
concept below but this one saves the data to a file first. This code calls
another php file (http://restricted.dyndns.org/codes/ocishow2.php) to
generate the graph and is called via img src.

--TEST CODE---
FILENAME : test1.php
?php
   session_start();
   $time_VAR = array(2343,3234,457,2356,6798,3467,34667,4578,2523);

   for ($ipage=0;$ipage4;$ipage++) {
   for ($i=0;$icount($time_VAR);$i++) {
   $_SESSION[$ipage][] = $time_VAR[$i];
   }

// the following loop verifies if SESSION variable was populated
   for ($i=0;$icount($_SESSION[$ipage]);$i++) {
   echo $i.) .$_SESSION[$ipage][$i].br;
   }
   $pagenum = $ipage;
   $arraysize = count($_SESSION[$ipage]);
   echo Pagenum : $pagenum, Size of current array : $arraysizebr;
   echo 'img
src=test2.php?count='.$pagenum.'varsize='.$arraysize.'';
   echo New linebrbr;
   }
   session_destroy();
?
-
FILENAME : test2.php
?php
session_start();
$index = $_GET[count];
$arraysize = $_GET[varsize];

// file handling was written to verify the size of array and index if
there are really values on it
$fp1 = fopen(/tmp/checkval.txt,w);
$err = fwrite($fp1,Pagenum : $index, Size of Array: $arraysize\n);
fclose($fp1);

for ($i=0;$i$arraysize;$i++) {
$atemp_alltel_VAR[] = $_SESSION[$index][$i];
}
// This is the only way I can verify 
$fp = fopen(/tmp/testing,w);
for ($i=0;$icount($atemp_alltel_VAR);$i++) {
$err = fwrite($fp, $atemp_alltel_VAR[$i]);
}
fclose($fp);
?

-- 
Edit bug report at http://bugs.php.net/?id=22671edit=1
-- 
Try a CVS snapshot: http://bugs.php.net/fix.php?id=22671r=trysnapshot
Fixed in CVS:   http://bugs.php.net/fix.php?id=22671r=fixedcvs
Fixed in release:   http://bugs.php.net/fix.php?id=22671r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=22671r=needtrace
Try newer version:  http://bugs.php.net/fix.php?id=22671r=oldversion
Not developer issue:http://bugs.php.net/fix.php?id=22671r=support
Expected behavior:  http://bugs.php.net/fix.php?id=22671r=notwrong
Not enough info:http://bugs.php.net/fix.php?id=22671r=notenoughinfo
Submitted twice:http://bugs.php.net/fix.php?id=22671r=submittedtwice
register_globals:   http://bugs.php.net/fix.php?id=22671r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=22671r=php3
Daylight Savings:   http://bugs.php.net/fix.php?id=22671r=dst
IIS Stability:  http://bugs.php.net/fix.php?id=22671r=isapi
Install GNU Sed:http://bugs.php.net/fix.php?id=22671r=gnused



#22671 [Opn-Ana]: IMG SRC not able to get SESSION values

2003-03-12 Thread rasmus
 ID:   22671
 Updated by:   [EMAIL PROTECTED]
 Reported By:  ronneil at restricted dot dyndns dot org
-Status:   Open
+Status:   Analyzed
 Bug Type: Session related
 Operating System: FreeBSD 4.7 and Redhat 7.3
 PHP Version:  4.3.0
 New Comment:

You explicitly destroy the session right there at the bottom of
test1.php.  Why do you think that the session will still be around by
the time the request for the test2 image comes through?  Chances are
that test1 has finished executing by then and thus you session data has
been destroyed.


Previous Comments:


[2003-03-13 01:31:31] ronneil at restricted dot dyndns dot org

I am trying to retrieve values from a SESSION variable array. To
retrieve, I am using img src=somefile.php. Unfortunately, I am not
able to see any value. Below are 2 sample php files to recreate the
error. test1.php calls test2.php via img src TAG.

Currently in production, I have a working code
(http://restricted.dyndns.org/codes/ocishow1.php) that uses almost same
concept below but this one saves the data to a file first. This code
calls another php file
(http://restricted.dyndns.org/codes/ocishow2.php) to generate the graph
and is called via img src.

--TEST CODE---
FILENAME : test1.php
?php
   session_start();
   $time_VAR = array(2343,3234,457,2356,6798,3467,34667,4578,2523);

   for ($ipage=0;$ipage4;$ipage++) {
   for ($i=0;$icount($time_VAR);$i++) {
   $_SESSION[$ipage][] = $time_VAR[$i];
   }

// the following loop verifies if SESSION variable was populated
   for ($i=0;$icount($_SESSION[$ipage]);$i++) {
   echo $i.) .$_SESSION[$ipage][$i].br;
   }
   $pagenum = $ipage;
   $arraysize = count($_SESSION[$ipage]);
   echo Pagenum : $pagenum, Size of current array :
$arraysizebr;
   echo 'img
src=test2.php?count='.$pagenum.'varsize='.$arraysize.'';
   echo New linebrbr;
   }
   session_destroy();
?
-
FILENAME : test2.php
?php
session_start();
$index = $_GET[count];
$arraysize = $_GET[varsize];

// file handling was written to verify the size of array and index
if there are really values on it
$fp1 = fopen(/tmp/checkval.txt,w);
$err = fwrite($fp1,Pagenum : $index, Size of Array:
$arraysize\n);
fclose($fp1);

for ($i=0;$i$arraysize;$i++) {
$atemp_alltel_VAR[] = $_SESSION[$index][$i];
}
// This is the only way I can verify 
$fp = fopen(/tmp/testing,w);
for ($i=0;$icount($atemp_alltel_VAR);$i++) {
$err = fwrite($fp, $atemp_alltel_VAR[$i]);
}
fclose($fp);
?





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