[PHP-DEV] Small change in Apache2

2002-02-28 Thread Teodor Cimpoesu

Hi,
Apache 2.0.32 changed the prototype of ap_get_brigade.
To make php4.1.2 compile w/ it I had to do:

--- sapi_apache2.c.orig Thu Feb 28 15:52:54 2002
+++ sapi_apache2.c  Thu Feb 28 15:53:03 2002
@@ -244,7 +244,7 @@
 
INIT_CTX;
 
-   if ((rv = ap_get_brigade(f->next, bb, mode, readbytes)) != APR_SUCCESS) {
+   if ((rv = ap_get_brigade(f->next, bb, mode, APR_BLOCK_READ, readbytes)) != 
+APR_SUCCESS) {
return rv;
}
 

-- teodor

-- 
PHP Development Mailing List 
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP-DEV] [pico-diff] Apache2filter compile

2002-01-22 Thread Teodor Cimpoesu


To get it to compile I had to do:

--- sapi_apache2.c.orig Sun Jan 20 20:50:40 2002
+++ sapi_apache2.c  Mon Jan 21 12:39:48 2002
@@ -249,14 +249,14 @@
TSRMLS_FETCH();
 
if (f->r->proxyreq) {
-   return ap_get_brigade(f->next, bb, mode, block, readbytes);
+   return ap_get_brigade(f->next, bb, mode, readbytes);
}
 
ctx = SG(server_context);
 
INIT_CTX;
 
-   if ((rv = ap_get_brigade(f->next, bb, mode, block, readbytes)) != APR_SUCCESS) 
{
+   if ((rv = ap_get_brigade(f->next, bb, mode, readbytes)) != APR_SUCCESS) {
return rv;
}
 
-- teodor

-- 
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] Bug #13378 Updated: Auto session start + obejct

2001-12-20 Thread Teodor Cimpoesu

Hi derick!
On Thu, 20 Dec 2001, [EMAIL PROTECTED] wrote:

> ID: 13378
> Updated by: derick
> Reported By: [EMAIL PROTECTED]
> Old Status: Open
> Status: Closed
> Bug Type: Feature/Change Request
> Operating System: Linux
> PHP Version: 4.0.6
> New Comment:
> 
> This is already implemented, we have a undocumented functinno for that, but I can't 
>recall the name now :)
> 
do you mean __sleep() / __wakeup()?

> [2001-12-19 22:44:45] [EMAIL PROTECTED]
> 
> Many users want to unserialize/initilize object after session is started, I suppose.
> 
> Type = Feature Request
> 

-- teodor

-- 
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] Bug #14492: Parse error is appearing in transliterated Hebrew T_PAAMAYIM_NEKUDOTAYIM

2001-12-14 Thread Teodor Cimpoesu

Hi esrig!
On Thu, 13 Dec 2001, [EMAIL PROTECTED] wrote:

> From: [EMAIL PROTECTED]
> Operating system: Linux
> PHP version:  4.1.0
> PHP Bug Type: *Languages/Translation
> Bug description:  Parse error is appearing in transliterated Hebrew 
>T_PAAMAYIM_NEKUDOTAYIM
> 
> I left out some double quotes in the following statement:
>  if (empty($d_value)) {$d_value =  ;}
> 
> This produced the following error message:
> Parse error: parse error, expecting `T_PAAMAYIM_NEKUDOTAYIM' or `'('' in
> /home/esrig/public_html/macweb/tcfocal.php on line 213
> 
> I recognize this as a Hebrew phrase:
> paamayim means two times
> nekudotayim means two punctuations or two vowels
> Probably means missing double quotes
> 
> My question is, why am I getting an error message in Hebrew?
> 
it's not an error message in Hebrew:
http://lxr.php.net/search?string=T_PAAMAYIM_NEKUDOTAYIM
http://www.google.com/search?q=T_PAAMAYIM_NEKUDOTAYIM

It's because of &variable construct, when the `$' in front of variable is left
out. 
I had fun when I first found it too :)

-- teodor

-- 
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] Bug #14489 Updated: DSO PHP module compiling with gettext support is blocking Apache start

2001-12-13 Thread Teodor Cimpoesu

Hi misch!
On Thu, 13 Dec 2001, [EMAIL PROTECTED] wrote:

