[PHP-DEV] Bug #15215 Updated: Wrong path for php.ini under Windows XP (Home and Professional)

2002-01-27 Thread phpbugs

ID: 15215
Comment by: [EMAIL PROTECTED]
Old Reported By: [EMAIL PROTECTED]
Reported By: [EMAIL PROTECTED]
Status: Open
Bug Type: *Configuration Issues
Operating System: Windows NT 5.1 (XP)
PHP Version: 4.1.1
New Comment:

This has never happened to me. My php.ini gets parsed whether it
resides in windows directory (for sapi-version) or in php-directory for
cgi. I'm using XP Pro, but it also works with NT 4 and non-standard
windir-name (winntw).

Christoph


Previous Comments:


[2002-01-24 19:14:40] [EMAIL PROTECTED]

If you install the Windows binaries on Systems running Windows XP, PHP
assumes that there is a system directory 'C:\winnt\' because of the
version string reported by Windows (Windows NT 5.x). As there is no
such Dir (under Win XP the System Dir is named 'C:\Windows\' by
default), php.ini is not found. I couldn't find help in creating this
dir and put the .ini file in. Also the 'php.ini' is not found if simply
put in the path.





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


-- 
PHP Development Mailing List 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP-DEV] Bug #14076 Updated: fopen() and touch() fail to create file under safe mode

2002-01-17 Thread phpbugs

ID: 14076
Comment by: [EMAIL PROTECTED]
Old Reported By: [EMAIL PROTECTED]
Reported By: [EMAIL PROTECTED]
Status: Open
Bug Type: *Directory/Filesystem functions
Operating System: Linux
PHP Version: 4.0.6
New Comment:

I've verified that this problem still exists in PHP 4.1.1.

Hajo Noerenberg


Previous Comments:


[2002-01-16 13:42:52] [EMAIL PROTECTED]

As a workaround you can use relative paths in all of
your fopen()-calls: fopen("./test.html") always works
(I think php prepends the *expanded path* then -- see
the last paragraph in my previous comment).

Hajo



[2002-01-16 13:21:11] [EMAIL PROTECTED]

This problem has nothing to do with wrong file/directory modes. I'm
quite sure that it is a bug in the PHP-realpath-code.

Please consider the following setup layout:

/var/www/ = symlink to /mnt/sda1/www
/var/www/domain.com = apache document_root = php open_basedir
/var/www/domain.com/test.html = test file for fopen()

I've added some debug code to fopen_wrappers.c :

php_error(E_NOTICE, "check_specific_open_basedir ( comparing resolved
name %s to resolved_basedir %s )", resolved_name, resolved_basedir);
if (strncmp(resolved_basedir, resolved_name, strlen(resolved_basedir))
== 0) {


Trying to fopen("/var/www/domain.com/test.html") results
in two cases:

1. /var/www/domain.com/test.html already exists

PHP Warning: check_specific_open_basedir ( comparing resolved name
/mnt/sda1/www/domain.com/test.html to resolved_basedir
/mnt/sda1/www/domain.com/test.html )

-> fopen() succeeds

2. /var/www/domain.com/test.html does *not* exist

PHP Warning: check_specific_open_basedir ( comparing resolved name
/var/www/domain.com/test.html to resolved_basedir
/mnt/sda1/www/domain.com/test.html )

-> fopen() fails with "open basedir restriction in effect"-error


As you can see in the debug output, PHP does not correctly
expand the file path if the file does not exists !

Trying to fopen("/mnt/sda1/www/domain.com/test.html") always
succeeds because PHP does not need to expand the filename anymore
(-> strncmp is always true ).

Hajo

(Linux 2.2 - PHP 4.0.6 - afaik the problem still exists in 4.1.X)



[2001-11-19 13:50:10] [EMAIL PROTECTED]

Well, the fact that it can create a *new directory* in the same
directory, already means that the apache process has sufficient
permissions to also create a file in it.  However, these are the
permissions:

webedit@penguin:/var/www/tmp/submit$ ls -lad ./
drwxrwx---   18 webedit  www  4096 Nov 15 19:13 ./

Apache runs as user `www', and the scripts are owned by user `webedit'.
 Note that the directory is owned by the same user as the script, and
writeable to Apache, so the requirements of safe mode are met.
Thank you for your response.
-- 
Arcady Genkin



[2001-11-19 12:37:01] [EMAIL PROTECTED]

Post please the
mod of your directory and tell me the
user and group of your apache. Maybe the apache dont have
rights to create a new file in your directory but he owns the newfile
and can remove/edit this file.




[2001-11-15 18:53:16] [EMAIL PROTECTED]

Under safe mode, fopen("filename", "w") fails to create a file if it
doesn't exist, complaining about open_basedir restriction.  However,
the filename refers to the file in the directory configured in the
open_basedir.  Besides, if the same file is created manually, fopen()
can open it for writing without  any problems.  The directory is
writeable to the web server.

$dir = '/var/www/tmp/submit';

// Fails if the file doesn't exist.
// Succeeds if the file does exist
fopen( "$dir/file.txt", "w" ); // Fails if the file doesn't exist.
mkdir( "$dir/foo", 0700 ); // SUCCEEDS!!! Notice the same path.





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


-- 
PHP Development Mailing List 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP-DEV] Bug #14076 Updated: fopen() and touch() fail to create file under safe mode

