[PHP-DEV] Bug #15079 Updated: Wrong function socket_recv

2002-01-17 Thread mfischer

ID: 15079
Updated by: mfischer
Reported By: [EMAIL PROTECTED]
Old Status: Open
Status: Closed
Bug Type: Sockets related
Operating System: FreeBSD 4.3-RELEASE
PHP Version: 4.1.1
New Comment:

Unfortunately a bug slipped it and it is fixed in CVS already. But you
can easily fix it yourself by changing line 1300 in sockets.c from

  if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rr", &arg1,
&len, &flags) == FAILURE)

to
  if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rll", &arg1,
&len, &flags) == FAILURE)


Previous Comments:


[2002-01-17 02:54:37] [EMAIL PROTECTED]

Code: $buf=socket_recv($d->descriptor, 1024, $flags);
Warning:  socket_recv() expects exactly 2 parameters, 3 given in ...

Code: $buf=socket_recv($d->descriptor, 1024);
Warning:  socket_recv() expects parameter 2 to be resource, integer
given in ...

Help for socket_recv: mixed socket_recv (resource socket, int len, int
flags);







Edit this bug report at http://bugs.php.net/?id=15079&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 #15079 Updated: Wrong function socket_recv

2002-01-17 Thread mfischer

ID: 15079
Updated by: mfischer
Reported By: [EMAIL PROTECTED]
Status: Closed
Bug Type: Sockets related
Operating System: FreeBSD 4.3-RELEASE
PHP Version: 4.1.1
New Comment:

The file is in php-4.1.1/ext/sockets/ .


Previous Comments:


[2002-01-17 03:28:02] [EMAIL PROTECTED]

Unfortunately a bug slipped it and it is fixed in CVS already. But you
can easily fix it yourself by changing line 1300 in sockets.c from

  if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rr", &arg1,
&len, &flags) == FAILURE)

to
  if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rll", &arg1,
&len, &flags) == FAILURE)



[2002-01-17 02:54:37] [EMAIL PROTECTED]

Code: $buf=socket_recv($d->descriptor, 1024, $flags);
Warning:  socket_recv() expects exactly 2 parameters, 3 given in ...

Code: $buf=socket_recv($d->descriptor, 1024);
Warning:  socket_recv() expects parameter 2 to be resource, integer
given in ...

Help for socket_recv: mixed socket_recv (resource socket, int len, int
flags);







Edit this bug report at http://bugs.php.net/?id=15079&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 #12211 Updated: cURL (OpenSSL) https:// calls do not function

2002-01-17 Thread johan

ID: 12211
Comment by: [EMAIL PROTECTED]
Old Reported By: [EMAIL PROTECTED]
Reported By: [EMAIL PROTECTED]
Status: Closed
Bug Type: cURL related
Operating System: Mandrake/Slackware
PHP Version: 4.0.6
New Comment:

I installed the cgi version of php4 (4.1.1) which has curl with ssl
support as well. I'm getting the same error, so it doesn't seem to be
fixed in new version (or even, every version).
Can someone have a look please? :/


Previous Comments:


[2001-07-30 18:18:32] [EMAIL PROTECTED]

Can you try the latest CVS of PHP and let re-open the bug 
if it still happens.




[2001-07-17 12:36:22] [EMAIL PROTECTED]

In php4.0.5 cURL w/OpenSSL is fully functional without
problems; although, in php4.0.6, When cURL w/OpenSSL is
installed it all works but not with https:// calls.


-- Errors --
When you use curl_error():
   SSL: Couldn't create a context!

When you use curl_errno():
   27
 Which points explains it as an out of memory error

Although through bash & perl curl works fine with the SSL
pages.  This error has been reported on a variety of sites 
related to cURL but the question have never been responded
to accurately.





Edit this bug report at http://bugs.php.net/?id=12211&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 #15080: Error in the php.net site

2002-01-17 Thread dakota

From: [EMAIL PROTECTED]
Operating system: N/A
PHP version:  4.1.1
PHP Bug Type: Unknown/Other Function
Bug description:  Error in the php.net site

While opening the following URL:
http://bg.php.net/manual-lookup.php?pattern=extension

Warning: Call-time pass-by-reference has been deprecated - argument passed
by value; If you would like to pass it by reference, modify the
declaration of similar_text(). If you would like to enable call-time
pass-by-reference, you can set allow_call_time_pass_reference to true in
your INI file. However, future versions may not support this any longer.
in /storage/mirrors/php/quickref.php on line 41

-- 
Edit bug report at: http://bugs.php.net/?id=15080&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 #12941 Updated: &PHPSESSID appended to links causes invalud html.

2002-01-17 Thread barends

ID: 12941
Comment by: [EMAIL PROTECTED]
Old Reported By: [EMAIL PROTECTED]
Reported By: [EMAIL PROTECTED]
Status: Bogus
Bug Type: Session related
Operating System: Windows 2000 Adv Server
PHP Version: 4.0.5
New Comment:

I have the same problem with 4.0.6 (on apache and Linux).
I did add the:

arg_separator.output = "&"

rule to php.ini, but it still uses & instead of & :(


Previous Comments:


[2001-08-25 07:44:58] [EMAIL PROTECTED]

Well, are you sure the php.ini file is even used by PHP?
ie. is it on the right directory?
This does work. At least on PHP 4.0.6 which you should
be using too..




[2001-08-24 22:01:38] [EMAIL PROTECTED]

I tried doing that, but it does the same thing still.

Copied out of c:\winnt\php.ini:
arg_separator.output = "&"



[2001-08-24 06:02:48] [EMAIL PROTECTED]

Use this php.ini directive:

arg_separator.output = "&"





[2001-08-24 04:43:17] [EMAIL PROTECTED]

URI: http://loopy.2y.net/main.php 
Server: Microsoft-IIS/5.0 
Character encoding: unknown 
Document type: HTML 4.01 Transitional 
Below are the results of attempting to parse this document with an SGML
parser. 

Line 24, column 154: 
  ... >*http://bugs.php.net/?id=12941&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]




Re: [PHP-DEV] shmop errors

2002-01-17 Thread Robin Ericsson

On Thu, 2002-01-17 at 08:33, Robin Ericsson wrote:
> On Wed, 2002-01-16 at 21:19, Ilia A. wrote:
> > I've tested your code on 4.1.1 release with the recent SHMOP patch that is 
> > already part of the latest CVS. The code worked fine and did not generate any 
> > warning or errors.
> > 
> > I did however commented out the sem_* functions.
> > 
> 
> That's funny, I've just downloaded php from cvs today (08.00 CET) and
> this script:
> 

[snip]

> 
> generates the following error:
> Unknown(0) : Warning - String is not zero-terminated (0) (source:
> zend_execute_API.c:274)
> 

Using this fix, it works for me, but I don't know if this is the right
way to go..

diff -u -u -r1.21 shmop.c
--- shmop.c 9 Jan 2002 08:02:21 -   1.21
+++ shmop.c 17 Jan 2002 10:11:02 -
@@ -242,8 +242,9 @@
startaddr = shmop->addr + (*start)->value.lval;
bytes = (*count)->value.lval ? (*count)->value.lval :
shmop->size-(*start)->value.lval;
 
-   return_string = emalloc(bytes);
+   return_string = emalloc(bytes+1);
memcpy(return_string, startaddr, bytes);
+   return_string[bytes] = '\0';
 
RETURN_STRINGL(return_string, bytes, 0);
 }





-- 
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]




Re: [PHP-DEV] shmop errors

2002-01-17 Thread derick

Hello,

I think this is the only possible way to do it... (without rewriting the
whole extension).

Derick

On 17 Jan 2002, Robin Ericsson wrote:

> Using this fix, it works for me, but I don't know if this is the right
> way to go..
>
> diff -u -u -r1.21 shmop.c
> --- shmop.c   9 Jan 2002 08:02:21 -   1.21
> +++ shmop.c   17 Jan 2002 10:11:02 -
> @@ -242,8 +242,9 @@
>   startaddr = shmop->addr + (*start)->value.lval;
>   bytes = (*count)->value.lval ? (*count)->value.lval :
> shmop->size-(*start)->value.lval;
>
> - return_string = emalloc(bytes);
> + return_string = emalloc(bytes+1);
>   memcpy(return_string, startaddr, bytes);
> + return_string[bytes] = '\0';
>
>   RETURN_STRINGL(return_string, bytes, 0);
>  }
>
>
>
>
>
> --
> 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 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 #12211 Updated: cURL (OpenSSL) https:// calls do not function

2002-01-17 Thread me

ID: 12211
Comment by: [EMAIL PROTECTED]
Old Reported By: [EMAIL PROTECTED]
Reported By: [EMAIL PROTECTED]
Status: Closed
Bug Type: cURL related
Operating System: Mandrake/Slackware
PHP Version: 4.0.6
New Comment:

Compile PHP without OpenSSL support and CURL https:// calls should work
just fine. Seems like there's some unsolved conflicts between OpenSSL
and CURL/SSL support.


Previous Comments:


[2002-01-17 04:27:30] [EMAIL PROTECTED]

I installed the cgi version of php4 (4.1.1) which has curl with ssl
support as well. I'm getting the same error, so it doesn't seem to be
fixed in new version (or even, every version).
Can someone have a look please? :/



[2001-07-30 18:18:32] [EMAIL PROTECTED]

Can you try the latest CVS of PHP and let re-open the bug 
if it still happens.




[2001-07-17 12:36:22] [EMAIL PROTECTED]

In php4.0.5 cURL w/OpenSSL is fully functional without
problems; although, in php4.0.6, When cURL w/OpenSSL is
installed it all works but not with https:// calls.


-- Errors --
When you use curl_error():
   SSL: Couldn't create a context!

When you use curl_errno():
   27
 Which points explains it as an out of memory error

Although through bash & perl curl works fine with the SSL
pages.  This error has been reported on a variety of sites 
related to cURL but the question have never been responded
to accurately.





Edit this bug report at http://bugs.php.net/?id=12211&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 #14897 Updated: "unable to fork" - cause & solution (well, at least for me)

2002-01-17 Thread davidfelton

ID: 14897
Comment by: [EMAIL PROTECTED]
Old Reported By: [EMAIL PROTECTED]
Reported By: [EMAIL PROTECTED]
Status: Open
Bug Type: Program Execution
Operating System: Windows 2000
PHP Version: 4.1.1
New Comment:

clarification: is this a suggestion of a way to fix the problem myself
(so I can call programs), or a suggestion to the developers?


Previous Comments:


[2002-01-06 22:00:12] [EMAIL PROTECTED]

in 4.0.6, popen() would just call CreateProcess() with the specified
command.

this was ok.

in 4.1.0 popen() now prepends "cmd.exe /c " (or "command.com /c " on
win9x).

the problem with this, is that many web admins will disable access for
the web apps to access cmd.exe (eg, MS's IISLockDown does this), and
hence even though the web app may have access to c:\utils\myapp.exe, a
command like exec("c:\utils\myapp.exe") now fails on 4.1.0 but works on
on 4.0.6.

also, the hardcoding of cmd.exe should not be done.  it should get it
from the enviroment.

summary:

have commands that prepend the result of an enviroment lookup on
"%comspec% /c " to the front of a command

AND

have commands that dont, so that I can call exec("c:\utils\myapp.exe");
 without having to enable access to cmd.exe

OR

any interpretation of these issues, that allow for a sensible amount of
flexibilty.

Louis Solomon
www.SteelBytes.com







Edit this bug report at http://bugs.php.net/?id=14897&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 #12691 Updated: Apache 2: Server variables don't get set

2002-01-17 Thread lobbin

ID: 12691
Updated by: lobbin
Old Summary: Apache 2: Server variables don't get set
Reported By: [EMAIL PROTECTED]
Status: Open
Bug Type: Apache2 related
Operating System: SuSE7.1
Old PHP Version: 4.0CVS-2001-08-10
PHP Version: 4.1.1


Previous Comments:


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

ok, here's what I tried:

o PHP4.0.2-dev (php4-2009 from snaps)
o config line is:
'./configure' '--with-apxs2=/usr/local/apache2/bin/apxs' '--with-mysql'
'--with-dom' '--disable-posix' '--disable-pic' '--with-zlib'
'--enable-wddx'

o Apache2.0.28-beta
o config line is:
CFLAGS="-g"; export CFLAGS
"./configure" \
"--enable-layout=Apache" \
"--enable-auth-digest" \
"--enable-ext-filter" \
"--disable-include" \
"--enable-headers" \
"--enable-so" \
"--enable-ssl=shared" \
"--with-mpm=threaded" \
"--enable-http" \
"--enable-dav=shared" \
"--disable-asis" \
"--enable-info=shared" \
"--enable-suexec" \
"--enable-cgi=shared" \
"--enable-cgid=shared" \
"--enable-dav-fs=shared" \
"--enable-vhost-alias=shared" \
"--disable-imap" \
"--enable-rewrite=shared" \
"--with-suexec-uidmin=30" \
"--with-suexec-gidmin=65534" 

Now env vars are set ok (either with or without seting I/O filters,
just with an AddType), *BUT* :) I still found that one very important
one is missing, namely PATH_INFO.

If I say http://teo.gecadsoftware.com/i.php/x it gives a file not found
error (where i.php exists and contains a phpinfo() call).

I tried to catch that with FilesMatch, but couldn't figure (I think the
test for $DOCUMENT_ROOT/i.php/x to exist is done before applying
matches, which makes sense).

I am having a look into it but my experience with Apache2 is  less that
epsilon :) so maybe somebody can have a look too?



[2001-11-17 12:10:10] [EMAIL PROTECTED]

There has been a patch regarding this three days ago. Please try the
latest snapshot from http://snaps.php.net/ and report, if the problem
still comes up.



[2001-11-03 21:53:17] [EMAIL PROTECTED]

updated short desc.




[2001-08-10 11:08:15] [EMAIL PROTECTED]

hi alindeman,

erm, you missed the essential "2" :)
it's with Apache2 (apxs2)

Additional note:
 printenv from /cgi-bin shows them just right.




[2001-08-10 10:49:39] [EMAIL PROTECTED]

works fine for me (Apache 1.3.20 + PHP Latest CVS).

Try running  and see what variables are defined..



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/?id=12691


Edit this bug report at http://bugs.php.net/?id=12691&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 #14143 Updated: Segmentation fun

2002-01-17 Thread lobbin

ID: 14143
Updated by: lobbin
Reported By: [EMAIL PROTECTED]
Old Status: Open
Status: Feedback
Bug Type: Apache2 related
Operating System: SuSE7.1
PHP Version: 4.0CVS-2001-11-20
New Comment:

Does the same happen on 4.1.1 or current CVS?


Previous Comments:


[2001-11-20 06:49:34] [EMAIL PROTECTED]

related to #12691

Configuration: same as in #12691 except Apache is using prefork mpm.

The request: GET /i.php/a

Backtrace and request info are:

Program received signal SIGSEGV, Segmentation fault.
0x4004bb1e in apr_palloc (a=0x813e4cc, reqsize=10) at apr_pools.c:1214
1214first_avail = blok->h.first_avail;
(gdb) bt
#0  0x4004bb1e in apr_palloc (a=0x813e4cc, reqsize=10) at
apr_pools.c:1214
#1  0x80910d8 in add_any_filter (name=0x80aac34 "BYTERANGE", ctx=0x0,
r=0x813e51c, c=0x813a5cc, reg_filter_set=0x80ca19c,
r_filters=0x813e688,
c_filters=0x813a610) at util_filter.c:151
#2  0x809131f in ap_add_output_filter (name=0x80aac34 "BYTERANGE",
ctx=0x0,
r=0x813e51c, c=0x813a5cc) at util_filter.c:201
#3  0x8069f67 in ap_http_insert_filter (r=0x813e51c) at
http_core.c:310
#4  0x809ca63 in ap_run_insert_filter (r=0x813e51c) at request.c:120
#5  0x809d23d in ap_process_request_internal (r=0x813e51c) at
request.c:279
#6  0x806f779 in ap_process_request (r=0x813e51c) at
http_request.c:284
#7  0x8069e96 in ap_process_http_connection (c=0x813a5cc) at
http_core.c:289
#8  0x808f2f7 in ap_run_process_connection (c=0x813a5cc) at
connection.c:82
#9  0x808f58d in ap_process_connection (c=0x813a5cc) at
connection.c:219
#10 0x80804bc in child_main (child_num_arg=0) at prefork.c:803
#11 0x80805b3 in make_child (s=0x80cae44, slot=0) at prefork.c:839
#12 0x8080725 in startup_children (number_to_start=1) at prefork.c:913
#13 0x8080c45 in ap_mpm_run (_pconf=0x80c9cec, plog=0x80fde8c,
s=0x80cae44)
at prefork.c:1129
#14 0x8087ce6 in main (argc=2, argv=0xb674) at main.c:432


