[PHP-DEV] Bug #14164 Updated: variables set in remotely include()d file are lost upon return

2001-11-21 Thread brianlmoon

ID: 14164
Updated by: brianlmoon
Reported By: [EMAIL PROTECTED]
Old Status: Open
Status: Bogus
Bug Type: Scripting Engine problem
Operating System: Linux
PHP Version: 4.0.5
New Comment:

The file that is served remotely is being parsed on that server, not the local one.  
You would have to have the remote server serve .php files as plain text to achieve 
what you want.

Previous Comments:


[2001-11-21 14:35:43] [EMAIL PROTECTED]

When using http to include() or require() a file,
the variables set within are lost when returning
to the calling file. 
Behavior is instead as expected when included or required file is local.

Example:

?php
 
echo phpversion();
 
echo brtry includebr\n;
$test1 = foo;
echo test1 = $test1;
echo brnow including change of test1br;
include(http://192.168.100.3/includechild.php;);
echo broutside: test1 = $test1;
echo brresult:  $result;
 
echo brnow try requirebr\n;
$test2 = foo;
echo test2 = $test2;
echo brnow requiring change of test2br;
require(http://192.168.100.3/requirechild.php;);
echo broutside: test2 = $test2;
?   

includechild.php:  (and similar to requirechild.php)
-

?php
$test1 = bar;
echo Inside: test1 = $test1;
?   

Results:
---

4.0.5
try include
test1 = foo
now including change of test1
Inside: test1 = bar
outside: test1 = foo

now try require
test2 = foo
now requiring change of test2
Inside: test2 = bar
outside: test2 = foo






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


-- 
PHP Development 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-DEV] Bug #14165 Updated: No way to return variables from remote include()

2001-11-21 Thread brianlmoon

ID: 14165
Updated by: brianlmoon
Reported By: [EMAIL PROTECTED]
Old Status: Open
Status: Bogus
Bug Type: Feature/Change Request
Operating System: Linux
PHP Version: 4.0.5
New Comment:

Please do not ask the same question twice in the bug system.

Previous Comments:


[2001-11-21 14:38:39] [EMAIL PROTECTED]

Related to bug 14164:

All workarounds I have tried to pass variable data
back from a remotely include()d or require()d
script have failed.

Arrays and strings don't appear to be passed back in
the include()'s return value, it will only pass back
integers.

If anyone sees another way to do this please help!

I will keep looking and post a followup here and to the
manual if I find a workaround.

Steve Rapaport





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


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

2001-10-30 Thread brianlmoon

ID: 13871
Updated by: brianlmoon
Reported By: [EMAIL PROTECTED]
Old Status: Open
Status: Bogus
Bug Type: *Programming Data Structures
Operating System: Linux
PHP Version: 4.0.6
New Comment:

The ++ only works with numeric variables.  Try the example that was emailed to you.

Previous Comments:


[2001-10-30 09:15:49] [EMAIL PROTECTED]

?PHP

for($i='A'; $i='Z'; $i++){
  echo $i;
}

?

// I hoped to see 'A B CY Z'





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


-- 
PHP Development 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-DEV] Bug #11985 Updated: BUG with parse_str

2001-07-10 Thread brianlmoon

ID: 11985
Updated by: brianlmoon
Reported By: [EMAIL PROTECTED]
Old Status: Feedback
Status: Bogus
Bug Type: URL related
Operating System: SOLARIS 2.8
PHP Version: 4.0.6
New Comment:

The user was using parse_str on $QUERY_STRING which caused the $delete array to have 4 
entries.

Brian.

Previous Comments:


[2001-07-09 14:37:55] [EMAIL PROTECTED]

Perhaps showing us the complete script and output would help.  With what you have 
here, I can make no sense of your problem.  That URL could not have been generated by 
that form as there are no [] in it.

Thanks,

Brian.



[2001-07-09 13:17:46] [EMAIL PROTECTED]

It seems to be a mistake with the function parse_str() applyed to $QUERY_STRING.

URL: http://mycomputer/myscript?delete=10delete=12

HTML CODE:
Input type=checkbox name=delete[] value=10
Input type=checkbox name=delete[] value=12