2002-01-16 Thread phpbugs

ID: 14076
Comment by: [EMAIL PROTECTED]
Old Reported By: [EMAIL PROTECTED]
Reported By: [EMAIL PROTECTED]
Status: Open
Bug Type: *Directory/Filesystem functions
Operating System: Linux
PHP Version: 4.0.6
New Comment:

As a workaround you can use relative paths in all of
your fopen()-calls: fopen("./test.html") always works
(I think php prepends the *expanded path* then -- see
the last paragraph in my previous comment).

Hajo


Previous Comments:


[2002-01-16 13:21:11] [EMAIL PROTECTED]

This problem has nothing to do with wrong file/directory modes. I'm
quite sure that it is a bug in the PHP-realpath-code.

Please consider the following setup layout:

/var/www/ = symlink to /mnt/sda1/www
/var/www/domain.com = apache document_root = php open_basedir
/var/www/domain.com/test.html = test file for fopen()

I've added some debug code to fopen_wrappers.c :

php_error(E_NOTICE, "check_specific_open_basedir ( comparing resolved
name %s to resolved_basedir %s )", resolved_name, resolved_basedir);
if (strncmp(resolved_basedir, resolved_name, strlen(resolved_basedir))
== 0) {


Trying to fopen("/var/www/domain.com/test.html") results
in two cases:

1. /var/www/domain.com/test.html already exists

PHP Warning: check_specific_open_basedir ( comparing resolved name
/mnt/sda1/www/domain.com/test.html to resolved_basedir
/mnt/sda1/www/domain.com/test.html )

-> fopen() succeeds

2. /var/www/domain.com/test.html does *not* exist

PHP Warning: check_specific_open_basedir ( comparing resolved name
/var/www/domain.com/test.html to resolved_basedir
/mnt/sda1/www/domain.com/test.html )

-> fopen() fails with "open basedir restriction in effect"-error


As you can see in the debug output, PHP does not correctly
expand the file path if the file does not exists !

Trying to fopen("/mnt/sda1/www/domain.com/test.html") always
succeeds because PHP does not need to expand the filename anymore
(-> strncmp is always true ).

Hajo

(Linux 2.2 - PHP 4.0.6 - afaik the problem still exists in 4.1.X)



[2001-11-19 13:50:10] [EMAIL PROTECTED]

Well, the fact that it can create a *new directory* in the same
directory, already means that the apache process has sufficient
permissions to also create a file in it.  However, these are the
permissions:

webedit@penguin:/var/www/tmp/submit$ ls -lad ./
drwxrwx---   18 webedit  www  4096 Nov 15 19:13 ./

Apache runs as user `www', and the scripts are owned by user `webedit'.
 Note that the directory is owned by the same user as the script, and
writeable to Apache, so the requirements of safe mode are met.
Thank you for your response.
-- 
Arcady Genkin



[2001-11-19 12:37:01] [EMAIL PROTECTED]

Post please the
mod of your directory and tell me the
user and group of your apache. Maybe the apache dont have
rights to create a new file in your directory but he owns the newfile
and can remove/edit this file.




[2001-11-15 18:53:16] [EMAIL PROTECTED]

Under safe mode, fopen("filename", "w") fails to create a file if it
doesn't exist, complaining about open_basedir restriction.  However,
the filename refers to the file in the directory configured in the
open_basedir.  Besides, if the same file is created manually, fopen()
can open it for writing without  any problems.  The directory is
writeable to the web server.

$dir = '/var/www/tmp/submit';

// Fails if the file doesn't exist.
// Succeeds if the file does exist
fopen( "$dir/file.txt", "w" ); // Fails if the file doesn't exist.
mkdir( "$dir/foo", 0700 ); // SUCCEEDS!!! Notice the same path.





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


-- 
PHP Development Mailing List 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP-DEV] Bug #14076 Updated: fopen() and touch() fail to create file under safe mode