(gdb) f 3
#3  0x8069f67 in ap_http_insert_filter (r=0x813e51c) at
http_core.c:310
310 ap_add_output_filter("BYTERANGE", NULL, r,
r->connection);
(gdb) p *r
$8 = {pool = 0x813e4ec, connection = 0x813a5cc, server = 0x80cae44,
  next = 0x0, prev = 0x0, main = 0x0,
  the_request = 0x813ecac "GET /i.php/a HTTP/1.1", assbackwards = 0,
  proxyreq = 0, header_only = 0, protocol = 0x813ecfc "HTTP/1.1",
  proto_num = 1001, hostname = 0x813ef6c "teo",
  request_time = 1006255730034262, status_line = 0x0, status = 200,
  method = 0x813ecc4 "GET", method_number = 0, allowed = 0,
  allowed_xmethods = 0x0, allowed_methods = 0x813e694, sent_bodyct =
0,
  bytes_sent = 0, mtime = 0, chunked = 0, boundary = 0x0, range = 0x0,
  clength = 0, remaining = 0, read_length = 0, read_body = 0, 
read_chunked = 0, expecting_100 = 0, headers_in = 0x813e6c4,
  headers_out = 0x813ea14, err_headers_out = 0x813ea8c,
  subprocess_env = 0x813e86c, notes = 0x813eacc,
  content_type = 0x813f604 "application/x-httpd-php", handler = 0x0,
  content_encoding = 0x0, content_languages = 0x0, vlist_validator =
0x0,
  user = 0x0, ap_auth_type = 0x0, no_cache = 0, no_local_copy = 0,
  unparsed_uri = 0x813ecdc "/i.php/a", uri = 0x813ecec "/i.php/a",
  filename = 0x813f1d4 "/usr/local/apache2/htdocs/i.php",
  canonical_filename = 0x813f0e4 "/usr/local/apache2/htdocs/i.php/a",
  path_info = 0x813f133 "/a", args = 0x0, finfo = {cntxt = 0x813e4ec,
valid = 7598448, protection = 1604, filetype = APR_REG, user = 0,
group = 0, inode = 314593, device = 773, nlink = 1, size = 17,
csize = 24,
atime = 100625296900, mtime = 99740411000,
ctime = 99740411000,
fname = 0x813f1d4 "/usr/local/apache2/htdocs/i.php",
name = 0x80c23cc "O,\f\b", filehand = 0x13f0e4}, parsed_uri = {
scheme = 0x0, hostinfo = 0x0, user = 0x0, password = 0x0, hostname
= 0x0,
port_str = 0x0, path = 0x813ecec "/i.php/a", query = 0x0, fragment
= 0x0,
hostent = 0x0, port = 0, is_initialized = 1, dns_looked_up = 0,
dns_resolved = 0}, per_dir_config = 0x813f474, request_config =
0x813eb0c,
  htaccess = 0x0, output_filters = 0x813f62c, input_filters =
0x813f654,
  eos_sent = 0}












Edit this bug report at http://bugs.php.net/?id=14143&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 #7045 Updated: Shuffle() does not behave correctly

2002-01-17 Thread lobbin

ID: 7045
Updated by: lobbin
Reported By: [EMAIL PROTECTED]
Status: Open
Bug Type: Arrays related
Operating System: Linux RH 6 and 7
PHP Version: 4.1.0
Assigned To: rodif_bl
New Comment:

Can someone check/commit this? :)


Previous Comments:


[2002-01-12 20:45:00] [EMAIL PROTECTED]

here is a patch that fixes the
shuffle and adds ashuffle.

Im pretty new to this list and if someone could tell me 
if i can/should apply this to cvs?


--- ext/standard/array.c.oldSat Jan 12 04:23:55 2002
+++ ext/standard/array.cSat Jan 12 10:03:17 2002
@@ -1415,13 +1415,72 @@
 }
 /* }}} */
 
-
-static int array_data_shuffle(const void *a, const void *b TSRMLS_DC)

+static int php_rand_sort(void *base, size_t nmemb, size_t size, int
(*cmp)(const void *, const void *))
 {
-   return (php_rand(TSRMLS_C) % 2) ? 1 : -1;
+Bucket *t, **new_order;
+HashTable *ht;
+int i, j;
+ulong num_key;
+char *string_key;
+
+int status, *tmp;
+
+new_order = emalloc(sizeof(Bucket *) * nmemb);
+
+ALLOC_HASHTABLE(ht);
+zend_hash_init(ht, 0, NULL, ZVAL_PTR_DTOR, 0);
+
+for(i = 0;i < nmemb;i++)
+{
+zval *z_rand;
+MAKE_STD_ZVAL(z_rand);
+ZVAL_LONG(z_rand,rand());
+
+t = *(((Bucket **)base) + i);
+if(t->nKeyLength == 0)
+status = zend_hash_index_update(ht, t->h, &z_rand,
sizeof(zval *), NULL);
+else
+status = zend_hash_update(ht, t->arKey, t->nKeyLength,
&z_rand, sizeof(zval *), NULL);
+}
+
+set_compare_func(SORT_NUMERIC TSRMLS_CC);
+zend_hash_sort(ht, qsort, array_data_compare, 0);
+
+zend_hash_internal_pointer_reset(ht);
+for(i = 0;i < nmemb;i++)
+{
+switch(zend_hash_get_current_key(ht, &string_key,
&num_key, 1))
+{
+case HASH_KEY_IS_STRING:
+for(j = 0;j < nmemb;j++)
+{
+t = *(((Bucket **)base) + j);
+   
if(!strncmp(t->arKey,string_key,t->nKeyLength))
+{
+new_order[i] = *(((Bucket **)base) + j);
+break;
+}
+}
+break;
+case HASH_KEY_IS_LONG:
+for(j = 0;j < nmemb;j++)
+{
+t = *(((Bucket **)base) + j);
+if(t->h == num_key)
+{
+new_order[i] = *(((Bucket **)base) + j);
+break;
+}
+}
+break;
+}
+zend_hash_move_forward(ht);
+}
+memcpy(base, new_order, size * nmemb);
+zend_hash_destroy(ht);
+efree(new_order);
 }
 
-
 /* {{{ proto bool shuffle(array array_arg)
Randomly shuffle the contents of an array */
 PHP_FUNCTION(shuffle)
@@ -1431,7 +1490,23 @@
if (zend_parse_parameters(1 TSRMLS_CC, "a", &array) == FAILURE) {
RETURN_FALSE;
}
-   if (zend_hash_sort(Z_ARRVAL_PP(&array), (sort_func_t)php_mergesort,
array_data_shuffle, 1 TSRMLS_CC) == FAILURE) {
+   if (zend_hash_sort(Z_ARRVAL_PP(&array), (sort_func_t)php_rand_sort,
NULL, 1 TSRMLS_CC) == FAILURE) {
+   RETURN_FALSE;
+   }
+   RETURN_TRUE;
+}
+/* }}} */
+
+/* {{{ proto bool ashuffle(array array_arg)
+   Randomly shuffle the contents of an array keeping keys intact*/
+PHP_FUNCTION(ashuffle)
+{
+   zval *array;
+
+   if (zend_parse_parameters(1 TSRMLS_CC, "a", &array) == FAILURE) {
+   RETURN_FALSE;
+   }
+   if (zend_hash_sort(Z_ARRVAL_PP(&array), (sort_func_t)php_rand_sort,
NULL, 0 TSRMLS_CC) == FAILURE) {
RETURN_FALSE;
}
RETURN_TRUE;
@@ -2880,7 +2955,7 @@
}  
 
if (num_req_val == num_avail) {
-   if (zend_hash_sort(Z_ARRVAL_P(return_value),
(sort_func_t)php_mergesort, array_data_shuffle, 1 TSRMLS_CC) ==
FAILURE) {
+   if (zend_hash_sort(Z_ARRVAL_P(return_value),
(sort_func_t)php_rand_sort, NULL, 1 TSRMLS_CC) == FAILURE) {
zval_dtor(return_value);
RETURN_FALSE;
}



--- ext/standard/php_array.h.oldSat Jan 12 10:11:26 2002
+++ ext/standard/php_array.hSat Jan 12 10:11:40 2002
@@ -55,6 +55,7 @@
 PHP_FUNCTION(array_fill);
 PHP_FUNCTION(range);
 PHP_FUNCTION(shuffle);
+PHP_FUNCTION(ashuffle);
 PHP_FUNCTION(array_multisort);
 PHP_FUNCTION(array_push);
 PHP_FUNCTION(array_pop);


--- ext/standard/basic_functions.c.old  Sat Jan 12 10:10:36 2002
+++ ext/standard/basic_f

[PHP-DEV] Bug #14160 Updated: associative arrays - cannot use exclamation mark in key!

2002-01-17 Thread lobbin

ID: 14160
Updated by: lobbin
Reported By: [EMAIL PROTECTED]
Status: Open
Bug Type: Arrays related
Operating System: Windows 2000
PHP Version: 4.0.6
New Comment:

Works for me in CVS, can someone still reproduce this on windows?


Previous Comments:


[2001-11-21 10:46:19] [EMAIL PROTECTED]

Sorry, I am working to a strict (and rapidly approaching) deadline on
this website and cannot afford to be installing new versions of PHP on
the server. If the machine was in my office or my personal machine it
would be fine but I'm sorry fellas!
I have found a workaround for the moment (leaving the exclamation mark
out) and I am happy with that for the moment.



[2001-11-21 10:38:12] [EMAIL PROTECTED]

Mixep up name, sorry :)

You can test RC please

http://phpuk.org/~james/php-4.1.0RC3-win32.zip



[2001-11-21 10:32:56] [EMAIL PROTECTED]

Maybe it is a windows thingie, specifically windows 2000, I don't have
the same problem with 4.0.4pl1 and IIS4. If it helps, I'm using the PHP
Installer version of 4.0.6 (CGI)



[2001-11-21 10:32:22] [EMAIL PROTECTED]

Maybe it is a windows thingie, specifically windows 2000, I don't have
the same problem with 4.0.4pl1 and IIS4. If it helps, I'm using the PHP
Installer version of 4.0.6 (CGI)



[2001-11-21 10:31:09] [EMAIL PROTECTED]

Can't reproduce this under win32 (but only have some 4.0.8-dev).

Lets wait what he reports back with RC



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/?id=14160


Edit this bug report at http://bugs.php.net/?id=14160&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 #15081: Cannot load /usr/lib/libphp4.so into server : /usr/lib/apache/libphp4.so

2002-01-17 Thread ds

From: [EMAIL PROTECTED]
Operating system: redhat 7.2
PHP version:  4.1.0
PHP Bug Type: *Compile Issues
Bug description:  Cannot load /usr/lib/libphp4.so into server : 
/usr/lib/apache/libphp4.so

Sorry having the some problem 
this is the error I get when trying to start apache

Cannot load /usr/lib/libphp4.so into server : /usr/lib/apache/libphp4.so
: undefined symbol : ap_block_alarms


I Have try running 
./configure --help | grep apxs2
This is what I get from this command 
-with-apxs2[=FILE] Build shared Apache 2.0 module. FILE is the
optional

Thankyou for your help

secco

-- 
Edit bug report at: http://bugs.php.net/?id=15081&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 #14940 Updated: FastCGI SAPI prefork a number of processes

2002-01-17 Thread joosters

ID: 14940
Updated by: joosters
Reported By: [EMAIL PROTECTED]
Status: Open
Bug Type: Dynamic loading
Operating System: Debian (Potato)
PHP Version: 4.1.1
New Comment:

Where are you setting the environment variable?
Are you setting it before starting Apache?
Are you using Apache to start php-fcgi, or is it
running separately?


Previous Comments:


[2002-01-08 21:07:57] [EMAIL PROTECTED]

php 4.1.1
fastcgi-dev 2.2.2
mod_fastcgi 2.2.12
Apache 1.3.20
Debian Potato


Problem:  
PHP_FCGI_CHILDREN environment variable does not seem to be read by
php4.fcgi, resulting in 8 children being pre-forked every time the
server is started (the default setting).





Edit this bug report at http://bugs.php.net/?id=14940&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 #15082: too slow

2002-01-17 Thread a . marahovsky

From: [EMAIL PROTECTED]
Operating system: Linux Mandrake 7.2
PHP version:  4.0.6
PHP Bug Type: Performance problem
Bug description:  too slow

if php script running in unix shell it works TOO slowly
under web server or NT command line works fine.

problem line is ereg_replace
this command process <20 text lines under unix shell (with 30 sec
timeout)
if >20 lines - execution timeout erorr
if >50 lines - unix error "fragmentation fault"
but under web server or NT console it process >1000 text lines per half
second!
-- 
Edit bug report at: http://bugs.php.net/?id=15082&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] API TSRM

2002-01-17 Thread vincent . jaulin

I would like to use TSRM, 
but I find neither examples nor API.

Where can I find some examples?

thanks.

-- 
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 #15083: Big bug with mssql_fetch_xxxx methods

2002-01-17 Thread mi

From: [EMAIL PROTECTED]
Operating system: Windows 2000 Pro
PHP version:  4.1.1
PHP Bug Type: MSSQL related
Bug description:  Big bug with mssql_fetch_ methods

On PHP 4.0.6 on Windows 2000 Pro
 
I use the php_mssql.dll extension to access mssql server 7.0 and all the
method works very well.
(hum!! only the problem with ntext type but with CAST(yourfieldname AS
text) on the SQL query, that disappears)


After updating to PHP 4.1.1 on Windows 2000 Pro

The same code crashes Apache and Windows displays a dialog box with :  

Apache.exe
The instruction at "0x006db197" referenced memory at "0x043bcc3a".
The memory could not be "written".

I have search for a long time in the SQL query but in reality the problem
is not there...

The problem depends of the type returned by the query. 
All the numerical types work fine but all the string types like char,
nchar, text, ... result in crashes.

This problem appears only when you try to read the result with
mssql_fetch_ methods...


My configuration :
Windows 2000 Pro
MSSQL SERVER 7.0
APACHE 1.3.20
PHP 4.1.1 (same problem with PHP 4.1.0)
-- 
Edit bug report at: http://bugs.php.net/?id=15083&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 #15083 Updated: Big bug with mssql_fetch_xxxx methods

2002-01-17 Thread mi

ID: 15083
User updated by: [EMAIL PROTECTED]
Reported By: [EMAIL PROTECTED]
Status: Open
Bug Type: MSSQL related
Operating System: Windows 2000 Pro
PHP Version: 4.1.1


Edit this bug report at http://bugs.php.net/?id=15083&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 #14797 Updated: include (_path) in Apache SAPI and CGI on Win98SE does not work

2002-01-17 Thread m

ID: 14797
User updated by: [EMAIL PROTECTED]
Reported By: [EMAIL PROTECTED]
Status: Open
Bug Type: Scripting Engine problem
Operating System: Windows 98 SE
PHP Version: 4.1.0
New Comment:

Hello,

I tried:

DocumentRoot "d:/foo/htdocs"

DocumentRoot "d:/foo/htdocs/"

DocumentRoot "d:\foo/htdocs"

DocumentRoot "d:\foo/htdocs/"

I used 'php.ini-dist' with include_path set to ".".

Nevertheless,  I can't include files with an absolute path. Statements
with a relative path work properly.

Regards,

Martin



Previous Comments:


[2002-01-15 23:25:31] [EMAIL PROTECTED]

Oh yeah, the other reason I think it's a bug is because 
the behaviour is not consistant between the CGI version 
and the SAPI version of the same build.

If it has to be inconsistant it should be documented.
(proably a blurb on top of include_path in php.ini would
be the best place for it, since people will find that
include_path causes the problem when their doc_root
is set wrong)



[2002-01-15 23:21:44] [EMAIL PROTECTED]

The Solution:
-

You need to add the drive letter as follows

DocumentRoot "D:\apache/htdocs/"
^
| emphasis on the "\"

then relative include_path statements should work.

I still think this is a bug, because apache runs fine
with DocumentRoot "/apache/htdocs/", it's only PHP that
has problems when include_path is set.



[2002-01-10 07:36:40] [EMAIL PROTECTED]

Hello,

when   I   add  the  drive  letter  to  the  include  statement  (e.g.
'd:/foo/test.php'), then the inclusion works properly.

But then all scripts only run on a window machine or we have to change
every   script   before   uploading   it   to  our  "real"  webserver,
respectively.

Regards,

Martin




[2002-01-10 06:26:27] [EMAIL PROTECTED]

Hello,

whenever  I  add  the  drive  letter  (d:)  to the DocumentRoot of the
VirtualHost,  there  is  the same error as with PHP running as "Server
API CGI":

- It's possible to set the include-path in php.ini.

- Scripts without any include statement work well.

- include statements with a relative path work.

- include statements with an absolute path do not work, there is the
  following error:
  Failed opening '/foo/test.php' for inclusion

However,  it is now possible to start PHP with include-path in php.ini
set to a non-empty value.

But for me, it's very important to use include with an absolute path.

I  tried to put the file "test.php" into the folder "foo" on drive c:,
but  this  doesn't work properly too. I thought PHP is looking for the
file  on  the  wrong  disk,  but  this  seems to be not the underlying
problem.

Regards,

Martin




[2002-01-09 21:17:13] [EMAIL PROTECTED]

Martin, 

Did my suggestion work for you?  Where you missing the drive letter?

-Garth



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/?id=14797


Edit this bug report at http://bugs.php.net/?id=14797&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 #15084: Cannot remove module mod_php4.c not found in module list.

2002-01-17 Thread nielsvanhove

From: [EMAIL PROTECTED]
Operating system: win2k-apache 1.3
PHP version:  4.1.1
PHP Bug Type: Apache related
Bug description:  Cannot remove module mod_php4.c not found in module list.

I've downloaded: 
php-4.1.1-win32.zip

I'm using apache, which works fine. If I try to install the module (set
directorys fine, php.ini in the %systemroot% a.s.o; I set the following in
the httpd.conf:
LoadModule php4_module c:/apache/php/sapi/php4apache.dll

Then if i test the config; the following error occurs:
"Cannot remove module mod_php4.c not found in module list."

-- 
Edit bug report at: http://bugs.php.net/?id=15084&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 #14797 Updated: include (_path) in Apache SAPI and CGI on Win98SE does not work

2002-01-17 Thread mboeren

ID: 14797
Updated by: mboeren
Reported By: [EMAIL PROTECTED]
Status: Open
Bug Type: Scripting Engine problem
Operating System: Windows 98 SE
PHP Version: 4.1.0
New Comment:


I use NT, but that doesn't really matter. What works for me is the
following:

If in httpd.conf, the DocumentRoot is d:/foo/htdocs, then
in php.ini, I set include_path to d:/foo/htdocs as well.

In every script that uses include, specify the relative path from
d:/foo/htdocs (never from the current file!), _without_ a leading /,
e.g. if your include file is d:/foo/htdocs/inc/bla.p, then use
include("inc/bla.p");

You could combine this with tricks like defining a constant
ABS_INCL_PATH, setting this to d:/foo/htdocs and then using
include(ABS_INCL_PATH."/inc/bla.p");

This way you can also create more constants, like
THIS_PROJECT_ABS_INCL_PATH and GENERAL_TOOLBOX_ABS_INCL_PATH.

Switching to a *nix environment is just a matter of redefining your
constants.

Hope this helps, Marc.


Previous Comments:


[2002-01-17 10:02:58] [EMAIL PROTECTED]

Hello,

I tried:

DocumentRoot "d:/foo/htdocs"

DocumentRoot "d:/foo/htdocs/"

DocumentRoot "d:\foo/htdocs"

DocumentRoot "d:\foo/htdocs/"

I used 'php.ini-dist' with include_path set to ".".

Nevertheless,  I can't include files with an absolute path. Statements
with a relative path work properly.

Regards,

Martin




[2002-01-15 23:25:31] [EMAIL PROTECTED]

Oh yeah, the other reason I think it's a bug is because 
the behaviour is not consistant between the CGI version 
and the SAPI version of the same build.

If it has to be inconsistant it should be documented.
(proably a blurb on top of include_path in php.ini would
be the best place for it, since people will find that
include_path causes the problem when their doc_root
is set wrong)



[2002-01-15 23:21:44] [EMAIL PROTECTED]

The Solution:
-

You need to add the drive letter as follows

DocumentRoot "D:\apache/htdocs/"
^
| emphasis on the "\"

then relative include_path statements should work.

I still think this is a bug, because apache runs fine
with DocumentRoot "/apache/htdocs/", it's only PHP that
has problems when include_path is set.



[2002-01-10 07:36:40] [EMAIL PROTECTED]

Hello,

when   I   add  the  drive  letter  to  the  include  statement  (e.g.
'd:/foo/test.php'), then the inclusion works properly.

But then all scripts only run on a window machine or we have to change
every   script   before   uploading   it   to  our  "real"  webserver,
respectively.

Regards,

Martin




[2002-01-10 06:26:27] [EMAIL PROTECTED]

Hello,

whenever  I  add  the  drive  letter  (d:)  to the DocumentRoot of the
VirtualHost,  there  is  the same error as with PHP running as "Server
API CGI":

- It's possible to set the include-path in php.ini.

- Scripts without any include statement work well.

- include statements with a relative path work.

- include statements with an absolute path do not work, there is the
  following error:
  Failed opening '/foo/test.php' for inclusion

However,  it is now possible to start PHP with include-path in php.ini
set to a non-empty value.

But for me, it's very important to use include with an absolute path.

I  tried to put the file "test.php" into the folder "foo" on drive c:,
but  this  doesn't work properly too. I thought PHP is looking for the
file  on  the  wrong  disk,  but  this  seems to be not the underlying
problem.

Regards,

Martin




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/?id=14797


Edit this bug report at http://bugs.php.net/?id=14797&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 #14797 Updated: include (_path) in Apache SAPI and CGI on Win98SE does not work

2002-01-17 Thread m

ID: 14797
User updated by: [EMAIL PROTECTED]
Reported By: [EMAIL PROTECTED]
Status: Open
Bug Type: Scripting Engine problem
Operating System: Windows 98 SE
PHP Version: 4.1.0
New Comment:

Yes,  but  I  do not want to edit anything. I want to upload the files
and then it has to work.

Perhaps you can use something like this:

if (strpos($SERVER_SOFTWARE, "Win")) {
echo "WINDOWS";
} else {
echo "Uhh, good...";
}

But it's only a dirty workaround.


Previous Comments:


[2002-01-17 10:19:11] [EMAIL PROTECTED]


I use NT, but that doesn't really matter. What works for me is the
following:

If in httpd.conf, the DocumentRoot is d:/foo/htdocs, then
in php.ini, I set include_path to d:/foo/htdocs as well.

In every script that uses include, specify the relative path from
d:/foo/htdocs (never from the current file!), _without_ a leading /,
e.g. if your include file is d:/foo/htdocs/inc/bla.p, then use
include("inc/bla.p");

You could combine this with tricks like defining a constant
ABS_INCL_PATH, setting this to d:/foo/htdocs and then using
include(ABS_INCL_PATH."/inc/bla.p");

This way you can also create more constants, like
THIS_PROJECT_ABS_INCL_PATH and GENERAL_TOOLBOX_ABS_INCL_PATH.

Switching to a *nix environment is just a matter of redefining your
constants.

Hope this helps, Marc.



[2002-01-17 10:02:58] [EMAIL PROTECTED]

Hello,

I tried:

DocumentRoot "d:/foo/htdocs"

DocumentRoot "d:/foo/htdocs/"

DocumentRoot "d:\foo/htdocs"

DocumentRoot "d:\foo/htdocs/"

I used 'php.ini-dist' with include_path set to ".".

Nevertheless,  I can't include files with an absolute path. Statements
with a relative path work properly.

Regards,

Martin




[2002-01-15 23:25:31] [EMAIL PROTECTED]

Oh yeah, the other reason I think it's a bug is because 
the behaviour is not consistant between the CGI version 
and the SAPI version of the same build.

If it has to be inconsistant it should be documented.
(proably a blurb on top of include_path in php.ini would
be the best place for it, since people will find that
include_path causes the problem when their doc_root
is set wrong)



[2002-01-15 23:21:44] [EMAIL PROTECTED]

The Solution:
-

You need to add the drive letter as follows

DocumentRoot "D:\apache/htdocs/"
^
| emphasis on the "\"

then relative include_path statements should work.

I still think this is a bug, because apache runs fine
with DocumentRoot "/apache/htdocs/", it's only PHP that
has problems when include_path is set.



[2002-01-10 07:36:40] [EMAIL PROTECTED]

Hello,

when   I   add  the  drive  letter  to  the  include  statement  (e.g.
'd:/foo/test.php'), then the inclusion works properly.

But then all scripts only run on a window machine or we have to change
every   script   before   uploading   it   to  our  "real"  webserver,
respectively.

Regards,

Martin




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/?id=14797


Edit this bug report at http://bugs.php.net/?id=14797&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 #15085: mysql_query for insert statement does not work proprely

2002-01-17 Thread a . chine

From: [EMAIL PROTECTED]
Operating system: Linux Redhat 7.1
PHP version:  4.0.5
PHP Bug Type: MySQL related
Bug description:  mysql_query for insert statement does not work proprely

I have wrote the script bellow :

for ($i=50;$i<60;$i++)
{
$requette="INSERT INTO DRE(cle_DRE,nom) VALUES(".$i.",'DRE".$i."')";
$resultat=mysql_query($requette,$connexion);
if ($resultat==FALSE)
  {echo "Erreur : ".mysql_error().""; return -1;}
}

the field "cle_DRE" is the primary key of the table "DRE".
in the beggining, the table is empty, and when trying to execute this
script, the behavior is random, sometimmes it works proprely, and the rows
are added to the table, other times, it generates an error message :
Erreur : Duplicate entry '50' for key 1.
before lunching the script, i always initialise the table (i make it
empty).
thanks for help::))
-- 
Edit bug report at: http://bugs.php.net/?id=15085&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 #14797 Updated: include (_path) in Apache SAPI and CGI on Win98SE does not work