And (not the winner is :-) ) parse_str($QUERY_STRING) returns in the environment an 
array $delete with a size of 4 (instead of 2) !! Some programmer forget to divide a 
result by 2, or there is something I forget ?

(TEST : $i=0; while (isset($delete)) { print $delete[$i]\n; $i++ } ... I obtain 4 
writings with this test (i wanted not use the sizeof function for my test)).

Regards





ATTENTION! Do NOT reply to this email!
To reply, use the web interface found at http://bugs.php.net/?id=11985edit=1


-- 
PHP Development 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-DEV] Bug #12008 Updated: mysql_fetch_* inconsistent with MySQL C API

2001-07-10 Thread brianlmoon

ID: 12008
Updated by: brianlmoon
Reported By: [EMAIL PROTECTED]
Old Status: Open
Status: Closed
Bug Type: Feature/Change Request
Operating System: RedHat 6.2
PHP Version: 4.0.6
New Comment:

In PHP setting a var to NULL in fact destroys that var so it is not currently possible 
to have an elelment in an array that has a NULL value.

On a side note, if you read the MySQL optimization docs, you will find they reccommend 
you never use NULL fields.

Brian.

Previous Comments:


[2001-07-10 09:14:34] [EMAIL PROTECTED]

fetch_array, in recent versions (4.0.6 inclusive) should actrually populate NULL 
values in the array.  Are you sure you tested it with 4.0.6?  How did you arrive to 
the conlusion they're not there?




[2001-07-10 09:08:13] [EMAIL PROTECTED]

The handling of NULL values in mysql_fetch_* function seems to be inconsistent with 
MySQL C API:
in C, mysql_fetch_row() would put nil values in the row array if corresponding value 
in the select statement is NULL.
In PHP it seems, as dicussed on mysql_fetch_array() page, the NULL values would not be 
stored in the array at all.
This poses some problems when migrating from C to PHP. Would it be possible to 
introduce another function that would be consistent with MySQL C API? 






ATTENTION! Do NOT reply to this email!
To reply, use the web interface found at http://bugs.php.net/?id=12008edit=1


-- 
PHP Development 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-DEV] Bug #12023 Updated: mysql_result moves the data pointer forward one row.

2001-07-10 Thread brianlmoon

ID: 12023
Updated by: brianlmoon
Reported By: [EMAIL PROTECTED]
Old Status: Open
Status: Bogus
Bug Type: MySQL related
Operating System: 
PHP Version: 4.0.6
New Comment:

not a bug.

Previous Comments:


[2001-07-10 14:45:44] [EMAIL PROTECTED]

mysql_result moves the data pointer forward one row. i would expect mysql_fetch_row 
(or similar) to move the row pointer / cursor forward, but not mysql_result.





ATTENTION! Do NOT reply to this email!
To reply, use the web interface found at http://bugs.php.net/?id=12023edit=1


-- 
PHP Development 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-DEV] Bug #11980 Updated: problem with forms

2001-07-09 Thread brianlmoon

ID: 11980
Updated by: brianlmoon
Reported By: [EMAIL PROTECTED]
Old Status: Open
Status: Feedback
Bug Type: Unknown/Other Function
Operating System: windows
PHP Version: 4.0.6
New Comment:

We would need to see your code to determine the problem.  At first thought, it sounds 
like you might not have  around the values in your option tags.

Brian.

Previous Comments:


[2001-07-09 10:58:43] [EMAIL PROTECTED]

i am using a combobox autocompleted by a mysql database uith citys. ex buenos aires 
(is one city with 2 names separated by 1 space). when the form is submited the 
variable is contening only the first name like buenos in my ex. why is this hapening? 
how can i fix that?





ATTENTION! Do NOT reply to this email!
To reply, use the web interface found at http://bugs.php.net/?id=11980edit=1


-- 
PHP Development 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-DEV] Bug #11963 Updated: while using mail function offline, windows does not pick up an internet request

2001-07-08 Thread brianlmoon

ID: 11963
Updated by: brianlmoon
Reported By: [EMAIL PROTECTED]
Old Status: Open
Status: Bogus
Bug Type: Mail related
Operating System: win98se
PHP Version: 4.0.4pl1
New Comment:

You are experiencing the lag of PHP trying to send mail through and SMTP server.  This 
is common on Windows systems where mail is relying on an external server.

Previous Comments:


[2001-07-08 23:25:54] [EMAIL PROTECTED]

i am a basic user of php. i have done some programming (about 3 internt coding,2 in 
pascal and 1 in c++) while php is trying to send the mail, it makes ie stop responding 
to any internt connection.

i did a basic install, i have not changed anything in the php.ini file except for the 
mail smpt. i am running php off of apache and i have installed mysql. (i have not 
gotten as far as configuring it)

i am working off an dial up.

the script is easy

//stat script
if (mail([EMAIL PROTECTED],Just some text,losts of good stuff,From: 
[EMAIL PROTECTED])) echo your mail has been sent!;
else echo your mail has not been sent!;
//end script





ATTENTION! Do NOT reply to this email!
To reply, use the web interface found at http://bugs.php.net/?id=11963edit=1


-- 
PHP Development 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-DEV] Bug #11909 Updated: Object Copied By Reference!!

2001-07-05 Thread brianlmoon

ID: 11909
Updated by: brianlmoon
Reported By: [EMAIL PROTECTED]
Old-Status: Open
Status: Bogus
Bug Type: Scripting Engine problem
Operating system: 
PHP Version: 4.0.6
Assigned To: 
Comments:

This is expected behavior.  You are assuming that the object you had in $obj2 should 
be gone when you copy $obj to that var.  That is not the case.  It only changes what 
$obj2 points to.  Take this case:

$var=3;
$var2=$var;
unset($var);
echo $var2;

$var2 is still 3.  The reference is gone but not the value of the var.  That is what 
makes references nice.

Brian.

Previous Comments:
---

[2001-07-05 10:54:01] [EMAIL PROTECTED]

When objects that contain objects that are referenced
elsewhere, they are not correctly dereferenced, and strange
side effects result

class Foo{
  var $a;
  function Foo($value)
{
  $this-set($value);
}
  function set($value)
{
  $this-a = $value;
}
  function get()
{
  return $this-a;
}
}
class Bar{
  var $a;
  function Bar($value)
{
  $this-a = new Foo($value);
}
  function set($value)
{
  $this-a-set($value);
}
  function get()
{
  return $this-a-get();
}
  function share($other)
{
  $this-a =  $other-a;
}
}

//Objects are initialized
$obj = new Bar(1);
$obj2 = new Bar(2);

//$obj and $obj2 both contain an internal reference to the
//same Foo object, with a value of 2
$obj-share($obj2);

//$obj2 now references a new Bar object with a new
//Foo object containing a value of 3
$obj2 = new Bar(3);

//$obj2 should be a copy of $obj1 and contain a new
//Foo object with a value of 2
$obj2 = $obj;

//Somehow, this also changes the value in $obj2
$obj-set(4);

//In a sane world, this outputs 2
//In reality, we get a 4
echo $obj2-get();


---



ATTENTION! Do NOT reply to this email!
To reply, use the web interface found at http://bugs.php.net/?id=11909edit=2


-- 
PHP Development 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-DEV] Bug #11909 Updated: Object Copied By Reference!!

2001-07-05 Thread brianlmoon

ID: 11909
Updated by: brianlmoon
Reported By: [EMAIL PROTECTED]
Status: Bogus
Bug Type: Scripting Engine problem
Operating system: 
PHP Version: 4.0.6
Assigned To: 
Comments:

But, the object that you referenced in the share() call is still in existence.  And 
the reference to that object is still good.  All obj1 has is a reference to something 
in its a var.  It copies that reference to the new object.  I don't see where a copy 
should have been made here.

Are you wanting PHP to make a new reference to a new piece of data?


Previous Comments:
---

[2001-07-05 15:48:49] [EMAIL PROTECTED]

I think you misunderstood me. I'm not assuming that the
object in $obj2 should be gone after I copy something else
to this object. I AM assuming that the object in $obj is
that same object as was in $obj2 and that the object in
$obj2 is now a different object.

The issue is that the = operator does not create a complete
copy of the object referenced by $obj.  It instead creates
an object containing an object that is referenced by both
$obj and $obj2.