2002-01-16 Thread phpbugs

ID: 14076
Comment by: [EMAIL PROTECTED]
Old Reported By: [EMAIL PROTECTED]
Reported By: [EMAIL PROTECTED]
Status: Open
Bug Type: *Directory/Filesystem functions
Operating System: Linux
PHP Version: 4.0.6
New Comment:

This problem has nothing to do with wrong file/directory modes. I'm
quite sure that it is a bug in the PHP-realpath-code.

Please consider the following setup layout:

/var/www/ = symlink to /mnt/sda1/www
/var/www/domain.com = apache document_root = php open_basedir
/var/www/domain.com/test.html = test file for fopen()

I've added some debug code to fopen_wrappers.c :

php_error(E_NOTICE, "check_specific_open_basedir ( comparing resolved
name %s to resolved_basedir %s )", resolved_name, resolved_basedir);
if (strncmp(resolved_basedir, resolved_name, strlen(resolved_basedir))
== 0) {


Trying to fopen("/var/www/domain.com/test.html") results
in two cases:

1. /var/www/domain.com/test.html already exists

PHP Warning: check_specific_open_basedir ( comparing resolved name
/mnt/sda1/www/domain.com/test.html to resolved_basedir
/mnt/sda1/www/domain.com/test.html )

-> fopen() succeeds

2. /var/www/domain.com/test.html does *not* exist

PHP Warning: check_specific_open_basedir ( comparing resolved name
/var/www/domain.com/test.html to resolved_basedir
/mnt/sda1/www/domain.com/test.html )

-> fopen() fails with "open basedir restriction in effect"-error


As you can see in the debug output, PHP does not correctly
expand the file path if the file does not exists !

Trying to fopen("/mnt/sda1/www/domain.com/test.html") always
succeeds because PHP does not need to expand the filename anymore
(-> strncmp is always true ).

Hajo

(Linux 2.2 - PHP 4.0.6 - afaik the problem still exists in 4.1.X)


Previous Comments:


[2001-11-19 13:50:10] [EMAIL PROTECTED]

Well, the fact that it can create a *new directory* in the same
directory, already means that the apache process has sufficient
permissions to also create a file in it.  However, these are the
permissions:

webedit@penguin:/var/www/tmp/submit$ ls -lad ./
drwxrwx---   18 webedit  www  4096 Nov 15 19:13 ./

Apache runs as user `www', and the scripts are owned by user `webedit'.
 Note that the directory is owned by the same user as the script, and
writeable to Apache, so the requirements of safe mode are met.
Thank you for your response.
-- 
Arcady Genkin



[2001-11-19 12:37:01] [EMAIL PROTECTED]

Post please the
mod of your directory and tell me the
user and group of your apache. Maybe the apache dont have
rights to create a new file in your directory but he owns the newfile
and can remove/edit this file.




[2001-11-15 18:53:16] [EMAIL PROTECTED]

Under safe mode, fopen("filename", "w") fails to create a file if it
doesn't exist, complaining about open_basedir restriction.  However,
the filename refers to the file in the directory configured in the
open_basedir.  Besides, if the same file is created manually, fopen()
can open it for writing without  any problems.  The directory is
writeable to the web server.

$dir = '/var/www/tmp/submit';

// Fails if the file doesn't exist.
// Succeeds if the file does exist
fopen( "$dir/file.txt", "w" ); // Fails if the file doesn't exist.
mkdir( "$dir/foo", 0700 ); // SUCCEEDS!!! Notice the same path.





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


-- 
PHP Development Mailing List 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP-DEV] Bug #13553 Updated: $this isn't set in XML object handlers