2002-01-17 Thread m

ID: 14797
User updated by: [EMAIL PROTECTED]
Reported By: [EMAIL PROTECTED]
Status: Open
Bug Type: Scripting Engine problem
Operating System: Windows 98 SE
PHP Version: 4.1.0
New Comment:

OK, I think I has to use this workaround:

if (strpos($SERVER_SOFTWARE, "Win")) { // Windows - Is there a better
way to detect this?
$NB_INCLUDE_PATH_PREFIX = substr($DOCUMENT_ROOT, 0, 2); // The
drive letter - Is there a better way to detect this?
} else { // NOT Windows
$NB_INCLUDE_PATH_PREFIX = "";
}

include ($NB_INCLUDE_PATH_PREFIX . "/foo/test.php");

But I'm not really happy...


Previous Comments:


[2002-01-17 10:35:01] [EMAIL PROTECTED]

Yes,  but  I  do not want to edit anything. I want to upload the files
and then it has to work.

Perhaps you can use something like this:

if (strpos($SERVER_SOFTWARE, "Win")) {
echo "WINDOWS";
} else {
echo "Uhh, good...";
}

But it's only a dirty workaround.



[2002-01-17 10:19:11] [EMAIL PROTECTED]


I use NT, but that doesn't really matter. What works for me is the
following:

If in httpd.conf, the DocumentRoot is d:/foo/htdocs, then
in php.ini, I set include_path to d:/foo/htdocs as well.

In every script that uses include, specify the relative path from
d:/foo/htdocs (never from the current file!), _without_ a leading /,
e.g. if your include file is d:/foo/htdocs/inc/bla.p, then use
include("inc/bla.p");

You could combine this with tricks like defining a constant
ABS_INCL_PATH, setting this to d:/foo/htdocs and then using
include(ABS_INCL_PATH."/inc/bla.p");

This way you can also create more constants, like
THIS_PROJECT_ABS_INCL_PATH and GENERAL_TOOLBOX_ABS_INCL_PATH.

Switching to a *nix environment is just a matter of redefining your
constants.

Hope this helps, Marc.



[2002-01-17 10:02:58] [EMAIL PROTECTED]

Hello,

I tried:

DocumentRoot "d:/foo/htdocs"

DocumentRoot "d:/foo/htdocs/"

DocumentRoot "d:\foo/htdocs"

DocumentRoot "d:\foo/htdocs/"

I used 'php.ini-dist' with include_path set to ".".

Nevertheless,  I can't include files with an absolute path. Statements
with a relative path work properly.

Regards,

Martin




[2002-01-15 23:25:31] [EMAIL PROTECTED]

Oh yeah, the other reason I think it's a bug is because 
the behaviour is not consistant between the CGI version 
and the SAPI version of the same build.

If it has to be inconsistant it should be documented.
(proably a blurb on top of include_path in php.ini would
be the best place for it, since people will find that
include_path causes the problem when their doc_root
is set wrong)



[2002-01-15 23:21:44] [EMAIL PROTECTED]

The Solution:
-

You need to add the drive letter as follows

DocumentRoot "D:\apache/htdocs/"
^
| emphasis on the "\"

then relative include_path statements should work.

I still think this is a bug, because apache runs fine
with DocumentRoot "/apache/htdocs/", it's only PHP that
has problems when include_path is set.



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/?id=14797


Edit this bug report at http://bugs.php.net/?id=14797&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 #13459 Updated: ifx_connect: E [SQLSTATE=IX 000 SQLCODE=-439]

2002-01-17 Thread cedric . boudin

ID: 13459
Comment by: [EMAIL PROTECTED]
Old Reported By: [EMAIL PROTECTED]
Reported By: [EMAIL PROTECTED]
Status: Analyzed
Bug Type: Informix related
Operating System: Linux 2.2
PHP Version: 4.0.5
New Comment:

I do get same phenomenon on solaris 2.8
apache 1.3.20
php 3.1.18 and 4.1.0
against ids2000 esql v9.3
with  MaxRequestsPerChild = 0
happen very often
with  MaxRequestsPerChild=20 
happens once and again


Previous Comments:


[2001-09-26 14:50:20] [EMAIL PROTECTED]

Informix throws the error, which is (from
http://www.informix.com/answers/english/ierrors.htm):

-439 Database server is currently processing an SQL task.

   You  attempted  to  call an SQL routine or attempted to execute an
SQL
   statement  within  a  signal  handling  function/routine or a
callback
   function/procedure.  Use  only  the  sqldone()  and sqlbreak()
library
   functions  inside your INFORMIX-ESQL/C callback function. Use only
the
   ECO-SQD  and  ECO-SQB library routines inside your ESQL/COBOL
callback
   procedure.  In  addition,  if  you  want  to  unregister your
callback
   function  in  INFORMIX-ESQL/C,  you  can invoke the
sqlbreakcallback()
   callback  registration function within your callback procedure. If
you
   want  to  unregister  your  callback  procedure in ESQL/COBOL, you
can
   invoke   the  ECO-SQBCB  callback  registration  routine  within 
your
   callback procedure.



[2001-09-26 14:00:52] [EMAIL PROTECTED]

It's happenning the error -439 in my site. But I never got the ways it
happens because it occurs just sometimes and I never could reproduce it
in my tests.





Edit this bug report at http://bugs.php.net/?id=13459&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 #15086: trans sid still doesn't work with zlib.compression or ob_gzhandler (PHP 4.1.1)

2002-01-17 Thread Basc

From: [EMAIL PROTECTED]
Operating system: Debian
PHP version:  4.1.1
PHP Bug Type: Output Control
Bug description:  trans sid still doesn't work with zlib.compression or ob_gzhandler 
(PHP 4.1.1)

When I compress my output with ob_gzhandler or with
zlib.output_compression trans sid doesn't work.
Without output compression trans sid works fine.
I use PHP 4.1.1 (Debian Package)

In following code php doesn't add the sid to the testlink
(sessioncookies are off)



Testlink


-- 
Edit bug report at: http://bugs.php.net/?id=15086&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 #14797 Updated: include (_path) in Apache SAPI and CGI on Win98SE does not work

2002-01-17 Thread mboeren

ID: 14797
Updated by: mboeren
Reported By: [EMAIL PROTECTED]
Status: Open
Bug Type: Scripting Engine problem
Operating System: Windows 98 SE
PHP Version: 4.1.0
New Comment:

How about 

include(getenv("DRIVELETTER")."/foo/test.php");

and setting this environment variable locally (chances are it isn't set
on the real webserver).

Cheerio, Marc.


Previous Comments:


[2002-01-17 10:56:50] [EMAIL PROTECTED]

OK, I think I has to use this workaround:

if (strpos($SERVER_SOFTWARE, "Win")) { // Windows - Is there a better
way to detect this?
$NB_INCLUDE_PATH_PREFIX = substr($DOCUMENT_ROOT, 0, 2); // The
drive letter - Is there a better way to detect this?
} else { // NOT Windows
$NB_INCLUDE_PATH_PREFIX = "";
}

include ($NB_INCLUDE_PATH_PREFIX . "/foo/test.php");

But I'm not really happy...



[2002-01-17 10:35:01] [EMAIL PROTECTED]

Yes,  but  I  do not want to edit anything. I want to upload the files
and then it has to work.

Perhaps you can use something like this:

if (strpos($SERVER_SOFTWARE, "Win")) {
echo "WINDOWS";
} else {
echo "Uhh, good...";
}

But it's only a dirty workaround.



[2002-01-17 10:19:11] [EMAIL PROTECTED]


I use NT, but that doesn't really matter. What works for me is the
following:

If in httpd.conf, the DocumentRoot is d:/foo/htdocs, then
in php.ini, I set include_path to d:/foo/htdocs as well.

In every script that uses include, specify the relative path from
d:/foo/htdocs (never from the current file!), _without_ a leading /,
e.g. if your include file is d:/foo/htdocs/inc/bla.p, then use
include("inc/bla.p");

You could combine this with tricks like defining a constant
ABS_INCL_PATH, setting this to d:/foo/htdocs and then using
include(ABS_INCL_PATH."/inc/bla.p");

This way you can also create more constants, like
THIS_PROJECT_ABS_INCL_PATH and GENERAL_TOOLBOX_ABS_INCL_PATH.

Switching to a *nix environment is just a matter of redefining your
constants.

Hope this helps, Marc.



[2002-01-17 10:02:58] [EMAIL PROTECTED]

Hello,

I tried:

DocumentRoot "d:/foo/htdocs"

DocumentRoot "d:/foo/htdocs/"

DocumentRoot "d:\foo/htdocs"

DocumentRoot "d:\foo/htdocs/"

I used 'php.ini-dist' with include_path set to ".".

Nevertheless,  I can't include files with an absolute path. Statements
with a relative path work properly.

Regards,

Martin




[2002-01-15 23:25:31] [EMAIL PROTECTED]

Oh yeah, the other reason I think it's a bug is because 
the behaviour is not consistant between the CGI version 
and the SAPI version of the same build.

If it has to be inconsistant it should be documented.
(proably a blurb on top of include_path in php.ini would
be the best place for it, since people will find that
include_path causes the problem when their doc_root
is set wrong)



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/?id=14797


Edit this bug report at http://bugs.php.net/?id=14797&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 #15087: FX.php

2002-01-17 Thread gjermund

From: [EMAIL PROTECTED]
Operating system: Filemaker
PHP version:  4.1.1
PHP Bug Type: Unknown/Other Function
Bug description:  FX.php

When I search the site php.net for Filemaker, nothing shows 
up, you might say; but php does not support Filemaker... 
But FX.php does, a class written for accessing Filemaker’s 
XML from php, pls add this info, so that people stops 
believing that linux is Filemaker unfriendly ;-) Keep up 
the good work!
-- 
Edit bug report at: http://bugs.php.net/?id=15087&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 #14814 Updated: Strange error message on gzopen and ftp:// URL

2002-01-17 Thread georg

ID: 14814
Updated by: georg
Reported By: [EMAIL PROTECTED]
Status: Open
Old Bug Type: Zlib Related
Bug Type: Documentation problem
Operating System: Linux (2.4.17)
PHP Version: 4.1.1
New Comment:

Currently its not possible, to combine diffrent wrappers.
So you can't use fopen("zlib:url/file.gz") or 
gzopen("url/file.gz").

I changed it to a documentation problem, maybe someone can 
add a note, that is not possible yet to combine wrappers.



Previous Comments:


[2002-01-08 17:02:53] [EMAIL PROTECTED]

(Just got email back from Georg, replying to my response 
to this [emailed directly as the bug-editing was down at 
the time]).

It sounds like neither gzopen nor zlib:// work for remote 
files at all.

Is this a bug or should I submit it as a feature request?

P.S. Thanks again for the reply!




[2002-01-03 02:01:46] [EMAIL PROTECTED]

For opening zip-files via ftp or httpd, there is a little 
note in the manual:

Note: The current CVS version 4.0.4-dev introduces a 
fopen-wrapper for .gz-files, so that you can use a special 
'zlib:' URL to access compressed files transparently using 
the normal f*() file access functions if you prepend the 
filename or path with a 'zlib:' prefix when calling 
fopen(). 

 This feature requires a C runtime library that provides 