Maybe this will make it easier to see:

If you change $obj2 = $obj; to $obj3 = $obj; and echo
$obj2-get(); to echo $obj3-get(); in my code, you still
get the same results.

If you comment out $obj-share($obj2); the code returns 1,
which is what you would expect.

If this is the expected behavior, then it is not clearly
documented. If that is the case, this bug should probably be
changed to a documentation bug, and this example should be
added to the documentation with a detailed explanation.


---

[2001-07-05 15:05:26] [EMAIL PROTECTED]

This is expected behavior.  You are assuming that the object you had in $obj2 should 
be gone when you copy $obj to that var.  That is not the case.  It only changes what 
$obj2 points to.  Take this case:

$var=3;
$var2=$var;
unset($var);
echo $var2;

$var2 is still 3.  The reference is gone but not the value of the var.  That is what 
makes references nice.

Brian.

---

[2001-07-05 10:54:01] [EMAIL PROTECTED]

When objects that contain objects that are referenced
elsewhere, they are not correctly dereferenced, and strange
side effects result

class Foo{
  var $a;
  function Foo($value)
{
  $this-set($value);
}
  function set($value)
{
  $this-a = $value;
}
  function get()
{
  return $this-a;
}
}
class Bar{
  var $a;
  function Bar($value)
{
  $this-a = new Foo($value);
}
  function set($value)
{
  $this-a-set($value);
}
  function get()
{
  return $this-a-get();
}
  function share($other)
{
  $this-a =  $other-a;
}
}

//Objects are initialized
$obj = new Bar(1);
$obj2 = new Bar(2);

//$obj and $obj2 both contain an internal reference to the
//same Foo object, with a value of 2
$obj-share($obj2);

//$obj2 now references a new Bar object with a new
//Foo object containing a value of 3
$obj2 = new Bar(3);

//$obj2 should be a copy of $obj1 and contain a new
//Foo object with a value of 2
$obj2 = $obj;

//Somehow, this also changes the value in $obj2
$obj-set(4);

//In a sane world, this outputs 2
//In reality, we get a 4
echo $obj2-get();


---



ATTENTION! Do NOT reply to this email!
To reply, use the web interface found at http://bugs.php.net/?id=11909edit=2


-- 
PHP Development 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-DEV] Bug #11786 Updated: Problems with variables from forms posting.

2001-07-01 Thread brianlmoon

ID: 11786
Updated by: brianlmoon
Reported By: [EMAIL PROTECTED]
Status: Closed
Bug Type: Scripting Engine problem
Operating system: 
PHP Version: 4.0.6
Assigned To: 
Comments:

Further more this is not a valid enctype.

http://www.w3.org/TR/html4/interact/forms.html#form-content-type

My browser does not even send the data.

Previous Comments:
---

[2001-06-30 04:25:27] [EMAIL PROTECTED]

This data should be in $HTTP_RAW_POST_DATA. If PHP does not see the default enctype, 
it stores the post data in this variable.

Derick

---

[2001-06-28 13:44:21] [EMAIL PROTECTED]

I used standard binary for Windows 2000(msi) - Apache 1.3.20 and PHP 4.0.6 (standard,
module not cgi)

When i put enctype=text/plain in form's attributes list, there are no
variables in environment neither in global tables $HTTP_ENV_VARS, etc... after form 
submit.


---

[2001-06-28 13:41:58] [EMAIL PROTECTED]

I used standard binary for Windows 2000(msi) - Apache 1.3.20 and PHP 4.0.6 (standard, 
module not cgi)

When i put enctype=text/plain in form's attributes list, there are no variables in 
environment neither in global tables $HTTP_ENV_VARS, etc...

---



ATTENTION! Do NOT reply to this email!
To reply, use the web interface found at http://bugs.php.net/?id=11786edit=2


-- 
PHP Development 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-DEV] Bug #11759 Updated: DOCUMENT_ROOT not available when using PHP with IIS5 (cgi Version)

2001-06-29 Thread brianlmoon

ID: 11759
Updated by: brianlmoon
Reported By: [EMAIL PROTECTED]
Old-Status: Open
Status: Bogus
Bug Type: IIS related
Operating system: 
PHP Version: 4.0.6
Assigned To: 
Comments:

DOCUMENT_ROOT is an environment/server variable set by Apache.  You will need to 
determine the equivalent if there is one for IIS.

Brian.

Previous Comments:
---

[2001-06-27 19:41:03] [EMAIL PROTECTED]
? echo $DOCUMENT_ROOT; ? /P

Causes the following:

Warning: Undefined variable: DOCUMENT_ROOT in w:inetpubwwwroottest1.php4 on line 13





---

[2001-06-27 19:37:15] [EMAIL PROTECTED]
DOCUMENT_ROOT not available when using PHP with IIS5 (cgi Version). Works fine on 
Linux / Apache



---



ATTENTION! Do NOT reply to this email!
To reply, use the web interface found at http://bugs.php.net/?id=11759edit=2


-- 
PHP Development 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-DEV] Bug #11627 Updated: string '0' treated as empty

2001-06-24 Thread brianlmoon

ID: 11627
Updated by: brianlmoon
Reported By: [EMAIL PROTECTED]
Status: Closed
Bug Type: Unknown/Other Function
Operating system: 
PHP Version: 4.0.5
Assigned To: 
Comments:

Actually, you should get an error on that line.

empty takes a variable, not a value.

Previous Comments:
---

[2001-06-23 14:29:39] [EMAIL PROTECTED]
Yes, this is intentional. Check the manual page for it:

http://www.php.net/empty



---

[2001-06-23 07:54:37] [EMAIL PROTECTED]
the string '0' is not empty but treated as empty

if( empty( '0' ) )
{

}

---



ATTENTION! Do NOT reply to this email!
To reply, use the web interface found at http://bugs.php.net/?id=11627edit=2


-- 
PHP Development 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-DEV] Bug #8889 Updated: Memory is not being freed.

2001-06-22 Thread brianlmoon

ID: 8889
Updated by: brianlmoon
Reported By: [EMAIL PROTECTED]
Status: Closed
Bug Type: Performance problem
Operating system: 
PHP Version: 4.0.4
Assigned To: 
Comments:

This is all fixed in 4.0.6.

Previous Comments:
---

[2001-05-01 03:01:29] [EMAIL PROTECTED]
The main problem is that once the system's standard C library allocates heap space 
(with the sbrk() system call) it will never return that memory to the system.
PHP can't solve this problem. If you do find certain things in the future which take 
up much more memory than they should please open a new bug report and we will check 
into it.

---

[2001-04-30 14:31:27] [EMAIL PROTECTED]
I am talking about nearly endless amounts.  I saw Apache processes with as much as 
14MB of memory in use.

Brian.

---

[2001-04-29 19:59:56] [EMAIL PROTECTED]
What kind of sizes are we talking about here?  the Zend memory manager holds a memory 
cache, but we're talking at around 1MB per process max.

---

[2001-01-26 18:45:45] [EMAIL PROTECTED]
Ok, this is just like what is described in 
http://marc.theaimsgroup.com/?l=php-devm=97923602322593w=2 which contains a hacked 
up solution.  It looks like it should be able to turn into a usable end solution.

---

[2001-01-24 13:21:13] [EMAIL PROTECTED]
Hi guys,

I do not have much information.  I know that my Apache processes memory is growing by 
the minute.  If I start a separate server on another port and serve only static pages 
and files through it, those process do not grow.

I have tried what I remembered of gdb but have not come up with anything.  I know I 
need to attach to a process and it seems I can `gdb {pid}` but that gives me nothing.  
How can I get some info for you guys?  I do have --enable-debug.

thanks,

Brian.
Phorum.org

---

The remainder of the comments for this report are too long.  To view the rest of the 
comments, please view the bug report online.


ATTENTION! Do NOT reply to this email!
To reply, use the web interface found at http://bugs.php.net/?id=8889edit=2


-- 
PHP Development 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-DEV] Bug #11344 Updated: Memory not being reused.

2001-06-22 Thread brianlmoon