2002-01-14 Thread phpbugs

ID: 13553
User updated by: [EMAIL PROTECTED]
Old Summary: $this isn't set in XML object handlers
Reported By: [EMAIL PROTECTED]
Old Status: Feedback
Status: Closed
Bug Type: XML related
Operating System: Mac OS X 10.1
PHP Version: 4.0.6
New Comment:

It no longer crashes with 4.1.0. I'm going to test my larger XML
application later this week.


Previous Comments:


[2002-01-14 10:01:10] [EMAIL PROTECTED]

Is this valid on 4.1.1?



[2001-10-04 22:59:47] [EMAIL PROTECTED]

xml_set_object() allows you to use an xml parser inside a 
class and have it call class methods instead of global 
functions. $this is not set properly within the context of 
these handlers when called by the xml parser. This can 
cause data loss (e.g. $this->variable is set by one of the 
XML handlers and disappears after the parsing is finished) 
or, if you try to call certain functions on $this such as 
gettype() or classname() php will die with a bus error:

XMLParser = xml_parser_create();

xml_set_object($this->XMLParser, $this);
xml_parser_set_option($this->XMLParser, 
XML_OPTION_CASE_FOLDING, false);
xml_set_element_handler($this->XMLParser, 
"xmlStartElement", "xmlEndElement");
}

function parse() {
$xml = '
';  

if (!xml_parse($this->XMLParser, $xml, true)) {
die( sprintf("XML parse error: %s at line 
%d\n", 
xml_error_string(xml_get_error_code($this->XMLParser)), 
xml_get_current_line_number($this->XMLParser) )
);
}
xml_parser_free($this->XMLParser);
}

function xmlStartElement($parser, $name, $attribs) {
print "Opening $name - \$this = " . gettype($this) . "\
n";
}

function xmlEndElement($parser, $name) {
print "Closing $name - \$this = " . gettype($this) . "\
n";
}

}

$CrashMe = new ThisBug();
$CrashMe->parse();
?>


chris@calaban:~/Development/netdiff $ php -q ThisBug.php 
Opening foo - $this = object
Opening bar - $this = object
Closing bar - $this = object
Bus error

(uname -a = Darwin calaban.my.domain 1.4 Darwin Kernel 
Version 1.4: Sun Sep  9 15:39:59 PDT 2001; root:xnu/xnu-
201.obj~1/RELEASE_PPC  Power Macintosh powerpc)

IMPORTANT NOTE:
This appears to be identical to bug #12959, which was 
marked bogus with the mistaken comment "you are trying to 
use $this outside of a class so it does not work.", when 
$this was being used inside a class, as it is here. This is 
the entire point for having xml_set_object().







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


-- 
PHP Development Mailing List 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP-DEV] Bug #14688 Updated: session_register() doesn't register

2001-12-25 Thread niklas-phpbugs

ID: 14688
User updated by: [EMAIL PROTECTED]
Reported By: [EMAIL PROTECTED]
Status: Open
Bug Type: Session related
Operating System: linux 2.2
PHP Version: 4.1.0
New Comment:

This bug is in 4.1.1 aswell

Previous Comments:


[2001-12-25 07:44:24] [EMAIL PROTECTED]

Both servers got register_globals = On.
On the 4.1.0 server i run with a php.ini that originates from the 4.0.5 release.

--niklas