the fopencookie() function. To my current knowledge the 
GNU libc is the only library that provides this feature. 

But for sure, this is not a solution for the errormessage 
:-)




[2002-01-02 20:37:21] [EMAIL PROTECTED]

It's not clear from the manual whether or not gzopen is 
SUPPOSED to work with http:// and ftp:// URL's, but I get 
the impression the answer is "not yet".  (The 
documentation in the manual IMPLIES that it the 
filehandle-like functions should work with the exception 
of socket functions, but the user commentary below the 
gzopen entry implies that it doesn't work for http:// 
URL's either...)

However, when attempting to gzopen a .gz file from an FTP 
site, the error message returned is very strange:
-
Warning:  
gzopen("ftp://ftp.ncbi.nih.gov/genbank/gbpln3.seq.gz","r";) 
- Success in projects/phpdna/get28s.php on line 
69
Like, dude!  Couldn't gzopen 
ftp://ftp.ncbi.nih.gov/genbank/gbpln3.seq.gz!
The gzopen returned

-
("Warning - Success?")

(the section of code that does this is:

-
if(!($fhandle=gzopen($filename,"r")))
{
print("Like, dude!  Couldn't gzopen 
$filename!\n");
print("The gzopen returned $fhandle\n");
}
-
where filename has obviously been passed as 
ftp://ftp.ncbi.nih.gov/genbank/gbpln3.seq.gz

There's a pause that implies the connection attempt is 
being made.  
(quick update, I just re-ran the script and did a capture 
with 'ethereal' - a connection IS being made and, passive 
mode is being switched to, and the RETR is started on the 
file, and about 3 1K packets seem to come across.  Are FTP 
URL's supposed to work?  Is this a 'gzopen ftp://' bug 
rather than an error message bug?)

I'll report the "Please Oh Please add http/ftp URL support 
to gzopen like fopen has!" separately as a feature request 
later, presuming it doesn't turn out that it's already 
been done and I just don't know what I'm doing...  Thanks!






Edit this bug report at http://bugs.php.net/?id=14814&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 #14453 Updated: session_start() provokes a crash of php/apache

2002-01-17 Thread flash

ID: 14453
Comment by: [EMAIL PROTECTED]
Old Reported By: [EMAIL PROTECTED]
Reported By: [EMAIL PROTECTED]
Status: Critical
Bug Type: Session related
Operating System: win2k
PHP Version: 4.1.0
New Comment:

changing the path fixes the crash problem when session.save_handler is
set to 'files'... but what causes the crash when it is set to  'user' ?


Previous Comments:


[2002-01-12 06:34:10] [EMAIL PROTECTED]

A suggestion to help reduce this error:
In future releases php.ini-dist's session.save_path should contain the
value of c:\php\temp\ or something and not "/tmp" which does not exist
on Windows platforms!



[2001-12-22 11:31:30] [EMAIL PROTECTED]

Reproduced with the final 4.1.0 on Windows 2000 with Apache 1.3.22.



[2001-12-14 09:16:48] [EMAIL PROTECTED]

hi

I found the cause for these crashes:
If in the php.ini is a wrong path for the session files, php crashes
without further notice, whereas php 4.0.6 reported this when trying to
start a session with session_start():

Warning: open(./tmp\sess_7a7c42ff822a8016bb5d7b5625a4bc89, O_RDWR)
failed: m (2) in c:\some\path\file.php on line 7

this should be adressed in a future release, because crashes for such
reasons are not acceptible (even more if an older version behaved
correctly!).

regards
n. fankhauser



[2001-12-12 08:37:28] [EMAIL PROTECTED]



this script will cause php/apache to crash.

used configuration: 
php 4.10 / win32 as SAPI
apache 1.3.20 / win32

unfortunately, I don't have the time now to further investigate the
problem... please contact me if there are any workarounds / solutions
for this problem!

regards
n. fankhauser






Edit this bug report at http://bugs.php.net/?id=14453&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 #14143 Updated: Segmentation fun

2002-01-17 Thread teo

ID: 14143
User updated by: [EMAIL PROTECTED]
Reported By: [EMAIL PROTECTED]
Old Status: Feedback
Status: Open
Bug Type: Apache2 related
Operating System: SuSE7.1
PHP Version: 4.0CVS-2001-11-20
New Comment:

Tested again on Mandrake8.1 / php-4.1.1 / Apache-2.0.28-beta.
for a page like i.php/something the PATH_INFO still doesn't get set,
but least it doesn't segfault anymore.

PHP config line: --with-apxs2=/usr/local/apache2/bin/apxs --with-mysql
--with-dom --disable-posix --disable-pic --with-zlib --enable-wddx
--enable-debug




Previous Comments:


[2002-01-17 06:01:00] [EMAIL PROTECTED]

Does the same happen on 4.1.1 or current CVS?



[2001-11-20 06:49:34] [EMAIL PROTECTED]

related to #12691

Configuration: same as in #12691 except Apache is using prefork mpm.

The request: GET /i.php/a

Backtrace and request info are:

Program received signal SIGSEGV, Segmentation fault.
0x4004bb1e in apr_palloc (a=0x813e4cc, reqsize=10) at apr_pools.c:1214
1214first_avail = blok->h.first_avail;
(gdb) bt
#0  0x4004bb1e in apr_palloc (a=0x813e4cc, reqsize=10) at
apr_pools.c:1214
#1  0x80910d8 in add_any_filter (name=0x80aac34 "BYTERANGE", ctx=0x0,
r=0x813e51c, c=0x813a5cc, reg_filter_set=0x80ca19c,
r_filters=0x813e688,
c_filters=0x813a610) at util_filter.c:151
#2  0x809131f in ap_add_output_filter (name=0x80aac34 "BYTERANGE",
ctx=0x0,
r=0x813e51c, c=0x813a5cc) at util_filter.c:201
#3  0x8069f67 in ap_http_insert_filter (r=0x813e51c) at
http_core.c:310
#4  0x809ca63 in ap_run_insert_filter (r=0x813e51c) at request.c:120
#5  0x809d23d in ap_process_request_internal (r=0x813e51c) at
request.c:279
#6  0x806f779 in ap_process_request (r=0x813e51c) at
http_request.c:284
#7  0x8069e96 in ap_process_http_connection (c=0x813a5cc) at
http_core.c:289
#8  0x808f2f7 in ap_run_process_connection (c=0x813a5cc) at
connection.c:82
#9  0x808f58d in ap_process_connection (c=0x813a5cc) at
connection.c:219
#10 0x80804bc in child_main (child_num_arg=0) at prefork.c:803
#11 0x80805b3 in make_child (s=0x80cae44, slot=0) at prefork.c:839
#12 0x8080725 in startup_children (number_to_start=1) at prefork.c:913
#13 0x8080c45 in ap_mpm_run (_pconf=0x80c9cec, plog=0x80fde8c,
s=0x80cae44)
at prefork.c:1129
#14 0x8087ce6 in main (argc=2, argv=0xb674) at main.c:432


(gdb) f 3
#3  0x8069f67 in ap_http_insert_filter (r=0x813e51c) at
http_core.c:310
310 ap_add_output_filter("BYTERANGE", NULL, r,
r->connection);
(gdb) p *r
$8 = {pool = 0x813e4ec, connection = 0x813a5cc, server = 0x80cae44,
  next = 0x0, prev = 0x0, main = 0x0,
  the_request = 0x813ecac "GET /i.php/a HTTP/1.1", assbackwards = 0,
  proxyreq = 0, header_only = 0, protocol = 0x813ecfc "HTTP/1.1",
  proto_num = 1001, hostname = 0x813ef6c "teo",
  request_time = 1006255730034262, status_line = 0x0, status = 200,
  method = 0x813ecc4 "GET", method_number = 0, allowed = 0,
  allowed_xmethods = 0x0, allowed_methods = 0x813e694, sent_bodyct =
0,
  bytes_sent = 0, mtime = 0, chunked = 0, boundary = 0x0, range = 0x0,
  clength = 0, remaining = 0, read_length = 0, read_body = 0, 
read_chunked = 0, expecting_100 = 0, headers_in = 0x813e6c4,
  headers_out = 0x813ea14, err_headers_out = 0x813ea8c,
  subprocess_env = 0x813e86c, notes = 0x813eacc,
  content_type = 0x813f604 "application/x-httpd-php", handler = 0x0,
  content_encoding = 0x0, content_languages = 0x0, vlist_validator =
0x0,
  user = 0x0, ap_auth_type = 0x0, no_cache = 0, no_local_copy = 0,
  unparsed_uri = 0x813ecdc "/i.php/a", uri = 0x813ecec "/i.php/a",
  filename = 0x813f1d4 "/usr/local/apache2/htdocs/i.php",
  canonical_filename = 0x813f0e4 "/usr/local/apache2/htdocs/i.php/a",
  path_info = 0x813f133 "/a", args = 0x0, finfo = {cntxt = 0x813e4ec,
valid = 7598448, protection = 1604, filetype = APR_REG, user = 0,
group = 0, inode = 314593, device = 773, nlink = 1, size = 17,
csize = 24,
atime = 100625296900, mtime = 99740411000,
ctime = 99740411000,
fname = 0x813f1d4 "/usr/local/apache2/htdocs/i.php",
name = 0x80c23cc "O,\f\b", filehand = 0x13f0e4}, parsed_uri = {
scheme = 0x0, hostinfo = 0x0, user = 0x0, password = 0x0, hostname
= 0x0,
port_str = 0x0, path = 0x813ecec "/i.php/a", query = 0x0, fragment
= 0x0,
hostent = 0x0, port = 0, is_initialized = 1, dns_looked_up = 0,
dns_resolved = 0}, per_dir_config = 0x813f474, request_config =
0x813eb0c,
  htaccess = 0x0, output_filters = 0x813f62c, input_filters =
0x813f654,
  eos_sent = 0}












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


-- 
PHP Development Mailing List 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contac

[PHP-DEV] Bug #15087 Updated: FX.php

2002-01-17 Thread sander

ID: 15087
Updated by: sander
Reported By: [EMAIL PROTECTED]
Old Status: Open
Status: Bogus
Bug Type: Unknown/Other Function
Operating System: Filemaker
PHP Version: 4.1.1
New Comment:

FX.php is not an official PHP class. So it won't be on the official PHP
site.


Previous Comments:


[2002-01-17 11:23:39] [EMAIL PROTECTED]

When I search the site php.net for Filemaker, nothing shows 
up, you might say; but php does not support Filemaker... 
But FX.php does, a class written for accessing Filemaker’s 
XML from php, pls add this info, so that people stops 
believing that linux is Filemaker unfriendly ;-) Keep up 
the good work!





Edit this bug report at http://bugs.php.net/?id=15087&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]




RE: [PHP-DEV] PHP 4.1.x Win32 Extension Compile Error with oject_init()

2002-01-17 Thread Joe Lauer


Markus,

This fixed my problem.

Thanks

-Original Message-
From: Markus Fischer [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, January 16, 2002 7:15 PM
To: Joseph Lauer
Cc: [EMAIL PROTECTED]
Subject: Re: [PHP-DEV] PHP 4.1.x Win32 Extension Compile Error with
oject_init()


On Wed, Jan 16, 2002 at 02:44:09PM -0500, Joseph Lauer wrote :
> swsms.c(264) : error C2065: 'tsrm_ls' : undeclared identifier
> swsms.c(264) : warning C4022: '_object_init' : pointer mismatch for actual
> parameter 2

object_init() is just a macro and needs the thread context.
Just fetch it manually with TSRMLS_FETCH() after the variable
declaration but before your first code line.

You find this easily by looking up object_init() at
lxr.php.net:

159 #define object_init(arg) _object_init((arg) ZEND_FILE_LINE_CC
TSRMLS_CC)

--
Please always Cc to me when replying to me on the lists.


-- 
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 #15084 Updated: Cannot remove module mod_php4.c not found in module list.

2002-01-17 Thread sander

ID: 15084
Updated by: sander
Reported By: [EMAIL PROTECTED]
Old Status: Open
Status: Bogus
Bug Type: Apache related
Operating System: win2k-apache 1.3
PHP Version: 4.1.1
New Comment:

Ask support questions on the appropriate mailinglist.

Hint: somewhere in httpd.conf, there are a bunch of modules mentioned
(the .c files), add mod_php4.c at the end of that list.


Previous Comments:


[2002-01-17 10:03:22] [EMAIL PROTECTED]

I've downloaded: 
php-4.1.1-win32.zip

I'm using apache, which works fine. If I try to install the module (set
directorys fine, php.ini in the %systemroot% a.s.o; I set the following
in the httpd.conf:
LoadModule php4_module c:/apache/php/sapi/php4apache.dll

Then if i test the config; the following error occurs:
"Cannot remove module mod_php4.c not found in module list."






Edit this bug report at http://bugs.php.net/?id=15084&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 #14143 Updated: Segmentation fun

2002-01-17 Thread biancardi

ID: 14143
Comment by: [EMAIL PROTECTED]
Old Reported By: [EMAIL PROTECTED]
Reported By: [EMAIL PROTECTED]
Status: Open
Bug Type: Apache2 related
Operating System: SuSE7.1
PHP Version: 4.0CVS-2001-11-20
New Comment:

to solve the problem related to cgi var setting (PATH_INFO and so on)
you need the latest cvs, the one in 4.1.1
has bugs (at least when used with apache-2.0.28).

Roberto.


Previous Comments:


[2002-01-17 13:27:12] [EMAIL PROTECTED]

Tested again on Mandrake8.1 / php-4.1.1 / Apache-2.0.28-beta.
for a page like i.php/something the PATH_INFO still doesn't get set,
but least it doesn't segfault anymore.

PHP config line: --with-apxs2=/usr/local/apache2/bin/apxs --with-mysql
--with-dom --disable-posix --disable-pic --with-zlib --enable-wddx
--enable-debug





[2002-01-17 06:01:00] [EMAIL PROTECTED]

Does the same happen on 4.1.1 or current CVS?



[2001-11-20 06:49:34] [EMAIL PROTECTED]

related to #12691

Configuration: same as in #12691 except Apache is using prefork mpm.

The request: GET /i.php/a

Backtrace and request info are:

Program received signal SIGSEGV, Segmentation fault.
0x4004bb1e in apr_palloc (a=0x813e4cc, reqsize=10) at apr_pools.c:1214
1214first_avail = blok->h.first_avail;
(gdb) bt
#0  0x4004bb1e in apr_palloc (a=0x813e4cc, reqsize=10) at
apr_pools.c:1214
#1  0x80910d8 in add_any_filter (name=0x80aac34 "BYTERANGE", ctx=0x0,
r=0x813e51c, c=0x813a5cc, reg_filter_set=0x80ca19c,
r_filters=0x813e688,
c_filters=0x813a610) at util_filter.c:151
#2  0x809131f in ap_add_output_filter (name=0x80aac34 "BYTERANGE",
ctx=0x0,
r=0x813e51c, c=0x813a5cc) at util_filter.c:201
#3  0x8069f67 in ap_http_insert_filter (r=0x813e51c) at
http_core.c:310
#4  0x809ca63 in ap_run_insert_filter (r=0x813e51c) at request.c:120
#5  0x809d23d in ap_process_request_internal (r=0x813e51c) at
request.c:279
#6  0x806f779 in ap_process_request (r=0x813e51c) at
http_request.c:284
#7  0x8069e96 in ap_process_http_connection (c=0x813a5cc) at
http_core.c:289
#8  0x808f2f7 in ap_run_process_connection (c=0x813a5cc) at
connection.c:82
#9  0x808f58d in ap_process_connection (c=0x813a5cc) at
connection.c:219
#10 0x80804bc in child_main (child_num_arg=0) at prefork.c:803
#11 0x80805b3 in make_child (s=0x80cae44, slot=0) at prefork.c:839
#12 0x8080725 in startup_children (number_to_start=1) at prefork.c:913
#13 0x8080c45 in ap_mpm_run (_pconf=0x80c9cec, plog=0x80fde8c,
s=0x80cae44)
at prefork.c:1129
#14 0x8087ce6 in main (argc=2, argv=0xb674) at main.c:432


(gdb) f 3
#3  0x8069f67 in ap_http_insert_filter (r=0x813e51c) at
http_core.c:310
310 ap_add_output_filter("BYTERANGE", NULL, r,
r->connection);
(gdb) p *r
$8 = {pool = 0x813e4ec, connection = 0x813a5cc, server = 0x80cae44,
  next = 0x0, prev = 0x0, main = 0x0,
  the_request = 0x813ecac "GET /i.php/a HTTP/1.1", assbackwards = 0,
  proxyreq = 0, header_only = 0, protocol = 0x813ecfc "HTTP/1.1",
  proto_num = 1001, hostname = 0x813ef6c "teo",
  request_time = 1006255730034262, status_line = 0x0, status = 200,
  method = 0x813ecc4 "GET", method_number = 0, allowed = 0,
  allowed_xmethods = 0x0, allowed_methods = 0x813e694, sent_bodyct =
0,
  bytes_sent = 0, mtime = 0, chunked = 0, boundary = 0x0, range = 0x0,
  clength = 0, remaining = 0, read_length = 0, read_body = 0, 
read_chunked = 0, expecting_100 = 0, headers_in = 0x813e6c4,
  headers_out = 0x813ea14, err_headers_out = 0x813ea8c,
  subprocess_env = 0x813e86c, notes = 0x813eacc,
  content_type = 0x813f604 "application/x-httpd-php", handler = 0x0,
  content_encoding = 0x0, content_languages = 0x0, vlist_validator =
0x0,
  user = 0x0, ap_auth_type = 0x0, no_cache = 0, no_local_copy = 0,
  unparsed_uri = 0x813ecdc "/i.php/a", uri = 0x813ecec "/i.php/a",
  filename = 0x813f1d4 "/usr/local/apache2/htdocs/i.php",
  canonical_filename = 0x813f0e4 "/usr/local/apache2/htdocs/i.php/a",
  path_info = 0x813f133 "/a", args = 0x0, finfo = {cntxt = 0x813e4ec,
valid = 7598448, protection = 1604, filetype = APR_REG, user = 0,
group = 0, inode = 314593, device = 773, nlink = 1, size = 17,
csize = 24,
atime = 100625296900, mtime = 99740411000,
ctime = 99740411000,
fname = 0x813f1d4 "/usr/local/apache2/htdocs/i.php",
name = 0x80c23cc "O,\f\b", filehand = 0x13f0e4}, parsed_uri = {
scheme = 0x0, hostinfo = 0x0, user = 0x0, password = 0x0, hostname
= 0x0,
port_str = 0x0, path = 0x813ecec "/i.php/a", query = 0x0, fragment
= 0x0,
hostent = 0x0, port = 0, is_initialized = 1, dns_looked_up = 0,
dns_resolved = 0}, per_dir_config = 0x813f474, request_config =
0x813eb0c,
  htaccess = 0x0, output_filters = 0x813f62c, input_filters =
0x813f654,
  eos_sent = 0}