ID: 11344
Updated by: brianlmoon
Reported By: [EMAIL PROTECTED]
Old-Status: Feedback
Status: Closed
Bug Type: Scripting Engine problem
Operating system: 
PHP Version: 4.0 Latest CVS (2001-06-08)
Assigned To: 
Comments:

This is fixed in 4.0.6.

Previous Comments:
---

[2001-06-19 14:05:38] [EMAIL PROTECTED]
Brian,

Can you please checkout the latest CVS of PHPZend and let us know if this problem is 
fixed now?
Thanks.

---

[2001-06-18 10:18:25] [EMAIL PROTECTED]
marking this as feedback until reporter responds

---

[2001-06-15 06:57:55] [EMAIL PROTECTED]
Could you try to build PHP with fast_cache disabled and see what happens?

Edit Zend/zend_fast_cache.h, and change
# define ZEND_ENABLE_FAST_CACHE 1
to
# define ZEND_ENABLE_FAST_CACHE 0


---

[2001-06-08 00:52:36] [EMAIL PROTECTED]
This is a follow up of sorts to: http://www.php.net/bugs.php?id=8889

I have been running some tests that do simple things to see what happens with the 
memory PHP uses in scripts.

The simplest of these tests was a page with no PHP on it other than the code that 
logged the process memory usage:

$PHP_PID = exec(echo $PPID);
$fp=fopen(/www/logs/user_log.20010607, a);
fputs($fp, memusaget$PHP_PID,.exec(ps -v -p $PHP_PID | awk '{print 
$8}').,.time().,$HTTP_HOST,$REQUEST_URIn);
fclose($fp);

I got interesting results.  Although the growth of the process was small, it was 
obvoius that the memory was growing.  Here is some sample data:

PID  MEM  TIME
3019 3272 991952835
3019 3420 991952835
3019 3428 991952836
3019 3448 991952836
3019 3480 991952837
3019 3488 991952838
3019 3500 991952839
3019 3504 991952840
3019 3516 991952899
3019 3520 991952843
3019 3520 991952844
3019 3524 991952847
3019 3524 991952851
3019 3524 991952854
3019 3524 991952858
3019 3524 991952862
3019 3532 991952868
3019 3532 991952910
3019 3544 991952879
3019 3552 991952888

As I said it is not a large growth, but it is there.

Now here is a script that creates an array over and over:

for($x=0;$x1000;$x++){
$arr[]=str_repeat(r, $x);
}

plus the code above that writes the log.  Here are the results:

PID  MEM  TIME
7322 3272 991953793
7322 3420 991953794
7322 3428 991953794
7322 3448 991953795
7322 3480 991953796
7322 3488 991953797
7322 3500 991953797
7322 3504 991953799
7322 3520 991953800
7322 3520 991953804
7322 3524 991953806
7322 3524 991953808
7322 3524 991953813
7322 3524 991953816
7322 3524 991953820
7322 3532 991953825
7322 3544 991953832
7322 3568 991953851
7322 3572 991953841
7322 3584 991953862


Again, a gradual growth occurs.  Now, we put this into our production environment 
where we are running applications and we end up with:

PIDMEMTIME
31655  2656   991953822
31655  3124   991953826
31655  4012   991953833
31655  4560   991953839
31655  4956   991953858
31655  5020   991953877
31655  5256   991953879
31655  5312   991953880
31655  5348   991953889
31655  5900   991953903
31655  6132   991953904
31655  6392   991953904
31655  6664   991953917
31655  6944   991953933
31655  7204   991953938
31655  7256   991953940
31655  7556   991953941
31655  8404   991953943
31655  8548   991953950
31655  8692   991953968
31655  8880   991953976
31655  8880   991953981
31655  9148   991953990
31655  9400   991953992
31655  9608   991953994
31655  9608   991954006
31655  9788   991954021
31655  10156  991954023
31655  10424  991954029

Is there any explanation for any of this?  I can live with PHP keeping and REUSING 
memory, but I don't want to have to think about how much memory my scripts take up 
because it never gets a)reused or b) returned to the system.  If I wanted to worry 
about that stuff I would write in Perl or C.

Brian.

---



ATTENTION! Do NOT reply to this email!
To reply, use the web interface found at http://bugs.php.net/?id=11344edit=2