[2001-12-25 06:00:24] [EMAIL PROTECTED]

What is your register_globals setting?

Derick



[2001-12-24 19:00:41] [EMAIL PROTECTED]

I got an array as a session var, then on one page I do

unset($basket);
$basket = array();
session_register("basket");

to empty the array but the array seems to be unaffected.

The exact same code works on 4.0.5.

4.1.0 setup:
'./configure' '--with-apxs=/usr/local/apache/bin/apxs' '--disable-debug' 
'--enable-track-vars' '--with-pgsql' '--with-gd=../gd-1.8.4' '--with-zlib=/usr' 
'--with-jpeg-dir=/usr' '--with-ttf' '--with-xslt' '--with-xslt-sablot'

--niklas 





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


-- 
PHP Development Mailing List 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP-DEV] Bug #14688 Updated: session_register() doesn't register

2001-12-25 Thread niklas-phpbugs

ID: 14688
User updated by: [EMAIL PROTECTED]
Reported By: [EMAIL PROTECTED]
Old Status: Feedback
Status: Open
Bug Type: Session related
Operating System: linux 2.2
PHP Version: 4.1.0
New Comment:

Both servers got register_globals = On.
On the 4.1.0 server i run with a php.ini that originates from the 4.0.5 release.

--niklas

Previous Comments:


[2001-12-25 06:00:24] [EMAIL PROTECTED]

What is your register_globals setting?

Derick



[2001-12-24 19:00:41] [EMAIL PROTECTED]

I got an array as a session var, then on one page I do

unset($basket);
$basket = array();
session_register("basket");

to empty the array but the array seems to be unaffected.

The exact same code works on 4.0.5.

4.1.0 setup:
'./configure' '--with-apxs=/usr/local/apache/bin/apxs' '--disable-debug' 
'--enable-track-vars' '--with-pgsql' '--with-gd=../gd-1.8.4' '--with-zlib=/usr' 
'--with-jpeg-dir=/usr' '--with-ttf' '--with-xslt' '--with-xslt-sablot'

--niklas 





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


-- 
PHP Development Mailing List 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP-DEV] Bug #14688: session_register() doesn't register

2001-12-24 Thread niklas-phpbugs

From: [EMAIL PROTECTED]
Operating system: linux 2.2
PHP version:  4.1.0
PHP Bug Type: Session related
Bug description:  session_register() doesn't register

I got an array as a session var, then on one page I do

unset($basket);
$basket = array();
session_register("basket");

to empty the array but the array seems to be unaffected.

The exact same code works on 4.0.5.

4.1.0 setup:
'./configure' '--with-apxs=/usr/local/apache/bin/apxs' '--disable-debug'
'--enable-track-vars' '--with-pgsql' '--with-gd=../gd-1.8.4'
'--with-zlib=/usr' '--with-jpeg-dir=/usr' '--with-ttf' '--with-xslt'
'--with-xslt-sablot'

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


-- 
PHP Development Mailing List 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP-DEV] Bug #14182: pclose() returns -1 if configured with --enable-sigchild, see #8992

2001-11-22 Thread phpbugs

From: [EMAIL PROTECTED]
Operating system: Debian Linux 2.2r4
PHP version:  4.0.6
PHP Bug Type: Filesystem function related
Bug description:  pclose() returns -1 if configured with --enable-sigchild, see #8992

Exactly the same behaviour as described in Bug #8992, but  with PHP4.0.6.
-- 
Edit bug report at: http://bugs.php.net/?id=14182&edit=1


-- 
PHP Development Mailing List 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP-DEV] Bug #13817: odbc_exec doesn't allow stored procedures to return results

2001-10-24 Thread phpbugs

From: [EMAIL PROTECTED]
Operating system: IIS4 on Win NT
PHP version:  4.0.6
PHP Bug Type: ODBC related
Bug description:  odbc_exec doesn't allow stored procedures to return results

This is probably the same bug that is mentioned in Bug id #5458. As a
result, the same proposed fix probably applies.

I'm attempting to retrieve values from MS SQL 7 via ODBC. The format for
calling stored procs via ODBC is: 