[PHP-DEV] Bug #15083 Updated: Big bug with mssql_fetch_xxxx methods

2002-01-17 Thread sander

ID: 15083
Updated by: sander
Reported By: [EMAIL PROTECTED]
Status: Open
Bug Type: MSSQL related
Operating System: Windows 2000 Pro
PHP Version: 4.1.1
New Comment:

Can you provide a sample script?


Previous Comments:


[2002-01-17 09:17:48] [EMAIL PROTECTED]

On PHP 4.0.6 on Windows 2000 Pro
 
I use the php_mssql.dll extension to access mssql server 7.0 and all
the method works very well.
(hum!! only the problem with ntext type but with CAST(yourfieldname AS
text) on the SQL query, that disappears)


After updating to PHP 4.1.1 on Windows 2000 Pro

The same code crashes Apache and Windows displays a dialog box with : 


Apache.exe
The instruction at "0x006db197" referenced memory at "0x043bcc3a".
The memory could not be "written".

I have search for a long time in the SQL query but in reality the
problem is not there...

The problem depends of the type returned by the query. 
All the numerical types work fine but all the string types like char,
nchar, text, ... result in crashes.

This problem appears only when you try to read the result with
mssql_fetch_ methods...


My configuration :
Windows 2000 Pro
MSSQL SERVER 7.0
APACHE 1.3.20
PHP 4.1.1 (same problem with PHP 4.1.0)





Edit this bug report at http://bugs.php.net/?id=15083&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 #15085 Updated: mysql_query for insert statement does not work proprely

2002-01-17 Thread sander

ID: 15085
Updated by: sander
Reported By: [EMAIL PROTECTED]
Old Status: Open
Status: Bogus
Bug Type: MySQL related
Operating System: Linux Redhat 7.1
PHP Version: 4.0.5
New Comment:

Ask support questions on the appropriate mailinglist.


Previous Comments:


[2002-01-17 10:50:16] [EMAIL PROTECTED]

I have wrote the script bellow :

for ($i=50;$i<60;$i++)
{
$requette="INSERT INTO DRE(cle_DRE,nom) VALUES(".$i.",'DRE".$i."')";
$resultat=mysql_query($requette,$connexion);
if ($resultat==FALSE)
  {echo "Erreur : ".mysql_error().""; return -1;}
}

the field "cle_DRE" is the primary key of the table "DRE".
in the beggining, the table is empty, and when trying to execute this
script, the behavior is random, sometimmes it works proprely, and the
rows are added to the table, other times, it generates an error message
: Erreur : Duplicate entry '50' for key 1.
before lunching the script, i always initialise the table (i make it
empty).
thanks for help::))





Edit this bug report at http://bugs.php.net/?id=15085&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 #15083 Updated: Big bug with mssql_fetch_xxxx methods

2002-01-17 Thread sander

ID: 15083
Updated by: sander
Reported By: [EMAIL PROTECTED]
Old Status: Open
Status: Feedback
Bug Type: MSSQL related
Operating System: Windows 2000 Pro
PHP Version: 4.1.1
New Comment:

Status -> feedback


Previous Comments:


[2002-01-17 13:44:39] [EMAIL PROTECTED]

Can you provide a sample script?



[2002-01-17 09:17:48] [EMAIL PROTECTED]

On PHP 4.0.6 on Windows 2000 Pro
 
I use the php_mssql.dll extension to access mssql server 7.0 and all
the method works very well.
(hum!! only the problem with ntext type but with CAST(yourfieldname AS
text) on the SQL query, that disappears)


After updating to PHP 4.1.1 on Windows 2000 Pro

The same code crashes Apache and Windows displays a dialog box with : 


Apache.exe
The instruction at "0x006db197" referenced memory at "0x043bcc3a".
The memory could not be "written".

I have search for a long time in the SQL query but in reality the
problem is not there...

The problem depends of the type returned by the query. 
All the numerical types work fine but all the string types like char,
nchar, text, ... result in crashes.

This problem appears only when you try to read the result with
mssql_fetch_ methods...


My configuration :
Windows 2000 Pro
MSSQL SERVER 7.0
APACHE 1.3.20
PHP 4.1.1 (same problem with PHP 4.1.0)





Edit this bug report at http://bugs.php.net/?id=15083&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 #14964 Updated: safe mode & basic authentication

2002-01-17 Thread gabriel

ID: 14964
Comment by: [EMAIL PROTECTED]
Old Reported By: [EMAIL PROTECTED]
Reported By: [EMAIL PROTECTED]
Status: Open
Bug Type: Unknown/Other Function
Operating System: linux
PHP Version: 4.1.1
New Comment:

We're having exactly the same problem.  PHP 4.1.1, apache 1.3.22 on
Linux (kernel 2.4.14)

I don't want to revert to 4.0.6, so I put a big #if 0 around the code
in sapi_add_header_ex() in SAPI.c, in the "WWW-Authenticate" case,
where it does special stuff if safe mode is on.  It's a band-aid, but
it works (for now)


Previous Comments:


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

Same error:

* SuSE 7.3, Apache/1.3.20 (Linux/SuSE), SuSE kernel 2.4.10-4GB

* installed php4.1.1 
./configure --with-apxs=/usr/sbin/apxs \
  --with-gd \
  --with-freetype-dir=/usr/include/freetype2 \
  --with-zlib \
  --disable-debug \
  --enable-safe-mode \
  --with-exec-dir \
  --enable-calendar \
  --enable-magic-quotes \
  --with-mysql=/usr \
  --enable-ftp \
  --enable-memory-limit \
  --enable-track-vars  \
  --with-pdflib  \
  --with-jpeg-dir=/usr/lib \
  --with-config-file-path=/usr/local/lib  \
  --with-png-dir=/usr/lib

* copied php.ini-recommended to /usr/local/lib/php.ini

* activated safe_mode in php.ini

* when using header("WWW-Authenticate: ... process dies

* error_log:  [notice] child pid 14153 exit signal Segmentation fault
(11)

* with "safe_mode = off" getting user/pass dialog

* will post more info when needed



[2002-01-10 08:24:12] [EMAIL PROTECTED]

the following problem, a script works flawlessly without safe mode, but
when safe mode enabled, the row

header("WWW-Authenticate: Basic realm=\"anything\"");

causes very strange error: apache doesn't return anything (no headers,
no content) - size 0 (i checked it even through telnet).

when i comment this line, just the HTML message for the incorrect user
or password is displayed (which should be displayed when cancel is hit
by the user)

the code below is

header("HTTP/1.0 401 Unauthorized");
echo 'incorrect user or password';
die();

I'm not 100% percent sure, but I think it is not error of configuring
php





Edit this bug report at http://bugs.php.net/?id=14964&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 #14964 Updated: safe mode & basic authentication

2002-01-17 Thread sesser

ID: 14964
Updated by: sesser
Reported By: [EMAIL PROTECTED]
Old Status: Open
Status: Closed
Bug Type: Unknown/Other Function
Operating System: linux
PHP Version: 4.1.1
New Comment:

This bug was fixed a few days ago in CVS


Previous Comments:


[2002-01-17 13:59:13] [EMAIL PROTECTED]

We're having exactly the same problem.  PHP 4.1.1, apache 1.3.22 on
Linux (kernel 2.4.14)

I don't want to revert to 4.0.6, so I put a big #if 0 around the code
in sapi_add_header_ex() in SAPI.c, in the "WWW-Authenticate" case,
where it does special stuff if safe mode is on.  It's a band-aid, but
it works (for now)



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

Same error:

* SuSE 7.3, Apache/1.3.20 (Linux/SuSE), SuSE kernel 2.4.10-4GB

* installed php4.1.1 
./configure --with-apxs=/usr/sbin/apxs \
  --with-gd \
  --with-freetype-dir=/usr/include/freetype2 \
  --with-zlib \
  --disable-debug \
  --enable-safe-mode \
  --with-exec-dir \
  --enable-calendar \
  --enable-magic-quotes \
  --with-mysql=/usr \
  --enable-ftp \
  --enable-memory-limit \
  --enable-track-vars  \
  --with-pdflib  \
  --with-jpeg-dir=/usr/lib \
  --with-config-file-path=/usr/local/lib  \
  --with-png-dir=/usr/lib

* copied php.ini-recommended to /usr/local/lib/php.ini

* activated safe_mode in php.ini

* when using header("WWW-Authenticate: ... process dies

* error_log:  [notice] child pid 14153 exit signal Segmentation fault
(11)

* with "safe_mode = off" getting user/pass dialog

* will post more info when needed



[2002-01-10 08:24:12] [EMAIL PROTECTED]

the following problem, a script works flawlessly without safe mode, but
when safe mode enabled, the row

header("WWW-Authenticate: Basic realm=\"anything\"");

causes very strange error: apache doesn't return anything (no headers,
no content) - size 0 (i checked it even through telnet).

when i comment this line, just the HTML message for the incorrect user
or password is displayed (which should be displayed when cancel is hit
by the user)

the code below is

header("HTTP/1.0 401 Unauthorized");
echo 'incorrect user or password';
die();

I'm not 100% percent sure, but I think it is not error of configuring
php





Edit this bug report at http://bugs.php.net/?id=14964&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] debugging...

2002-01-17 Thread brad lafountain

I don't know a good way of debug my extension on the linux platform..

It doens't crash on windows but it crashes on linux.. Can someone
give me some insite how they debug their php extensions. The crash is
reproducable but it isn't consistant.  It crashes ever ? times.

- Brad

__
Do You Yahoo!?
Send FREE video emails in Yahoo! Mail!
http://promo.yahoo.com/videomail/

-- 
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]




Re: [PHP-DEV] htmlspecialchars() alias

2002-01-17 Thread brad lafountain

hmm... 

if you don't feel like typing it out..
$hsc = "htmlspecialchars";

echo $hsc($var);

- Brad
--- "Jason G." <[EMAIL PROTECTED]> wrote:
> Hello General and Dev list,
> 
> Considering the fact that it is good practice to use htmlspecialchars() 
> anytime you are outputting non-html content to the browser...
> 
> After typing the 16 characters in the htmlspecialchars() function thousands 
> of times...
> 
> I was wondering if it would be feasible to create an alias for this 
> function, say hsc() or something short.
> 
> Even nicer, but probably not practical would be a language extension like:
>being the same as  
> 
> It is no big deal, but for a function that is used ALL THE TIME, it would 
> be nice.
> 
> Any Comments???
> 
> -Jason Garber
> www.IonZoft.com
> www.Univo.biz
> 
> 
> -- 
> 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]
> 


__
Do You Yahoo!?
Send FREE video emails in Yahoo! Mail!
http://promo.yahoo.com/videomail/

-- 
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]




Re: [PHP-DEV] shmop errors

2002-01-17 Thread Ilia A.

You have the same script try open the shm segment 2 times, which is WRONG.
Here is a proper example of what you should be doing:



I've also committed the patch to CVS that should eliminate the warning 
message. I wonder why Zend required strings with defined length to be null 
terminated, sounds like a recipe for disaster, if the length is known it 
should be used. But, whatever, please try the latest CVS.

Regards,

Ilia

On January 17, 2002 02:33 am, you wrote:
> On Wed, 2002-01-16 at 21:19, Ilia A. wrote:
> > I've tested your code on 4.1.1 release with the recent SHMOP patch that
> > is already part of the latest CVS. The code worked fine and did not
> > generate any warning or errors.
> >
> > I did however commented out the sem_* functions.
>
> That's funny, I've just downloaded php from cvs today (08.00 CET) and
> this script:
>
>define("SHMKEY", 0xDEAD);
>   define("SEMKEY", 0xCAFE);
>
>   $shm_id = @shmop_open(SHMKEY, "a", 0644, 10);
>   if (!$shm_id)
>   {
>   $shm_id = shmop_open(SHMKEY, "c", 0644, 10);
>   shmop_write($shm_id, "0", 0);
>   }
>
>   $shm_id = shmop_open(SHMKEY, "a", 0644, 10);
>
>   $count = shmop_read($shm_id, 0, shmop_size($shm_id));
>   shmop_close($shm_id);
>   echo $count ."\n";
> ?>
>
> generates the following error:
> Unknown(0) : Warning - String is not zero-terminated (0) (source:
> zend_execute_API.c:274)
>
> Using:
> './configure' \
> '--enable-debug' \
> '--enable-shmop' \
> '--enable-sysvsem' \
> "$@"
>
>
> -- robin


-- 
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 #15088: Problem with disable_functions on Apache 1.3.20 and PHP 4.1.1

2002-01-17 Thread gdizier

From: [EMAIL PROTECTED]
Operating system: Windows 2000 Srv fr SP2
PHP version:  4.1.1
PHP Bug Type: PHP options/info functions
Bug description:  Problem with disable_functions on Apache 1.3.20 and PHP 4.1.1

Hi, 

I have installed PHP 4.1.1 and Apache 1.3.20 on my windows 2000 server Fr
SP2.

I have set :


  php_admin_flag safe_mode on
  php_admin_value disable_functions fread,fopen,system,phpinfo


in httpd.conf file but functions is not disabled!

Follow the phpinfo page on my server in location users

Directive Local Value Master Value 
allow_call_time_pass_reference
 On On 
allow_url_fopen
 1 1 
always_populate_raw_post_data
 0 0 
arg_separator.input
 & & 
arg_separator.output
 & & 
asp_tags
 Off Off 
auto_append_file
 no value no value 
auto_prepend_file
 no value no value 
browscap
 no value no value 
default_charset
 no value no value 
default_mimetype
 text/html text/html 
define_syslog_variables
 Off Off 
disable_functions
 fread,fopen,system,phpinfo no value 
display_errors
 On On 
display_startup_errors
 Off Off 
doc_root
 no value no value 
enable_dl
 On On 
error_append_string
 no value no value 
error_log
 no value no value 
error_prepend_string
 no value no value 
error_reporting
 2039 2039 
expose_php
 On On 
extension_dir
 d:\inetpub\wwwroot\php4\extensions d:\inetpub\wwwroot\php4\extensions 
file_uploads
 1 1 
gpc_order
 GPC GPC 
highlight.bg
 #FF #FF 
highlight.comment
 #FF9900 #FF9900 
highlight.default
 #CC #CC 
highlight.html
 #00 #00 
highlight.keyword
 #006600 #006600 
highlight.string
 #CC #CC 
html_errors
 On On 
ignore_user_abort
 Off Off 
implicit_flush
 Off Off 
include_path
 no value no value 
log_errors
 Off Off 
magic_quotes_gpc
 On On 
magic_quotes_runtime
 Off Off 
magic_quotes_sybase
 Off Off 
max_execution_time
 30 30 
open_basedir
 no value no value 
output_buffering
 no value no value 
output_handler
 no value no value 
post_max_size
 8M 8M 
precision
 14 14 
register_argc_argv
 On On 
register_globals
 On On 
safe_mode
 On On 
safe_mode_exec_dir
 d:/inetpub/wwwroot/usuga/ d:/inetpub/wwwroot/usuga/ 
safe_mode_gid
 Off Off 
safe_mode_include_dir
 no value no value 
sendmail_from
 [EMAIL PROTECTED] [EMAIL PROTECTED] 
sendmail_path
 no value no value 
short_open_tag
 On On 
SMTP
 localhost localhost 
sql.safe_mode
 Off Off 
track_errors
 Off Off 
upload_max_filesize
 2M 2M 
upload_tmp_dir
 no value no value 
user_dir
 no value no value 
variables_order
 EGPCS EGPCS 
xmlrpc_error_number
 0 0 
xmlrpc_errors
 Off Off 
y2k_compliance
 Off Off 


Thank for your help.

Grégory Dizier

-- 
Edit bug report at: http://bugs.php.net/?id=15088&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 #15075 Updated: non-breaking spaces are ignored

2002-01-17 Thread goba

ID: 15075
Updated by: goba
Reported By: [EMAIL PROTECTED]
Status: Bogus
Old Bug Type: Website problem
Bug Type: URL related
Operating System: Linux 6.2
PHP Version: 4.1.1
New Comment:

& is used as a separator for variables in URLs. Treating   as a
space was a misfeature of PHP 3 if this
worked with it. & is a delimiter.

And this is not a php.net website problem at all.
This is an "URL related" problem.

--
Goba


Previous Comments:


[2002-01-17 16:06:13] [EMAIL PROTECTED]

The & doesn't work - IE and Netscape both do not recognize it.  I
tried    and   &  and  
Maybe there is something more that I need to do.

Since this is being used as part of a variable value in PHP there must
be something else.  It worked before the upgrade.

Any ideas are welcome



[2002-01-17 13:39:50] [EMAIL PROTECTED]

Use & instead of & in href's (see urlencode/urldecode).



[2002-01-16 17:14:14] [EMAIL PROTECTED]

Just updated PHP from 3.0 to 4.1 but now it won't recognize the
non-breaking space ( ) in passing a value to a variable.

We are using this for a form and it enters the information into the
form.  We need the   because our users use both Netscape and
Internet Explorer.