-- 
PHP Development 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-DEV] Bug #11008 Updated: exit() should return an exit status if passed, not send to stdout

2001-05-23 Thread brianlmoon

ID: 11008
Updated by: brianlmoon
Reported By: [EMAIL PROTECTED]
Status: Open
Bug Type: Feature/Change Request
Operating system: 
PHP Version: 4.0 Latest CVS (2001-05-21)
Assigned To: 
Comments:

Anyone in the Zend core want to comment on this?  I know where the code is that does 
it.  But it is in the Zend code.

Is there a good reason to put this exit status to stdout?

Previous Comments:
---

[2001-05-22 01:59:53] [EMAIL PROTECTED]
indeed it does both:

if php; then echo yes; fi
? exit(0) ?
X-Powered-By: PHP/4.0.5
Content-type: text/html

0yes

if php; then echo yes; fi
? exit(1) ?
X-Powered-By: PHP/4.0.5
Content-type: text/html

1

i don't see a real reason for the echoed exit status though

---

[2001-05-21 21:34:23] [EMAIL PROTECTED]
Working with a shell script here.  I hoped that exit() would work like perl and return 
the passed status as and exist status.  As it stands now, it sends it to stdout.  This 
is unexpected.

It would be much more useful if exit() could be used to enable the use of PHP in shell 
scripts by returning the passed value as an exit status.

---



ATTENTION! Do NOT reply to this email!
To reply, use the web interface found at http://bugs.php.net/?id=11008edit=2


-- 
PHP Development 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-DEV] Bug #11016 Updated: install.txt

2001-05-22 Thread brianlmoon

ID: 11016
Updated by: brianlmoon
Reported By: [EMAIL PROTECTED]
Status: Open
Bug Type: Documentation problem
Operating system: 
PHP Version: 4.0.5
Assigned To: 
Comments:

I am using it without the quotes as we speak with no problems.  Why do you say this is 
wrong?

Brian.

Previous Comments:
---

[2001-05-22 09:25:58] [EMAIL PROTECTED]
in install.txt

bad:
# for the apache module
LoadModule php4_module c:/php/sapi/php4apache.dll
AddType application/x-httpd-php .php4

right:
# for the apache module
LoadModule php4_module c:/php/sapi/php4apache.dll
AddType application/x-httpd-php .php4



---



ATTENTION! Do NOT reply to this email!
To reply, use the web interface found at http://bugs.php.net/?id=11016edit=2


-- 
PHP Development 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-DEV] Bug #10987 Updated: apache display error when excuting exit ou die function

2001-05-22 Thread brianlmoon

ID: 10987
Updated by: brianlmoon
Reported By: [EMAIL PROTECTED]
Status: Open
Bug Type: Unknown/Other Function
Operating system: 
PHP Version: 4.0.5
Assigned To: 
Comments:

Was this as a module or a CGI?

Brian

Previous Comments:
---

[2001-05-21 09:48:40] [EMAIL PROTECTED]
Whit the simple script 
? exit(); ? ou ? die(); ?

apache display a error message like this:

l'instruction à 0x00a62ea0 emploie l'adresse mémoire 0x0055. la mémoire ne peut 
être read

the address 0x0055 is always the same. 
I use windows NT4/apache1.3.19/php4.0.5

 

---



ATTENTION! Do NOT reply to this email!
To reply, use the web interface found at http://bugs.php.net/?id=10987edit=2


-- 
PHP Development 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-DEV] Bug #11018 Updated: ereg_replace takes a preposterous amount of time w.r.t. PHP3

2001-05-22 Thread brianlmoon

ID: 11018
Updated by: brianlmoon
Reported By: [EMAIL PROTECTED]
Status: Open
Bug Type: Performance problem
Operating system: 
PHP Version: 4.0.4pl1
Assigned To: 
Comments:

What is that second regex doing?  It looks like there is a missing \ in there.

Just for testing, have you tried using preg_replace instead of ereg.  The preg 
functions are faster and more reliable.

Previous Comments:
---

[2001-05-22 09:50:52] [EMAIL PROTECTED]
I suggest using preg_replace and try to splitup the $bib variabele into smaller parts 
(i.e. per line).
Can you see if this works better for you?