{? = CALL stored_proc_name(?, ?)}

The question marks are place holders for variable names. 

Bug 5458 suggests making a odbc_bindparameter function to allow values to
be returned properly.
-- 
Edit bug report at: http://bugs.php.net/?id=13817&edit=1


-- 
PHP Development Mailing List 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP-DEV] Bug #13553: $this isn't set in XML object handlers

2001-10-04 Thread phpbugs

From: [EMAIL PROTECTED]
Operating system: Mac OS X 10.1
PHP version:  4.0.6
PHP Bug Type: Reproducible crash
Bug description:  $this isn't set in XML object handlers

xml_set_object() allows you to use an xml parser inside a 
class and have it call class methods instead of global 
functions. $this is not set properly within the context of 
these handlers when called by the xml parser. This can 
cause data loss (e.g. $this->variable is set by one of the 
XML handlers and disappears after the parsing is finished) 
or, if you try to call certain functions on $this such as 
gettype() or classname() php will die with a bus error:

XMLParser = xml_parser_create();

xml_set_object($this->XMLParser, $this);
xml_parser_set_option($this->XMLParser, 
XML_OPTION_CASE_FOLDING, false);
xml_set_element_handler($this->XMLParser, 
"xmlStartElement", "xmlEndElement");
}

function parse() {
$xml = '
';  

if (!xml_parse($this->XMLParser, $xml, true)) {
die( sprintf("XML parse error: %s at line 
%d\n", 
xml_error_string(xml_get_error_code($this->XMLParser)), 
xml_get_current_line_number($this->XMLParser) )
);
}
xml_parser_free($this->XMLParser);
}

function xmlStartElement($parser, $name, $attribs) {
print "Opening $name - \$this = " . gettype($this) . "\
n";
}

function xmlEndElement($parser, $name) {
print "Closing $name - \$this = " . gettype($this) . "\
n";
}

}

$CrashMe = new ThisBug();
$CrashMe->parse();
?>


chris@calaban:~/Development/netdiff $ php -q ThisBug.php 
Opening foo - $this = object
Opening bar - $this = object
Closing bar - $this = object
Bus error

(uname -a = Darwin calaban.my.domain 1.4 Darwin Kernel 
Version 1.4: Sun Sep  9 15:39:59 PDT 2001; root:xnu/xnu-
201.obj~1/RELEASE_PPC  Power Macintosh powerpc)

IMPORTANT NOTE:
This appears to be identical to bug #12959, which was 
marked bogus with the mistaken comment "you are trying to 
use $this outside of a class so it does not work.", when 
$this was being used inside a class, as it is here. This is 
the entire point for having xml_set_object().


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


-- 
PHP Development Mailing List 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP-DEV] Bug #11590 Updated: Segmentation fault when using an empty string as an array

2001-06-20 Thread phpbugs

ID: 11590
User Update by: [EMAIL PROTECTED]
Status: Open
Bug Type: Reproducible crash
Operating system: Linux 2.4.3 i686
PHP Version: 4.0.5
Description: Segmentation fault when using an empty string as an array

- Linux 2.4.4 i686 / PHP 4.0.7-dev (21.05.01) / Apache
2.0.19-dev (21.05.01)  --  crashes too

- Linux 2.2.16-22 i686 / PHP 4.0.3pl1 / Apache 1.3.14  -- works

Previous Comments:
---

[2001-06-20 17:20:19] [EMAIL PROTECTED]
When i try this Script under FreeBSD 4.3-STABLE with PHP
4.0.5, and Apache 1.3.20 it run's without errors, or
segfaults...

---

[2001-06-20 17:13:37] [EMAIL PROTECTED]
Script:

parse($a);
}

function parse($string,$result="") {
for($i=0;$i<50;$i++) {
$result_[$i]["threadid"]=
$result[$i]["threadid"];
$result_[$i]["readcount"]   =
$result[$i]["readcount"];
}
return $result_;
}

}

class test2 {

function output() {
echo "hi";
$test = new test;
return $test->call();
}
}