> ID: 14489
> User updated by: [EMAIL PROTECTED]
> Reported By: [EMAIL PROTECTED]
> Status: Open
> Bug Type: Apache related
> Operating System: Cobalt Raq 3
> PHP Version: 4.1.0
> New Comment:
> 
> I forgot this :
> 
> Apache/1.3.6 (Unix)
> 
> And I used RPM of gettext-0.10.35 and I've also tried to compile version 0.10.40 
>with same result
> 
> Previous Comments:
> 
> 
> [2001-12-13 11:55:19] [EMAIL PROTECTED]
> 
> Hello
> 
> When I configure PHP with these options (including gettext support):
> 
> ./configure --with-mysql=/usr/local/mysql --with-apxs=/usr/sbin/apxs 
>--with-gd=/usr/local --with-jpeg-dir=/usr/local/src/jpeg-6b --with-png-dir=/usr/local 
>--with-zlib=/usr/local --enable-ftp --enable-trans-sid --with-imap=/usr/local 
>--enable-safe-mode --with-gettext=/usr
> 
> 
> Everything is fine (including configuration output and no errors or warnings on 
>compiling) until I try to copy libphp4.so over old one and restart Apache.
> 
> Usualy when I'm restarting apache I can see this:
> 
> Shutting down Web Service: httpd
> Setting up Web Service: Site home has invalid certificate: 4999 Certificate files do 
>not exist.
> Site site7 has invalid certificate: 4999 Certificate files do not exist.
> /usr/sbin/httpd
> 
> 
> but whe I try to restart Apache after module changing I can see this:
> 
> 
> Shutting down Web Service: httpd
> Setting up Web Service: Site home has invalid certificate: 4999 
>ssl_cant_files_missing
> Site site7 has invalid certificate: 4999 ssl_cant_files_missing
I don't think it's from getttext but from ssl.
It looks like Apache cannot find the SSL cert of the server. 
Also, are you sure /usr/sbin/apxs is the apxs of your running Apache ? (by the
location it appears to be installed from rpm).

-- teodor

-- 
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] uhm.. *swallows*.. security thingy?

2001-12-12 Thread Teodor Cimpoesu

Hi Zeev!
On Tue, 11 Dec 2001, Zeev Suraski wrote:

> At 15:23 11/12/2001, Mathieu Kooiman wrote:
> >On Tue, 2001-12-11 at 14:04, Zeev Suraski wrote:
> >> At 12:36 11/12/2001, Mathieu Kooiman wrote:
> >> >On Tue, 2001-12-11 at 11:29, Zeev Suraski wrote:
> >> > > Would the cwd of the PHP CGI be inside the user's dir?  Did you 
> >test it in
> >> > > a real CGI environment?
> >> > >
> >> > > Zeev
> >> >
> >> >Err, PHP CGI would be in /usr/local/bin/php..
> >>
> >> Yeah, but that's not what I asked - I asked about the cwd (current 
> >working
> >> directory :)
> >>
> >
> >There are situaties where you have like:
> >
> >/opt/guide/somesite.com/cgi-bin
> >/opt/guide/somesite.com/htdocs
> >/opt/guide/somesite.com/logs
> >
> >cgi-bin and htdocs (2 possible cwds) are under user control.
> 
> Yes, I know :)  The big question is whether PHP, when executed by Apache 
> (as a CGI), starts up in one of these directories, or in Apache's 
> directory.  If it starts in one of these directories - then indeed we have 
> a problem, because it'll search this directory for the php.ini.  If it 
> starts in Apache's directory, then there's no problem.
> 
[rant++]
I don't think it's a problem for a user to make a copy of the php binary
somewhere in any of those dirs, where the cwd at runtime is a writeable dir...

-- teodor

-- 
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] Feature Request: add HTML 4.01 support into DOMXML extension?

2001-12-06 Thread Teodor Cimpoesu

Hi Jaroslaw!
On Wed, 05 Dec 2001, Jaroslaw Kolakowski wrote:

> > But, even if we don't agree with his opinion on templates, what about 
> > the features that libxml provides which are currently unused by PHP, 
> > including HTML 4.01-support (I don't know exactly what libxml can do)? 
> > Are there any plans to make them accessible from PHP? It definately 
> > would be nice.
> 
> It would be nice and it doesn't require much work. I am using PHP-4.0.6 with
> patch, that allows me to parse HTML documents into DOM objects and output
> DOM objects to HTML format. Besides I can use libxslt to process DOM objects
> via XSL stylesheets.  Now I am going to rewrite the new functions after last
> changes in the DOM XML extension - they will use these new pretty macros.
> 
Can you tell more on what that patch is about and it's availability?

-- teodor

-- 
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] Bug #14248: uniqid() is extremely slow (20ms per call)

2001-11-27 Thread Teodor Cimpoesu

Hi bartvb!
On Tue, 27 Nov 2001, [EMAIL PROTECTED] wrote:

> From: [EMAIL PROTECTED]
> Operating system: Linux 2.4.13-ac5
> PHP version:  4.0.5
> PHP Bug Type: Unknown/Other Function
> Bug description:  uniqid() is extremely slow (20ms per call)
> 
> A call to uniqid() seems to take approximately 20ms. In all that time the
> processor seems to be doing absolutely nothing (well, it seems to be
> waiting for something).
> 
> I wrote a convert script which uses uniqid() while testing it it took 40
> seconds to convert 1600 items, without uniqid() the time went down to 3
> seconds.. Quite a remarkable performance boost ;) Especially since the
> script was made to convert around 300.000 items.
> 
I guess it gets entropy from /dev/[u]random, but when it is exhausted it
cannot do much but to wait for more entropy.