Derick

---

[2001-05-22 09:45:22] [EMAIL PROTECTED]
My publication page
(http://gongolo.usr.dsi.unimi.it/~vigna/papers) is generated
with PHP. Part of the generation process includes the
following regular expression substitutions:

$bib = ereg_replace(([0-9]+)--([0-9]+), \1-\2,$bib); 
$bib = ereg_replace({((['`]|w)+)}, \1, $bib);

$bib is a variable containig about 20K of text generated by
a BibTeX style. Everything worked fine with PHP 3, but since
I installed PHP 4, the page is output in 20 seconds.
Indeed, there where other 10 substitutions, and initially
the page wouldn't simply display because of server timeout.
I changed whenever possible ereg_replace to str_replace, but
of course the two substitutions above need regular
expressions. They increase the page serving time of about
15s. Computation time was negligible with PHP 3.

The strange thing is that the page is _serverd_ slowly. One
would expect that there is a long wait, and then the page is
served all at one time. Instead, there is a long wait, and
then the page is served slowly. Eliminating the two regular
expressions above solves the problem (but serves the wrong
page 8^).


---



ATTENTION! Do NOT reply to this email!
To reply, use the web interface found at http://bugs.php.net/?id=11018edit=2


-- 
PHP Development 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-DEV] Bug #11009 Updated: Recursive call causes crash

2001-05-21 Thread brianlmoon

ID: 11009
Updated by: brianlmoon
Reported By: [EMAIL PROTECTED]
Old-Status: Open
Status: Closed
Bug Type: Reproducible crash
Operating system: 
PHP Version: 4.0.5
Assigned To: 
Comments:

This is more of a programing error.  This is a poor way to use recursive calls.  A 
loop is the correct way to handle this.

Previous Comments:
---

[2001-05-21 22:06:27] [EMAIL PROTECTED]
I created a function called pad which performs exactly what str_repeat does (didn't 
realize str_repeat was there originally).

function pad($length,$padVar=-){
 if($length=0){return;}
 else{return pad($length-1,$padVar).$padVar;}
}

When passing a length  about 5000 the page will not load and I quickly get this error 
in the php.error log: 
[notice] child pid 15040 exit signal Segmentation fault (11)

I assume it is b/c the function stack is just not up to the task, but I thought I 
would let you know anyway. 
Of course I am using str_repeat now

Thanks!
Jason

---



ATTENTION! Do NOT reply to this email!
To reply, use the web interface found at http://bugs.php.net/?id=11009edit=2


-- 
PHP Development 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-DEV] Bug #10598 Updated: Windows Protocol ini file placement

2001-05-02 Thread brianlmoon

ID: 10598
Updated by: brianlmoon
Reported By: [EMAIL PROTECTED]
Status: Open
Bug Type: *Install and Config
PHP Version: 4.0.5
Assigned To: 
Comments:

While I do agree with you that this is a pain, there is a possible solution assuming 
that you can set environment variables on your machine.  Set PHPRC to the path where 
the php.ini file is.  Then PHP will look there instead.

Previous Comments:
---

[2001-05-02 03:17:12] [EMAIL PROTECTED]
I've been running PHP with this:
http://www.php.net/do_download.php?download_file=php405-installer.exesource_site=www.php.net


Basically, I have a problem with the placement of your php.ini. I would have thought, 
hoped it would run from the php directory as well as the windows directory. This is 
standard Windows protocol. A windows *.exe normally prioritises looking in the app 
directory and then in the windows directory for the location of *.ini files.

 Your Msvcrt.dll was installed in my network drive: t:php and works like a charm; so 
should the php.ini!.

My at-work installation of windows is NT Server based and I don't have permissions to 
access D:ntdir where NT was installed. I'm running a http microweb out of a separate 
directory and hoped to make use of PHP at work. I can't because I can't put the php in 
the windows directory. It won't work in my network drive: t:phpphp.ini
While my case may or may not be non-standard, your port to windows lack in basic *.ini 
protocol. It should look in the app directory to see if the ini exists there too! 

---



ATTENTION! Do NOT reply to this email!
To reply, use the web interface found at http://bugs.php.net/?id=10598edit=2


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