$test2 = new test2;
print_r($test2->output());   
?>   

And Apache crashes with a Segfault:

Wed Jun 20 23:12:17 2001] [notice] child pid 28682 exit
signal Segmentation fault (11)
[Wed Jun 20 23:12:47 2001] [notice] child pid 28692 exit
signal Segmentation fault (11)


Greetings Olli


---

[2001-06-20 16:54:03] [EMAIL PROTECTED]
Please include a complete but short script into this report
which demonstrates this problem.
 

---

[2001-06-20 16:46:03] [EMAIL PROTECTED]
A Function in a class:

function mParseStatisticData ($ids,$result="" ) {

  // some stuff inside;

  $result_[$pos]["threadid"]= $result[$pos]["threadid"];M
  $result_[$pos]["readcount"]   = $result[$pos]["readcount"];M

}

I call these function with:

$result_ = $this->mParseStatisticData($a);

And the apache processes stops with a segmentation fault:
[Wed Jun 20 17:46:20 2001] [notice] child pid 28697 exit
signal Segmentation fault (11)

How to fix it:


function mParseStatisticData ($ids,$result=array() ) {


Ok, it's wrong to use a string as an array... my fault..
but.. why my apache (1.3.20) crashes with a segfault? ;-)

Greetings Olli

---


Full Bug description available at: http://bugs.php.net/?id=11590


-- 
PHP Development Mailing List 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP-DEV] Bug #11590 Updated: Segmentation fault when using an empty string as an array

2001-06-20 Thread phpbugs

ID: 11590
User Update by: [EMAIL PROTECTED]
Status: Open
Bug Type: Reproducible crash
Operating system: Linux 2.4.3 i686
PHP Version: 4.0.5
Description: Segmentation fault when using an empty string as an array

When i try this Script under FreeBSD 4.3-STABLE with PHP
4.0.5, and Apache 1.3.20 it run's without errors, or
segfaults...

Previous Comments:
---

[2001-06-20 17:13:37] [EMAIL PROTECTED]
Script:

parse($a);
}

function parse($string,$result="") {
for($i=0;$i<50;$i++) {
$result_[$i]["threadid"]=
$result[$i]["threadid"];
$result_[$i]["readcount"]   =
$result[$i]["readcount"];
}
return $result_;
}

}

class test2 {

function output() {
echo "hi";
$test = new test;
return $test->call();
}
}

$test2 = new test2;
print_r($test2->output());   
?>   

And Apache crashes with a Segfault:

Wed Jun 20 23:12:17 2001] [notice] child pid 28682 exit
signal Segmentation fault (11)
[Wed Jun 20 23:12:47 2001] [notice] child pid 28692 exit
signal Segmentation fault (11)


Greetings Olli


---

[2001-06-20 16:54:03] [EMAIL PROTECTED]
Please include a complete but short script into this report
which demonstrates this problem.
 

---

[2001-06-20 16:46:03] [EMAIL PROTECTED]
A Function in a class:

function mParseStatisticData ($ids,$result="" ) {

  // some stuff inside;

  $result_[$pos]["threadid"]= $result[$pos]["threadid"];M
  $result_[$pos]["readcount"]   = $result[$pos]["readcount"];M

}

I call these function with:

$result_ = $this->mParseStatisticData($a);

And the apache processes stops with a segmentation fault:
[Wed Jun 20 17:46:20 2001] [notice] child pid 28697 exit
signal Segmentation fault (11)

How to fix it:


function mParseStatisticData ($ids,$result=array() ) {


Ok, it's wrong to use a string as an array... my fault..
but.. why my apache (1.3.20) crashes with a segfault? ;-)

Greetings Olli

---


Full Bug description available at: http://bugs.php.net/?id=11590


-- 
PHP Development Mailing List 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP-DEV] Bug #11590 Updated: Segmentation fault when using an empty string as an array

2001-06-20 Thread phpbugs

ID: 11590
User Update by: [EMAIL PROTECTED]
Old-Status: Feedback
Status: Open
Bug Type: Reproducible crash
Operating system: Linux 2.4.3 i686
PHP Version: 4.0.5
Description: Segmentation fault when using an empty string as an array