This worked before but doesn't work now.

To
Register

course is one variable and date is another

Is there a reason that the non-breaking space would quit working.

Thanks for any help!








Edit this bug report at http://bugs.php.net/?id=15075&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 #15089: stat() produces warning instead of error-code.

2002-01-17 Thread herp

From: [EMAIL PROTECTED]
Operating system: linux
PHP version:  4.1.1
PHP Bug Type: Unknown/Other Function
Bug description:  stat() produces warning instead of error-code.

I used stat() to check the existence of files. If the file I check does
not
exist, stat() would return FALSE instead of a struct stbuf. This behaviour
is also the *documented* behaviour and is how php-4.0 behaves.

Just 15 mins. ago I installed php-4.1.1. Now, stat() on a non-existent
file clutters my html-pages with "Warning: file does not exist". *cough*
Yes, I know that files might not exist, that´s exactly what I use stat()
for, to check the existance of files. Yes, there is "file_exists()", but
why do you output warnings from stat() when returning FALSE is
sufficient? This is one more step away from how one would code
programms in C. Why implement C-like functions (stat(), fstat(), lstat())
when you have to use other non-obvious functions (file_exists())
to do what you could do with the C-like functions. Stay close to the
origins.

-- 
Edit bug report at: http://bugs.php.net/?id=15089&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 #15089 Updated: stat() produces warning instead of error-code.

2002-01-17 Thread herp

ID: 15089
User updated by: [EMAIL PROTECTED]
Reported By: [EMAIL PROTECTED]
Status: Open
Bug Type: Unknown/Other Function
Operating System: linux
PHP Version: 4.1.1
New Comment:

I used stat() to check the existence of files. If the file I check
does
not
exist, stat() would return FALSE instead of a struct stbuf. This
behaviour is also the *documented* behaviour and is how php-4.0
behaves.

Just 15 mins. ago I installed php-4.1.1. Now, stat() on a
non-existent
file clutters my html-pages with "Warning: file does not exist".
*cough*
Yes, I know that files might not exist, that´s exactly what I use
stat()
for, to check the existance of files. Yes, there is
"file_exists()",
but
why do you output warnings from stat() when returning FALSE is
sufficient? This is one more step away from how one would code
programms in C. Why implement C-like functions (stat(), fstat(),
lstat())
when you have to use other non-obvious functions (file_exists())
to do what you could do with the C-like functions. Stay close to
the
origins.


Now I have to use *two* functions - first I have to use file_exists(),
then I have to use stat(). I am pretty sure that php will execute both
calls using the same system-call, that is, stat(2). That´s suboptimal
and an overhead and a performance penalty (yes I have *many* files). I
just don´t see why the php-engine has to perform the same system-call
twice with exactly the same paramters, when one system-call is enough.

I really think this is not good. And since I am in doubt you will ever
change that, I am considerung switching to mod_perl.


Previous Comments:


[2002-01-17 16:29:38] [EMAIL PROTECTED]

I used stat() to check the existence of files. If the file I check does
not
exist, stat() would return FALSE instead of a struct stbuf. This
behaviour is also the *documented* behaviour and is how php-4.0
behaves.

Just 15 mins. ago I installed php-4.1.1. Now, stat() on a non-existent
file clutters my html-pages with "Warning: file does not exist".
*cough*
Yes, I know that files might not exist, that´s exactly what I use
stat()
for, to check the existance of files. Yes, there is "file_exists()",
but
why do you output warnings from stat() when returning FALSE is
sufficient? This is one more step away from how one would code
programms in C. Why implement C-like functions (stat(), fstat(),
lstat())
when you have to use other non-obvious functions (file_exists())
to do what you could do with the C-like functions. Stay close to the
origins.






Edit this bug report at http://bugs.php.net/?id=15089&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] htmlspecialchars() alias

2002-01-17 Thread Jason G.

Hello General and Dev list,

Considering the fact that it is good practice to use htmlspecialchars() 
anytime you are outputting non-html content to the browser...

After typing the 16 characters in the htmlspecialchars() function thousands 
of times...

I was wondering if it would be feasible to create an alias for this 
function, say hsc() or something short.

Even nicer, but probably not practical would be a language extension like:
   being the same as  

It is no big deal, but for a function that is used ALL THE TIME, it would 
be nice.

Any Comments???

-Jason Garber
www.IonZoft.com
www.Univo.biz


-- 
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]




Re: [PHP-DEV] htmlspecialchars() alias

2002-01-17 Thread Daniel Lorch

Hi,

> After typing the 16 characters in the htmlspecialchars() function thousands 
> of times...

When you have to type it 16 times, then you did something wrong.
Consider this:

foreach($_GLOBAL as $key => $val)
  $$key = htmlspecialchars($val);

Replace $_GLOBAL by $_COOKIES, $_GET, .. OR you could just group
together variables:

  

and go through $form in your script.

> I was wondering if it would be feasible to create an alias for this 
> function, say hsc() or something short.

> [..]

> It is no big deal, but for a function that is used ALL THE TIME, it would 
> be nice.

why do something in C, when it can be done in PHP so nicely:

function hsc(&$var) {
  $var = htmlspecialchars($var);
}

Alias are terrible. The decrease readability of your code. Actually
doing hsc() in PHP is compareable silly.

Kind Regards,
  Daniel Lorch
-- 
@echo "Hello, World";



-- 
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 #15090: header("Location: $url") causes php.exe to generate an error

2002-01-17 Thread kmudrick

From: [EMAIL PROTECTED]
Operating system: Windows 2000
PHP version:  4.0.6
PHP Bug Type: Reproducible crash
Bug description:  header("Location: $url") causes php.exe to generate an error

After a lengthy script, I go to redirect to another page, using 

header("Location: $redirect_page?PHPSESSID=$sid") 

where $redirect_page is the address to goto.. Anyway, this causes a
windows "php.exe has generated an error" message, while using a 

print "";

works just fine, with no error generated.  The page is using session
variables.
-- 
Edit bug report at: http://bugs.php.net/?id=15090&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 #13165 Updated: Definate problem with classes and included files

2002-01-17 Thread eye

ID: 13165
Comment by: [EMAIL PROTECTED]
Old Reported By: [EMAIL PROTECTED]
Reported By: [EMAIL PROTECTED]
Status: Analyzed
Bug Type: Documentation problem
Operating System: RedHat 7.1
PHP Version: 4.0.6
New Comment:

Isn't this the same bug as http://bugs.php.net/bug.php?id=13882 (and
therefore solved in version 4.1.1?)

if not it still seems a bug to me: whenever A includes B and B includes
C, it should not be necessary that A has to include C


Previous Comments:


[2001-10-21 20:49:20] [EMAIL PROTECTED]

This is not a bug. Classes must be defined in order.
They can be in different order if they are in same file 
though. (Zeev can explain this better :)

Reclassified as documentation problem as this isn't 
explained anywhere.

--Jani




[2001-09-11 01:18:21] [EMAIL PROTECTED]

Just wondering if there has been any progress on this report?  Thanks.



[2001-09-06 02:11:38] [EMAIL PROTECTED]

There is *definately* a problem in PHP 4.0.6 with classes, inheritance,
and included/required files.  Here is an example:

// ==
// test.php:



// ==

// ==
// children.php



// ==

// ==
// parent.php



// ==

You can try this out for yourself and see what I mean.  If you bring up
"test.php" in your browser, you should receive this error:

Fatal error: Class child2: Cannot inherit from undefined class child1

Why does this happen, even though all files are being included
correctly?  Well, I know one way of preventing the error, and that is
by re-ordering the classes in "children.php" so that Child1() is listed
first.  This removes the error, **however**, if the Parent() class is
NOT in a separate file, and is actually part of the same file (i.e.
"children.php"), the order of the class definitions does NOT matter. 
Why is this?





Edit this bug report at http://bugs.php.net/?id=13165&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] session problems with own session handler in php..

2002-01-17 Thread Robin Ericsson

This seems very similar to bug #14880.

I use a session handler written in php, which I set with
session_set_save_handler().

The problem is that my write function never gets called, and data never
written.

Variables are not stored when entered into $_SESSION, and I narroved it down
to one setting.

register_globals

with this on, it works, with this off, it doesn't work..

Yohgaki, I've seen you involved in this, any news of it?

Oh, btw, I'm using snapshop 2002011712 from snaps.php.net



regards
Robin


-- 
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 #15091: socket_set_timeout not part of windows binary

2002-01-17 Thread Rajkumar . Bellan

From: [EMAIL PROTECTED]
Operating system: windows 2000
PHP version:  4.1.1
PHP Bug Type: Sockets related
Bug description:  socket_set_timeout not part of windows binary

I am using windows binaries.