Do you have /dev/urandom on that machine? I think urandom stands for
unblocking random (it returns w/o blocking if no entropy is available.)
There are also userspace programs that can gather entropy.

-- teodor

-- 
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] CGI quick cleanup

2001-11-23 Thread Teodor Cimpoesu

Hi Edin!
On Fri, 23 Nov 2001, Edin Kadribasic wrote:

> I have noticed the same problem with a scipt that used a very large array
> (~160 MB). The script run time was around 35 seconds, while it took over 4
> minutes to shut down! Same amount of time was used in trying to unset() the
> array.

[wild guess]
probably the memory deallocation is the one expensive here.

BTW, don't use large arrays in PHP as Apache module cause when the process
grows requesting more memory (brk(2)) it cannot release it back to the
system (because the httpd process is still running).

-- teodor

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

2001-11-20 Thread Teodor Cimpoesu


Hi,
the README sais to set an environ var (or least I undestood so) in order
to debug it, but actually you have to define it (using -D on command line)
for it to work.

The change would be:

--- sapi/apache2filter/README.orig  Tue Nov 20 13:39:56 2001
+++ sapi/apache2filter/README   Tue Nov 20 13:40:35 2001
@@ -48,8 +48,7 @@

 1. Use the Prefork MPM (Apache 1.3-like process model) by
configuring Apache with '--with-mpm=prefork'.
-2. Set the variable "ONE_PROCESS" to 1 and export it before
-   starting Apache/a debugger.
+2. Start httpd with -DONE_PROCESS.

 If you want to debug a part of the PHP startup procedure, set a
 breakpoint on 'load_module'. Step through it until apr_dso_load() is


ciao

-- teodor

-- 
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: Wow ! Good news (to me at least) ...

2001-11-09 Thread Teodor Cimpoesu

Hi August!
On Thu, 08 Nov 2001, August Zajonc wrote:

> Why  not the GPL?
> 
Because it's viral nature? :)

-- teodor

-- 
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] Bug #13871: 'for()'-error using chars as break

2001-10-30 Thread Teodor Cimpoesu

Hi Martin.Schmitz!
On Tue, 30 Oct 2001, [EMAIL PROTECTED] wrote:

> From: [EMAIL PROTECTED]
> Operating system: Linux
> PHP version:  4.0.6
> PHP Bug Type: *Programming Data Structures
> Bug description:  'for()'-error using chars as break 
> 
>  
> for($i='A'; $i<='Z'; $i++){
>   echo $i;
> }

I saw it thousand times... ppl just miss that 
"'a string' is 0 when compared to integers".

try this instead: 
foreach (range(ord('A'),ord('Z')) as $i) echo chr($i);

ciao

-- teodor

-- 
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] popen() on Win32

2001-01-21 Thread Teodor Cimpoesu

Andi Gutmans wrote:
> 
> Hey,
> 
> A couple of guys here said they are working on creating a popen()
> alternative solution for Win32.
> Any progress?
> 

I remembered I wanted to suggest you to take a look on how it is
implemented in
Python. Their docs state: """
popen (command[, mode[, bufsize]]) 

Changed in version 2.0: This function worked unreliably under Windows in
earlier versions of Python. This was due to the use of the _popen()
function from the libraries provided with Windows. Newer versions of
Python do not use the broken implementation from the Windows libraries. 


Python also has popen{2,3,4}(), [ in module os, also there is a popen2
module ].

I took a peek into posixmodule.c (iirc) but didn't figure out from
_PyPopen() how they
do it cause it's a bit over my knowledge :)

One can grab the python2.0 sources and have a look if interested (I
don't have the relevant file at hand).

ciao 

-- teodor

-- 
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] Session, register_globals, $HTTP_SESSION_VARS???

2001-01-17 Thread Teodor Cimpoesu

Hi Andrew!
On Wed, 17 Jan 2001, Andrew Sitnikov wrote:

> Hello ,
> 
> sess.php
>   $var_name = 'TEST_VAR';
> 
>  session_register($var_name);
> 
>  if (isset($HTTP_SESSION_VARS[$var_name])){
>$HTTP_SESSION_VARS[$var_name] ++;
>  }else{
>$HTTP_SESSION_VARS[$var_name] = 0;
>  }
> 
>  echo "\$HTTP_SESSION_VARS[$var_name] : ".$HTTP_SESSION_VARS[$var_name];
> ?>
> 
> Result:
> 
> 
> if register_globals = On
> 
> always : $HTTP_SESSION_VARS[TEST_VAR] : 0
> 
if register_globals is on the variablea aren't stored anymore in
$HTTP_SESSION_VARS but in $GLOBALS.

-- teodor

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