Script:

parse($a);
}

function parse($string,$result="") {
for($i=0;$i<50;$i++) {
$result_[$i]["threadid"]=
$result[$i]["threadid"];
$result_[$i]["readcount"]   =
$result[$i]["readcount"];
}
return $result_;
}

}

class test2 {

function output() {
echo "hi";
$test = new test;
return $test->call();
}
}

$test2 = new test2;
print_r($test2->output());   
?>   

And Apache crashes with a Segfault:

Wed Jun 20 23:12:17 2001] [notice] child pid 28682 exit
signal Segmentation fault (11)
[Wed Jun 20 23:12:47 2001] [notice] child pid 28692 exit
signal Segmentation fault (11)


Greetings Olli


Previous Comments:
---

[2001-06-20 16:54:03] [EMAIL PROTECTED]
Please include a complete but short script into this report
which demonstrates this problem.
 

---

[2001-06-20 16:46:03] [EMAIL PROTECTED]
A Function in a class:

function mParseStatisticData ($ids,$result="" ) {

  // some stuff inside;

  $result_[$pos]["threadid"]= $result[$pos]["threadid"];M
  $result_[$pos]["readcount"]   = $result[$pos]["readcount"];M

}

I call these function with:

$result_ = $this->mParseStatisticData($a);

And the apache processes stops with a segmentation fault:
[Wed Jun 20 17:46:20 2001] [notice] child pid 28697 exit
signal Segmentation fault (11)

How to fix it:


function mParseStatisticData ($ids,$result=array() ) {


Ok, it's wrong to use a string as an array... my fault..
but.. why my apache (1.3.20) crashes with a segfault? ;-)

Greetings Olli

---


Full Bug description available at: http://bugs.php.net/?id=11590


-- 
PHP Development Mailing List 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP-DEV] Bug #11590: Segmentation fault when using an empty string as an array

2001-06-20 Thread phpbugs

From: [EMAIL PROTECTED]
Operating system: Linux 2.4.3 i686
PHP version:  4.0.5
PHP Bug Type: Reproducible crash
Bug description:  Segmentation fault when using an empty string as an array

A Function in a class:

function mParseStatisticData ($ids,$result="" ) {

  // some stuff inside;

  $result_[$pos]["threadid"]= $result[$pos]["threadid"];M
  $result_[$pos]["readcount"]   = $result[$pos]["readcount"];M

}

I call these function with:

$result_ = $this->mParseStatisticData($a);

And the apache processes stops with a segmentation fault:
[Wed Jun 20 17:46:20 2001] [notice] child pid 28697 exit
signal Segmentation fault (11)

How to fix it:


function mParseStatisticData ($ids,$result=array() ) {


Ok, it's wrong to use a string as an array... my fault..
but.. why my apache (1.3.20) crashes with a segfault? ;-)

Greetings Olli


-- 
Edit Bug report at: http://bugs.php.net/?id=11590&edit=1



-- 
PHP Development Mailing List 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP-DEV] Bug #10858: DOS line termination causes PHP to misparse data

2001-05-14 Thread phpbugs

From: [EMAIL PROTECTED]
Operating system: Linux gigante 2.2.19 #1 Thu Apr 19 22:35:28 EST 2001 i686
PHP version:  4.0.5
PHP Bug Type: Scripting Engine problem
Bug description:  DOS line termination causes PHP to misparse data

Compare 
http://gigante.improbable.org/php/line-term/dos.php and 
http://gigante.improbable.org/php/line-term/dos.phps. 
Comments using the C++ style // syntax are sent to the 
browser as output. heredocs which have a ^M will return 
parse errors.

http://gigante.improbable.org/php/line-term/unix.php and 
http://gigante.improbable.org/php/line-term/unix.phps show 
that all works as expected when using Unix line 
termination.




-- 
Edit Bug report at: http://bugs.php.net/?id=10858&edit=1



-- 
PHP Development Mailing List 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]