$fp = $fsockopen(($ip_addr, $port_no, $errno, $errstr, 30);
do {
   if (!feof($fp)) {
$livedata = trim(fgets($fp,128));
 echo $livedata."\n";
}
else {
break;
}
} while(true);

when there is no data being sent by the server my script waits
indefinitely at fgets. I tried using socket_set_blocking($fp, false) but
that does get me data every one second. I tried to use socket_set_timeout
that is when I found out it is not supported in windows binaries. Is there
any other way to solve this problem in windows.
-- 
Edit bug report at: http://bugs.php.net/?id=15091&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 #15091 Updated: socket_set_timeout not part of windows binary

2002-01-17 Thread Rajkumar . Bellan

ID: 15091
User updated by: [EMAIL PROTECTED]
Reported By: [EMAIL PROTECTED]
Status: Open
Bug Type: Sockets related
Operating System: windows 2000
PHP Version: 4.1.1


Edit this bug report at http://bugs.php.net/?id=15091&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 #15091 Updated: socket_set_timeout not part of windows binary

2002-01-17 Thread Rajkumar . Bellan

ID: 15091
User updated by: [EMAIL PROTECTED]
Reported By: [EMAIL PROTECTED]
Status: Open
Bug Type: Sockets related
Operating System: windows 2000
PHP Version: 4.1.1


Edit this bug report at http://bugs.php.net/?id=15091&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 #15091 Updated: socket_set_timeout not part of windows binary

2002-01-17 Thread Rajkumar . Bellan

ID: 15091
User updated by: [EMAIL PROTECTED]
Reported By: [EMAIL PROTECTED]
Status: Open
Bug Type: Sockets related
Operating System: windows 2000
PHP Version: 4.1.1
New Comment:

Correction to my earlier report. When using socket_set_blocking($fp,
false) I am "not" getting data every one second


Previous Comments:


[2002-01-17 18:28:21] [EMAIL PROTECTED]

I am using windows binaries.

$fp = $fsockopen(($ip_addr, $port_no, $errno, $errstr, 30);
do {
   if (!feof($fp)) {
$livedata = trim(fgets($fp,128));
 echo $livedata."\n";
}
else {
break;
}
} while(true);

when there is no data being sent by the server my script waits
indefinitely at fgets. I tried using socket_set_blocking($fp, false)
but that does get me data every one second. I tried to use
socket_set_timeout that is when I found out it is not supported in
windows binaries. Is there any other way to solve this problem in
windows.





Edit this bug report at http://bugs.php.net/?id=15091&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 #13035 Updated: 404 on a .php results in SERVER ERROR when using php as a cgi

2002-01-17 Thread sbeam

ID: 13035
User updated by: [EMAIL PROTECTED]
Reported By: [EMAIL PROTECTED]
Old Status: Feedback
Status: Open
Bug Type: Apache related
Operating System: Linux 2.4.6
PHP Version: 4.0.6
New Comment:

I dont know. I dont have 4.1.1 compiled as a CGI anywhere, won't have
time to do it and test it until next week probably.


Previous Comments:


[2002-01-12 14:46:54] [EMAIL PROTECTED]

Is still still valid with latest apache and php?



[2001-08-29 12:12:13] [EMAIL PROTECTED]


If PHP is used as a CGI program via:
Action php-script /cgi-bin/php
AddHandler php-script .php .php3

any .php page which is not found results in 500 SERVER ERROR in the
browser instead of 404 NOT FOUND. The php binary is returning nothing
in its response to this situation.

To wit:

The Apache error_log reports "Premature end of script headers"

The script_log (enabled with Apache's ScriptLog directive) reports:
%% [Wed Aug 29 12:09:58 2001] GET /cgi-bin/php/nothere.php HTTP/1.0
%% 500 /usr/local/httpd/cgi-bin/php
%request
Accept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, image/png,
*/*
Accept-Charset: iso-8859-1,*,utf-8
Accept-Encoding: gzip
Accept-Language: en
Connection: Keep-Alive
Host: localhost
User-Agent: Mozilla/4.77 [en] (X11; U; Linux 2.4.6 i686)
%response


###
php was compiled with "'./configure' '--with-mysql=/usr' '--with-gd'
'--with-imagick'   
'--enable-discard-path' '--enable-force-cgi-redirect'"







Edit this bug report at http://bugs.php.net/?id=13035&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 #14897 Updated: "unable to fork" - cause & solution (well, at least for me)

2002-01-17 Thread louis

ID: 14897
User updated by: [EMAIL PROTECTED]
Old Summary: "unable to fork" - cause & solution (well, at least for
me)
Reported By: [EMAIL PROTECTED]
Status: Open
Bug Type: Program Execution
Operating System: Windows 2000
PHP Version: 4.1.1
New Comment:

this is a suggestion to the developers to do, because the only way for
a script writer to solve this is to enabled access to cmd.exe which
many would perfer to not have to do.


Previous Comments:


[2002-01-17 05:56:27] [EMAIL PROTECTED]

clarification: is this a suggestion of a way to fix the problem myself
(so I can call programs), or a suggestion to the developers?



[2002-01-06 22:00:12] [EMAIL PROTECTED]

in 4.0.6, popen() would just call CreateProcess() with the specified
command.

this was ok.

in 4.1.0 popen() now prepends "cmd.exe /c " (or "command.com /c " on
win9x).

the problem with this, is that many web admins will disable access for
the web apps to access cmd.exe (eg, MS's IISLockDown does this), and
hence even though the web app may have access to c:\utils\myapp.exe, a
command like exec("c:\utils\myapp.exe") now fails on 4.1.0 but works on
on 4.0.6.

also, the hardcoding of cmd.exe should not be done.  it should get it
from the enviroment.

summary:

have commands that prepend the result of an enviroment lookup on
"%comspec% /c " to the front of a command

AND

have commands that dont, so that I can call exec("c:\utils\myapp.exe");
 without having to enable access to cmd.exe

OR

any interpretation of these issues, that allow for a sensible amount of
flexibilty.

Louis Solomon
www.SteelBytes.com







Edit this bug report at http://bugs.php.net/?id=14897&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] Feature Suggestion

2002-01-17 Thread Mike Eheler

If this is the wrong place for it, please point me to the right place. 
This is real small, though.. I'd like to see a shorthand for defining 
arrays.. for example

$ucase_alphabet = array(['A'..'Z']); (creates an array of all alphabet 
characters, uppercase)
$numeric = array([1..100]);

Or something of that sort. Just something that popped into my mind. PHP 
feels like a language that has been built on little suggestions like 
this, so I thought I'd post it. :)

Mike


-- 
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] karma request for ext/domxml (fwd)

2002-01-17 Thread Christian Stocker

Hi

Posted this to [EMAIL PROTECTED] and got no reply, so here is it again (and i
hope you won't get this twice, since my first attempt a few minutes ago
went to the wrong adress, maybe... it's late :) ):

I'd like to help out with the domxml developement and ask therefor for
karma .)

We use domxml heavily at our office and encounter from time to time bugs
(already submitted some), so i'd like to get more involved into the
developement of domxml and help to get rid of some of these
DOMXML_NOT_IMPLEMENTED() Macros. The libxml library has also some nice
features not yet prototyped and implemented in domxml.  Furthermore I have
a patch, which adds exslt-support for the xslt functions in domxml and
some other little stuff. see http://php.chregu.tv/domxml.diff if you are
interested.

i already have a cvs-account for pear.

thanks and have a nice night :)

chregu



-- 
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] Re: session problems with own session handler in php..

2002-01-17 Thread Yasuo Ohgaki

Robin Ericsson wrote:
> This seems very similar to bug #14880.
> 
> I use a session handler written in php, which I set with
> session_set_save_handler().
> 
> The problem is that my write function never gets called, and data never
> written.
> 
> Variables are not stored when entered into $_SESSION, and I narroved it down
> to one setting.
> 
> register_globals
> 
> with this on, it works, with this off, it doesn't work..
> 
> Yohgaki, I've seen you involved in this, any news of it?
> 
> Oh, btw, I'm using snapshop 2002011712 from snaps.php.net
> 

How did this happen?

I only observed the problem with mm session save handler.
"write" is never called with my build because
PS(http_session_vars) is NULL.

I think you are experiencing similar problem.
If you enable register_globals, it would work
since PS(register_globals) is TRUE.

   If PS(http_session_vars) or PS(register_globals)
   is TRUE, data will be saved.

So far, I have no idea when/how PS(http_session_vars)
became NULL for mm save handler. Now we know there is
a case user save handler might have the same problem :(
-- 
Yasuo Ohgaki


-- 
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 #15092: xml_parse() fails if XML-data contains entity like   or © ...

2002-01-17 Thread bs_php

From: [EMAIL PROTECTED]
Operating system: Win 2k (all I gues)
PHP version:  4.1.0
PHP Bug Type: XML related
Bug description:  xml_parse() fails if XML-data contains entity like   or © 
...

PHP XML-parser has problems with the full iso8859-1 char set when trying to
use entity names. E.g. the parser will fail with "undefined entity" if the
XML data you parse contains   or © a.s.o. (there many more).

Some entities do work, like < > & as well as the alternative
notation unsing the ISO-code number: like non-breaking space  ===   

For a full iso8859-1 list and it's entities see:
http://www.ramsch.org/martin/uni/fmi-hp/iso8859-1.html

Here's the test script you can use to check the error :
 ";
$xmlString[1] = " ";

  function startElement($xml_parser, $name, $attrs) {}
  function endElement($xml_parser, $name) {}
  function characterData($xml_parser, $text) {echo "Handling character
data: '".htmlspecialchars($text)."'";}
  
  $xml_parser = xml_parser_create();
  xml_set_element_handler($xml_parser, "startElement", "endElement");
  xml_set_character_data_handler($xml_parser,  "characterData");
  
  // Parse the XML data.
  if (!xml_parse($xml_parser, $xmlString[1], TRUE)) {
   echo "XML error in given {$source} on line ".
xml_get_current_line_number($xml_parser) . 
'  column ' . xml_get_current_column_number($xml_parser) .
'. Reason:' . xml_error_string(xml_get_error_code($xml_parser));
  }
?>


-- 
Edit bug report at: http://bugs.php.net/?id=15092&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 #15093 Updated: $_FILES and other global array are not documented

2002-01-17 Thread imajes

ID: 15093
Updated by: imajes
Reported By: [EMAIL PROTECTED]
Old Status: Open
Status: Duplicate
Old Bug Type: Website problem
Bug Type: Documentation problem
Operating System: All
PHP Version: 4.1.1
New Comment:

This is being worked on, thanks for the report. :)


Previous Comments:


[2002-01-17 21:21:48] [EMAIL PROTECTED]

The $_FILES array is the worst of these.  Its existence can be deduced
only by looking at the naming scheme of the new arrays versus the old
one (or typing $_FILES in Google!), but it'd be nice to see this nifty
new feature documented.  I figure the main reason people people still
use $postvar instead of $HTTP_POST_VARS['postvar'] is because of
lazyness, so at least $_POST['postvar'] will help wrangle them in the
right direction.  Maybe.

Anyways... here are a couple of places where it would have been nice to
see some info.

http://www.php.net/release_4_1_0.php

http://www.php.net/manual/en/features.file-upload.php

http://www.php.net/manual/en/language.variables.predefined.php

http://www.php.net/manual/en/language.variables.external.php

-Abner





Edit this bug report at http://bugs.php.net/?id=15093&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 #15094: GD2 bugs

2002-01-17 Thread rensx

From: [EMAIL PROTECTED]
Operating system: windows98
PHP version:  4.1.1
PHP Bug Type: GD related
Bug description:  GD2 bugs

When I use GD2 include in the php4.1.1 release package. The function
ImageCopyResized and ImageCopyResampled give colorless output. But Gd
works well.
Sincerely
-- 
Edit bug report at: http://bugs.php.net/?id=15094&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] Re: Computer Science and PHP

2002-01-17 Thread Manuel Lemos

Hello,

Francesco Gallarotti wrote:
> 
> I am a student in a college in NY state. Here we have several servers and
> dozens of courses on computer science. No server is PHP ready and no course
> instructor knows anything about PHP. Why do you think this is happening? I
> really like PHP and I am using it in my personal website to work with some
> text files and a small database. Why PHP is so not popular in the computer
> science teaching area?

IMHO, that is there no marketing effort behind PHP, meaning there is no
Microsoft nor Sun nor any strong brand behind PHP to advertise it.

Even in the Open Source world the PHP credit is relative. For instance
well known publishers on the field like O'Reilly don't seem to care much
about publishing PHP books. I don't know why.

O'Reilly seems to give more credit to Perl and Python than to PHP, but
it is also true that such languages have well organized advocacy groups
while there seems to be no organized advocacy for PHP at all.

Also PHP is only known to be adequate for Web programming niche market
although it can be used as a general purpose programming language. Since
Computer Science courses are for much more than Web programming,
colleges do not see PHP as a good bet for the future of their students.

Unfortunately, in this world when somebody does not know about
something, what is important is not what that "is" but what "seems to
be". So humans seem to give more credit to something that appears often
in many places than something that appears not very much in only one
place. PHP popularity seems to be limited to what it is advertised for
which isn't much as I mentioned above.

So, if you care about PHP credit and consequent success in the Computer
Science world, what shall you do about it?

Well, as an individual you may not be able to do much. But I think there
is plenty of things that can be done to better market PHP so it gets the
necessary recognition to appear in Computer Science curriculum.

In the past I made several suggestions to PHP developers in order to
improve PHP recognition not only in colleges but also in companies that
are not aware of the capabilities of PHP. If companies are not made
aware of PHP capabilities, that reduces the chances of employment of
people like everybody here that would like to keep working on PHP and
you may be forced by the circumstances to work with other more accepted
languages in the labour market.

Unfortunately, my suggestions were not considered seriously, meaning
either people present then either not agree with the suugestions or
simply nothing seems to have been done in that direction.

I don't want to bring back the discussion of the merits of the
suggestions, but rather to remind them for people that were not present
or not paying attention to consider them and maybe who knows does
something about it. So what I suggested was something more os less like
this:

- Promote contests of PHP applications or components. The Python
community does this and it seems to be getting the attention of the
computing media. This leads to an obvious greater exposure of the
language to the computing community that does not know it while it
promotes the development of more and better applications and components.

- Promote a banner exchange/Web ring between all sites that promote PHP
related materials: articles, components, applications, etc.. This would
give a greater sense of the wide support that users that adhere to PHP
may find. Somebody objected because it would be hard to tell which sites
provide a reasonable level of quality. I think this could be sorted by
providing a way for users to vote on each of the sites. The results of
the votes would be shown in the banners to advise about their quality.

- Seek deals with offline and online computing specialized media to
assure that PHP gets exposure in the exchange for banner advertisement.
People that are not aware of PHP often learn from those media. PHP
exposure could be a space for letting qualified writers write articles
that would let readers of those media be aware of PHP capabilities
especially for the people that are not aware of PHP credits because
those are the most important people that PHP marketing should target
because you may find many decision makers among them. Decision makers
often decide whether tecnologies should or not be used in companies or
included in college curriculum.

I have more ideias but this is just to illustrate how PHP can be
marketed without necessarily spending money on the efforts. Of course my
ideias are not the only ones that would work and not necessarily the
best. Anybody can bring more ideias but what is really important is that
something gets done.

I am crossposting this to php-dev because I think that the most
important people that can do something about this are there. If you
don't agree that this topic makes sense in that list, just don't
follow-up in there.

Regards,
Manuel Lemos

-- 
PHP Development Mailing List 

[PHP-DEV] [PATCH] --enable-safe-mode is broken

2002-01-17 Thread Yasuo Ohgaki

Hi all,

It seems "--enable-safe-mode" is broken for a long time...
I'm not sure if this patch is valid/ok to commit.

Let me know if you object this patch  :)

-- 
Yasuo Ohgaki



Index: main.c
===
RCS file: /repository/php4/main/main.c,v
retrieving revision 1.418
diff -u -r1.418 main.c
--- main.c  10 Jan 2002 16:00:08 -  1.418
+++ main.c  18 Jan 2002 02:29:05 -
@@ -231,7 +231,11 @@
STD_PHP_INI_ENTRY("output_handler", NULL,   
PHP_INI_PERDIR|PHP_INI_SYSTEM,OnUpdateString,   output_handler, 
php_core_globals,   core_globals)
STD_PHP_INI_BOOLEAN("register_argc_argv",   "1",PHP_INI_ALL,   
 OnUpdateBool,   register_argc_argv, 
php_core_globals,   core_globals)
STD_PHP_INI_BOOLEAN("register_globals", "1",PHP_INI_ALL,   
 OnUpdateBool,   register_globals,   
php_core_globals,   core_globals)
+#if PHP_SAFE_MODE
+   STD_PHP_INI_BOOLEAN("safe_mode","1",
+PHP_INI_SYSTEM, OnUpdateBool,   safe_mode,
+  php_core_globals,   core_globals)
+#else
STD_PHP_INI_BOOLEAN("safe_mode","0",
PHP_INI_SYSTEM, OnUpdateBool,   safe_mode, 
 php_core_globals,   core_globals)
+#endif
STD_PHP_INI_ENTRY("safe_mode_include_dir",  NULL,   
PHP_INI_SYSTEM, OnUpdateString, safe_mode_include_dir,  
php_core_globals,   core_globals)
STD_PHP_INI_BOOLEAN("safe_mode_gid","0",
PHP_INI_SYSTEM, OnUpdateBool,   safe_mode_gid, 
 php_core_globals,   core_globals)
STD_PHP_INI_BOOLEAN("short_open_tag",DEFAULT_SHORT_OPEN_TAG,
PHP_INI_SYSTEM|PHP_INI_PERDIR,  OnUpdateBool,   short_tags,
 zend_compiler_globals,  compiler_globals)



-- 
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]


RE: [PHP-DEV] Re: Computer Science and PHP

2002-01-17 Thread James Cox

Manuel,

I have replied inline with a few comments that kind of reply in some way to
what you said:


> IMHO, that is there no marketing effort behind PHP, meaning there is no
> Microsoft nor Sun nor any strong brand behind PHP to advertise it.
>
Microsoft make $xxx BILLION dollars a year SELLING their software.
Sun make $xxx BILLION dollars a year SELLING their software.

Both, by coincedence release free software, such as API's and SDK's.

the PHP Group (and the PHP community) make $000 a year GIVING AWAY our
software.

however, we get more usage than ASP/Microsoft servers, and Java only beats
us because it has been around for longer.

I note that sun don't promote java as they used to anymore... they don't
particularly need too. Like Oracle.

> Even in the Open Source world the PHP credit is relative.

in ANY world these days, ANY computing credit is relative. There are so few
universally agreed standards that certification becomes almost worthless,
because it becomes harder to work out how good the person behind the paper
really is (but alas, we all take the exams)


> For instance
> well known publishers on the field like O'Reilly don't seem to care much
> about publishing PHP books. I don't know why.
> O'Reilly seems to give more credit to Perl and Python than to PHP, but
> it is also true that such languages have well organized advocacy groups
> while there seems to be no organized advocacy for PHP at all.
>

Erm,. O'Reilly and Perl have a long standing friendship, first of all. I
hear Tim O'Reilly and Larry Wall are good friends.

That said, O'Reilly have one book on the shelves (Rasmus' reference guide)
and a further one i believe at post - edit stage.

They also have my proposal under consideration for a further php book. (And
ARE INTERESTED)


> Also PHP is only known to be adequate for Web programming niche market
> although it can be used as a general purpose programming language. Since
> Computer Science courses are for much more than Web programming,
> colleges do not see PHP as a good bet for the future of their students.

ERM, PHP is now a leading programming language for several major sites.
sourceforge.net, freshmeat.net,  www.alltheweb.com , livebid.amazon.com,
www.knowone.de , audiogalaxy.com are just some which manage huge hits.

Also, PHP as a CLI is coming into it's own, but obviously when PHP was first
imagined, the CLI approach would have been a distant dream.

> Unfortunately, in this world when somebody does not know about
> something, what is important is not what that "is" but what "seems to
> be". So humans seem to give more credit to something that appears often
> in many places than something that appears not very much in only one
> place. PHP popularity seems to be limited to what it is advertised for
> which isn't much as I mentioned above.

www.php.net/usage.php
www.php.net/usage.php
www.php.net/usage.php

Q E D.


> So, if you care about PHP credit and consequent success in the Computer
> Science world, what shall you do about it?
>
> Well, as an individual you may not be able to do much. But I think there
> is plenty of things that can be done to better market PHP so it gets the
> necessary recognition to appear in Computer Science curriculum.

Wear PHP.net T Shirts. Give out mousemats. Or just simply make a good
quality php web application in which people visit. That way you'll soon find
people asking how you did it, and they'll start using php too. Open Source
doesn't need huge advertising dollars spent on it. It just has to be damn
good and withstand the scrutiny of our peers.


> In the past I made several suggestions to PHP developers in order to
> improve PHP recognition not only in colleges but also in companies that
> are not aware of the capabilities of PHP. If companies are not made
> aware of PHP capabilities, that reduces the chances of employment of
> people like everybody here that would like to keep working on PHP and
> you may be forced by the circumstances to work with other more accepted
> languages in the labour market.

REAL Job advertisement:

PHP Developer
Fast growing company specialised in Internet is urgently looking for an
experienced PHP Developer to join young, multinational team. Knowledge of
other programming languages fe Java, Oracle, would be an advantage but the
most important thing is that you have good knowledge and experience in PHP
development. Fluent German speaking is essential.
Type: Permanent Location: Frankfurt, Germany Start: ASAP Posted:  16/01/2002
18:42:20 Reference: JS/3780/SAB

or see
http://www.it.jobserve.com/jobserve/searchresults.asp?jobType=*&d=5&order=Ra
nk&page=1&q=php

To have over 100 jobs in this difficult market place in the UK right now for
php developers can only show the need for php in the market place today.

> - Promote contests of PHP applications or components. The Python
> community does this and it seems to be getting the attention of the
> computing media. This leads to an obvious greater exposure o

[PHP-DEV] Bug #14453 Updated: session_start() provokes a crash of php/apache

2002-01-17 Thread nohn

ID: 14453
Updated by: nohn
Reported By: [EMAIL PROTECTED]
Status: Critical
Bug Type: Session related
Operating System: win2k
PHP Version: 4.1.0
New Comment:

Reproduced this Crash with PHP 4.1.1 (www.php4win.com) and Apache
1.3.22 on Windows NT 4 Server.


Previous Comments:


[2002-01-17 13:26:50] [EMAIL PROTECTED]

changing the path fixes the crash problem when session.save_handler is
set to 'files'... but what causes the crash when it is set to  'user' ?



[2002-01-12 06:34:10] [EMAIL PROTECTED]

A suggestion to help reduce this error:
In future releases php.ini-dist's session.save_path should contain the
value of c:\php\temp\ or something and not "/tmp" which does not exist
on Windows platforms!



[2001-12-22 11:31:30] [EMAIL PROTECTED]

Reproduced with the final 4.1.0 on Windows 2000 with Apache 1.3.22.



[2001-12-14 09:16:48] [EMAIL PROTECTED]

hi

I found the cause for these crashes:
If in the php.ini is a wrong path for the session files, php crashes
without further notice, whereas php 4.0.6 reported this when trying to
start a session with session_start():

Warning: open(./tmp\sess_7a7c42ff822a8016bb5d7b5625a4bc89, O_RDWR)
failed: m (2) in c:\some\path\file.php on line 7

this should be adressed in a future release, because crashes for such
reasons are not acceptible (even more if an older version behaved
correctly!).

regards
n. fankhauser



[2001-12-12 08:37:28] [EMAIL PROTECTED]



this script will cause php/apache to crash.

used configuration: 
php 4.10 / win32 as SAPI
apache 1.3.20 / win32

unfortunately, I don't have the time now to further investigate the
problem... please contact me if there are any workarounds / solutions
for this problem!

regards
n. fankhauser






Edit this bug report at http://bugs.php.net/?id=14453&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 #12144 Updated: Error in execution operator (`dir .\*.*`)

2002-01-17 Thread nohn

ID: 12144
Updated by: nohn
Old Summary: Error in execution operator (`dir .\*.*`)
Reported By: [EMAIL PROTECTED]
Status: Open
Bug Type: Reproducible crash
Operating System: Windows NT Server 4
PHP Version: 4.0.6
New Comment:

Tried to verify this bug with PHP 4.1.1. PHP did'nt crash. Uses this:


an this:



I don't think the last snippet will crash anything ;)


Previous Comments:


[2001-08-19 23:55:21] [EMAIL PROTECTED]

I mean the following thing:
1. Make a file "bug.php", containing lines
 

2. Install PHP 4.0.6 with php406-installer.exe on WinNT4 Server SP6a +
IE5.5

3. Try to execute command like this:
 php.exe bug.php

4. I've got a message box with the title 
"OleMainThreadWndName: php.exe - Application Error"

When I do this thing with PHP 4.0.5 everything is OK.



[2001-08-19 04:50:22] [EMAIL PROTECTED]

What do you mean by 'crash' here? Does it output any 
error messages?




[2001-07-13 11:18:23] [EMAIL PROTECTED]

I've installed PHP 4.0.6 with Win32 installer (php406-installer.exe).
Using the following code crashes PHP:
 
It works fine in PHP 4.0.5





Edit this bug report at http://bugs.php.net/?id=12144&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] RE: [PHP-CVS] cvs: php4 / README.CVS-RULES

2002-01-17 Thread James Cox

hi Yasuo,

automagically is a phrased used to describe something that's a bit wierd...
like the ChangeLog updating... something that is kinda strange and
complicated that "just works".

I don't think this was a typo... but i cc'ed it to php-dev incase i was
talking baloney.

James

> -Original Message-
> From: Yasuo Ohgaki [mailto:[EMAIL PROTECTED]]
> Sent: Friday, January 18, 2002 6:51 AM
> To: [EMAIL PROTECTED]
> Subject: [PHP-CVS] cvs: php4 / README.CVS-RULES
>
>
> yohgaki   Fri Jan 18 01:51:04 2002 EDT
>
>   Modified files:
> /php4 README.CVS-RULES
>   Log:
>   Fix typo
>
>
> Index: php4/README.CVS-RULES
> diff -u php4/README.CVS-RULES:1.8 php4/README.CVS-RULES:1.9
> --- php4/README.CVS-RULES:1.8 Mon Feb  5 12:11:32 2001
> +++ php4/README.CVS-RULES Fri Jan 18 01:51:04 2002
> @@ -32,7 +32,7 @@
>
>  The next few rules are more of a technical nature.
>
> -   1. DO NOT TOUCH ChangeLog! It is automagically updated from the commit
> +   1. DO NOT TOUCH ChangeLog! It is automatically updated from the commit
>messages every day. Woe be to those who attempt to mess with it.
>
> 2. All news updates intended for public viewing, such as new features,
> @@ -85,7 +85,7 @@
>  # Man, that thing was leaking all over the place!
>  @- Memory leak in trim() function has finally been fixed. (Bob)
>
> -The lines above marked with @ will go into NEWS file
> automagically, and the
> +The lines above marked with @ will go into NEWS file
> automatically, and the
>  # lines will be omitted from the ChangeLog. Alternatively, you might want
>  to modify NEWS file directly and not use the @ lines.
>
>
>
>
> --
> PHP CVS Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>
>


-- 
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 #14143 Updated: Segmentation fun

2002-01-17 Thread lobbin

ID: 14143
Updated by: lobbin
Reported By: [EMAIL PROTECTED]
Old Status: Open
Status: Feedback
Bug Type: Apache2 related
Operating System: SuSE7.1
PHP Version: 4.0CVS-2001-11-20
New Comment:

Teo: Can you download a CVS snapshot, and see if it works?

http://snaps.php.net


Previous Comments:


[2002-01-17 13:44:09] [EMAIL PROTECTED]

to solve the problem related to cgi var setting (PATH_INFO and so on)
you need the latest cvs, the one in 4.1.1
has bugs (at least when used with apache-2.0.28).

Roberto.



[2002-01-17 13:27:12] [EMAIL PROTECTED]

Tested again on Mandrake8.1 / php-4.1.1 / Apache-2.0.28-beta.
for a page like i.php/something the PATH_INFO still doesn't get set,
but least it doesn't segfault anymore.

PHP config line: --with-apxs2=/usr/local/apache2/bin/apxs --with-mysql
--with-dom --disable-posix --disable-pic --with-zlib --enable-wddx
--enable-debug





[2002-01-17 06:01:00] [EMAIL PROTECTED]

Does the same happen on 4.1.1 or current CVS?



[2001-11-20 06:49:34] [EMAIL PROTECTED]

related to #12691

Configuration: same as in #12691 except Apache is using prefork mpm.

The request: GET /i.php/a

Backtrace and request info are:

Program received signal SIGSEGV, Segmentation fault.
0x4004bb1e in apr_palloc (a=0x813e4cc, reqsize=10) at apr_pools.c:1214
1214first_avail = blok->h.first_avail;
(gdb) bt
#0  0x4004bb1e in apr_palloc (a=0x813e4cc, reqsize=10) at
apr_pools.c:1214
#1  0x80910d8 in add_any_filter (name=0x80aac34 "BYTERANGE", ctx=0x0,
r=0x813e51c, c=0x813a5cc, reg_filter_set=0x80ca19c,
r_filters=0x813e688,
c_filters=0x813a610) at util_filter.c:151
#2  0x809131f in ap_add_output_filter (name=0x80aac34 "BYTERANGE",
ctx=0x0,
r=0x813e51c, c=0x813a5cc) at util_filter.c:201
#3  0x8069f67 in ap_http_insert_filter (r=0x813e51c) at
http_core.c:310
#4  0x809ca63 in ap_run_insert_filter (r=0x813e51c) at request.c:120
#5  0x809d23d in ap_process_request_internal (r=0x813e51c) at
request.c:279
#6  0x806f779 in ap_process_request (r=0x813e51c) at
http_request.c:284
#7  0x8069e96 in ap_process_http_connection (c=0x813a5cc) at
http_core.c:289
#8  0x808f2f7 in ap_run_process_connection (c=0x813a5cc) at
connection.c:82
#9  0x808f58d in ap_process_connection (c=0x813a5cc) at
connection.c:219
#10 0x80804bc in child_main (child_num_arg=0) at prefork.c:803
#11 0x80805b3 in make_child (s=0x80cae44, slot=0) at prefork.c:839
#12 0x8080725 in startup_children (number_to_start=1) at prefork.c:913
#13 0x8080c45 in ap_mpm_run (_pconf=0x80c9cec, plog=0x80fde8c,
s=0x80cae44)
at prefork.c:1129
#14 0x8087ce6 in main (argc=2, argv=0xb674) at main.c:432


(gdb) f 3
#3  0x8069f67 in ap_http_insert_filter (r=0x813e51c) at
http_core.c:310
310 ap_add_output_filter("BYTERANGE", NULL, r,
r->connection);
(gdb) p *r
$8 = {pool = 0x813e4ec, connection = 0x813a5cc, server = 0x80cae44,
  next = 0x0, prev = 0x0, main = 0x0,
  the_request = 0x813ecac "GET /i.php/a HTTP/1.1", assbackwards = 0,
  proxyreq = 0, header_only = 0, protocol = 0x813ecfc "HTTP/1.1",
  proto_num = 1001, hostname = 0x813ef6c "teo",
  request_time = 1006255730034262, status_line = 0x0, status = 200,
  method = 0x813ecc4 "GET", method_number = 0, allowed = 0,
  allowed_xmethods = 0x0, allowed_methods = 0x813e694, sent_bodyct =
0,
  bytes_sent = 0, mtime = 0, chunked = 0, boundary = 0x0, range = 0x0,
  clength = 0, remaining = 0, read_length = 0, read_body = 0, 
read_chunked = 0, expecting_100 = 0, headers_in = 0x813e6c4,
  headers_out = 0x813ea14, err_headers_out = 0x813ea8c,
  subprocess_env = 0x813e86c, notes = 0x813eacc,
  content_type = 0x813f604 "application/x-httpd-php", handler = 0x0,
  content_encoding = 0x0, content_languages = 0x0, vlist_validator =
0x0,
  user = 0x0, ap_auth_type = 0x0, no_cache = 0, no_local_copy = 0,
  unparsed_uri = 0x813ecdc "/i.php/a", uri = 0x813ecec "/i.php/a",
  filename = 0x813f1d4 "/usr/local/apache2/htdocs/i.php",
  canonical_filename = 0x813f0e4 "/usr/local/apache2/htdocs/i.php/a",
  path_info = 0x813f133 "/a", args = 0x0, finfo = {cntxt = 0x813e4ec,
valid = 7598448, protection = 1604, filetype = APR_REG, user = 0,
group = 0, inode = 314593, device = 773, nlink = 1, size = 17,
csize = 24,
atime = 100625296900, mtime = 99740411000,
ctime = 99740411000,
fname = 0x813f1d4 "/usr/local/apache2/htdocs/i.php",
name = 0x80c23cc "O,\f\b", filehand = 0x13f0e4}, parsed_uri = {
scheme = 0x0, hostinfo = 0x0, user = 0x0, password = 0x0, hostname
= 0x0,
port_str = 0x0, path = 0x813ecec "/i.php/a", query = 0x0, fragment
= 0x0,
hostent = 0x0, port = 0, is_initialized = 1, dns_looked_up = 0,
dns

[PHP-DEV] Re: [PHP-CVS] cvs: php4 / README.CVS-RULES

2002-01-17 Thread Yasuo Ohgaki

James Cox wrote:
> hi Yasuo,
> 
> automagically is a phrased used to describe something that's a bit wierd...
> like the ChangeLog updating... something that is kinda strange and
> complicated that "just works".
> 
> I don't think this was a typo... but i cc'ed it to php-dev incase i was
> talking baloney.
> 
> James

Oh. Really, I didn't know that. Please tell me if I need to revert it :)

-- 
Yasuo Ohgaki


-- 
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]




RE: [PHP-DEV] Re: [PHP-CVS] cvs: php4 / README.CVS-RULES

2002-01-17 Thread James Cox

Well,

i recognise it from other things, but it could be a spelling mistake here
too :)

I would wager on waiting for other developers to notice this... not that's
particularly important.

James

> -Original Message-
> From: Yasuo Ohgaki [mailto:[EMAIL PROTECTED]]
> Sent: Friday, January 18, 2002 7:05 AM
> To: [EMAIL PROTECTED]; James Cox
> Cc: Yasuo Ohgaki
> Subject: [PHP-DEV] Re: [PHP-CVS] cvs: php4 / README.CVS-RULES
>
>
> James Cox wrote:
> > hi Yasuo,
> >
> > automagically is a phrased used to describe something that's a
> bit wierd...
> > like the ChangeLog updating... something that is kinda strange and
> > complicated that "just works".
> >
> > I don't think this was a typo... but i cc'ed it to php-dev incase i was
> > talking baloney.
> >
> > James
>
> Oh. Really, I didn't know that. Please tell me if I need to revert it :)
>
> --
> Yasuo Ohgaki
>
>
> --
> 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 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]




Re: [PHP-DEV] shmop errors

2002-01-17 Thread Robin Ericsson

On Thu, 2002-01-17 at 21:17, Ilia A. wrote:
> You have the same script try open the shm segment 2 times, which is WRONG.
> Here is a proper example of what you should be doing:
> 
>define("SHMKEY", 0xDEAD);
>   define("SEMKEY", 0xCAFE);
> 
>   if( !($shm_id = shmop_open(SHMKEY, 'c', 0644,10)) ) {
>   exit("Segment already exists and you do not have write permissions to 
>it, 
> or you cannot create a new segment\n");
>   }
>   $data = shmop_read($shm_id, 0, shmop_size($shm_id));
>   shmop_close($shm_id);
>   echo $data."\n";
> ?>

Well, I know this was bad code, but I pasted code from two different
scripts, and the script I made was short and displayed the problem, so I
think it will do for that purpose :)

> 
> I've also committed the patch to CVS that should eliminate the warning 
> message. I wonder why Zend required strings with defined length to be null 
> terminated, sounds like a recipe for disaster, if the length is known it 
> should be used. But, whatever, please try the latest CVS.

Yes, I sent this to the list yesterday, and I can verify it works with
the latest CVS.

Thanks.


-- Robin


-- 
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] README.QNX (Removing? or someone is willing to maintain?)

2002-01-17 Thread Yasuo Ohgaki

Hi all,

README.QNX is obsolete. It should be removed or maintained.
Is it ok to remove it? (If nobody is going to update)

Or I should create new directory "doc" or "docs" to keep
these README.*, etc?

PS: May be we should add $Id$ to text files also.

-- 
Yasuo Ohgaki


-- 
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]




Re: [PHP-DEV] Re: session problems with own session handler in php..

2002-01-17 Thread Robin Ericsson

On Fri, 2002-01-18 at 03:00, Yasuo Ohgaki wrote:
> Robin Ericsson wrote:
> > This seems very similar to bug #14880.
> > 
> > I use a session handler written in php, which I set with
> > session_set_save_handler().
> > 
> > The problem is that my write function never gets called, and data never
> > written.
> > 
> > Variables are not stored when entered into $_SESSION, and I narroved it down
> > to one setting.
> > 
> > register_globals
> > 
> > with this on, it works, with this off, it doesn't work..
> > 
> > Yohgaki, I've seen you involved in this, any news of it?
> > 
> > Oh, btw, I'm using snapshop 2002011712 from snaps.php.net
> > 
> 
> How did this happen?
> 
> I only observed the problem with mm session save handler.
> "write" is never called with my build because
> PS(http_session_vars) is NULL.
>
> I think you are experiencing similar problem.
> If you enable register_globals, it would work
> since PS(register_globals) is TRUE.

Yes, it works with register_globals.

>If PS(http_session_vars) or PS(register_globals)
>is TRUE, data will be saved.
> 
> So far, I have no idea when/how PS(http_session_vars)
> became NULL for mm save handler. Now we know there is
> a case user save handler might have the same problem :(

Well, as for me, with some checking I did yesterday when I did my first
post. In the beginning of the script print_r($_SESSION); returns
nothing, but after settings some values, print_r returns it an
associated array.

Never tested on HTTP_SESSION_VARS though, should there be a difference?

I might have to time to do some more checking/debug later tonight.



-- Robin


-- 
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]




Re: [PHP-DEV] Re: session problems with own session handler in php..

2002-01-17 Thread Yasuo Ohgaki

Robin Ericsson wrote:
> On Fri, 2002-01-18 at 03:00, Yasuo Ohgaki wrote:
> 
>>Robin Ericsson wrote:
>>
SNIP
>>   If PS(http_session_vars) or PS(register_globals)
>>   is TRUE, data will be saved.
>>
>>So far, I have no idea when/how PS(http_session_vars)
>>became NULL for mm save handler. Now we know there is
>>a case user save handler might have the same problem :(
>>
> 
> Well, as for me, with some checking I did yesterday when I did my first
> post. In the beginning of the script print_r($_SESSION); returns
> nothing, but after settings some values, print_r returns it an
> associated array.
> 
> Never tested on HTTP_SESSION_VARS though, should there be a difference?

It's the same hash.

> 
> I might have to time to do some more checking/debug later tonight.
> 

Although, I cannot reproduce with simpile script, 
unset($HTTP_SESSION_VARS) also unset $_SESSION. There might be
some reference count problem for PS(https_session_vars).

I hope you can find clue :)
-- 
Yasuo Ohgaki


_
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com


-- 
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]




Re: [PHP-DEV] README.QNX (Removing? or someone is willing to maintain?)

2002-01-17 Thread Derick Rethans

On Fri, 18 Jan 2002, Yasuo Ohgaki wrote:

> README.QNX is obsolete. It should be removed or maintained.
> Is it ok to remove it? (If nobody is going to update)

It's fine as it is. Don't fix something if it isn't broken :) And it
doesn't hurt if it's there.

Derick

-
PHP: Scripting the Web - www.php.net - [EMAIL PROTECTED]
 SRM: Site Resource Manager - www.vl-srm.net
-


-- 
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]




Re: [PHP-DEV] Re: session problems with own session handler in php..

2002-01-17 Thread Derick Rethans

On Fri, 18 Jan 2002, Yasuo Ohgaki wrote:

> > Well, as for me, with some checking I did yesterday when I did my first
> > post. In the beginning of the script print_r($_SESSION); returns
> > nothing, but after settings some values, print_r returns it an
> > associated array.
> >
> > Never tested on HTTP_SESSION_VARS though, should there be a difference?
>
> It's the same hash.

It's not AFAIK

Derick

-
PHP: Scripting the Web - www.php.net - [EMAIL PROTECTED]
 SRM: Site Resource Manager - www.vl-srm.net
-


-- 
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]




Re: [PHP-DEV] Re: session problems with own session handler in php..

2002-01-17 Thread Robin Ericsson

On Fri, 2002-01-18 at 08:29, Derick Rethans wrote:
> On Fri, 18 Jan 2002, Yasuo Ohgaki wrote:
> 
> > > Well, as for me, with some checking I did yesterday when I did my first
> > > post. In the beginning of the script print_r($_SESSION); returns
> > > nothing, but after settings some values, print_r returns it an
> > > associated array.
> > >
> > > Never tested on HTTP_SESSION_VARS though, should there be a difference?
> >
> > It's the same hash.
> 
> It's not AFAIK
> 

Using $HTTP_SESSION_VARS["session_var"] does no difference from using
$_SESSION, as far as I can see..

Another question, if I set session vars during a script, should they be
visible in phpinfo() then?


-- Robin


-- 
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]




Re: [PHP-DEV] htmlspecialchars() alias

2002-01-17 Thread Jason G.

At 08:52 PM 1/17/2002 +0100, you wrote:
>Hi,
>
> > After typing the 16 characters in the htmlspecialchars() function 
> thousands
> > of times...
>
>When you have to type it 16 times, then you did something wrong.
>Consider this:

Apparently, you either I grossly mistyped what I wanted to say, or you 
misread it, or you never coded much in php.

>foreach($_GLOBAL as $key => $val)
>   $$key = htmlspecialchars($val);
>
>Replace $_GLOBAL by $_COOKIES, $_GET, .. OR you could just group
>together variables:
>
>   
>
>and go through $form in your script.

It has nothing to do with forms.  I handle forms in a very efficient, 
object oriented way.

> > I was wondering if it would be feasible to create an alias for this
> > function, say hsc() or something short.
>
> > [..]
>
> > It is no big deal, but for a function that is used ALL THE TIME, it would
> > be nice.
>
>why do something in C, when it can be done in PHP so nicely:
>
>function hsc(&$var) {
>   $var = htmlspecialchars($var);
>}

Maybe you ought to coding guidelines on zend.com which EXPLICITLY state 
that the above practice is BAD.

>Alias are terrible. The decrease readability of your code. Actually
>doing hsc() in PHP is compareable silly.

What I am trying to find out here is if it would be feasible to implement 
the alias in C, so there is not performance loss, and so it makes every 
ones lives just a little bit easier.


>Kind Regards,
>   Daniel Lorch
>--
>@echo "Hello, World";


Best Regards,
Jason Garber


-- 
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]




Re: [PHP-DEV] Re: session problems with own session handler in php..

2002-01-17 Thread Yasuo Ohgaki

Derick Rethans wrote:
> On Fri, 18 Jan 2002, Yasuo Ohgaki wrote:
> 
> 
>>>Well, as for me, with some checking I did yesterday when I did my first
>>>post. In the beginning of the script print_r($_SESSION); returns
>>>nothing, but after settings some values, print_r returns it an
>>>associated array.
>>>
>>>Never tested on HTTP_SESSION_VARS though, should there be a difference?
>>>
>>It's the same hash.
>>
> 
> It's not AFAIK
> 


It should be or I'm missing something :)

MAKE_STD_ZVAL(PS(http_session_vars));
array_init(PS(http_session_vars));
ZEND_SET_GLOBAL_VAR_WITH_LENGTH("HTTP_SESSION_VARS", 
sizeof("HTTP_SESSION_VARS"), PS(http_session_vars), 1, 0);
ZEND_SET_GLOBAL_VAR_WITH_LENGTH("_SESSION", sizeof("_SESSION"), 
PS(http_session_vars), 1, 0);
-- 
Yasuo Ohgaki


-- 
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]




Re: [PHP-DEV] README.QNX (Removing? or someone is willing to maintain?)

2002-01-17 Thread Yasuo Ohgaki

Derick Rethans wrote:
> On Fri, 18 Jan 2002, Yasuo Ohgaki wrote:
> 
> 
>>README.QNX is obsolete. It should be removed or maintained.
>>Is it ok to remove it? (If nobody is going to update)
>>
> 
> It's fine as it is. Don't fix something if it isn't broken :) And it
> doesn't hurt if it's there.
> 

Ok. I'll leave it alone :)
I'm just trying to clean up things a little.

How about apidoc.txt and apidoc-zend.txt?
It's still useful, but it's harmful also.

What do you think?

-- 
Yasuo Ohgaki


-- 
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]