php-general Digest 20 Dec 2003 04:55:25 -0000 Issue 2483

Topics (messages 173021 through 173062):

mysql update query
        173021 by: Enda
        173022 by: Jonathan Wilkes
        173023 by: Richard Davey
        173027 by: Enda
        173028 by: Enda
        173030 by: Jonathan Wilkes

Re: Php Windows server
        173024 by: Neil Freeman

Setting the environment PATH
        173025 by: Morten
        173053 by: Tom Rogers

server behavior menu/list in windows server
        173026 by: E. Ricardo Santos

preg_replace help
        173029 by: Ben
        173031 by: Ben

URL regex
        173032 by: Evan Nemerson
        173035 by: Evan Nemerson
        173036 by: Rolf Brusletto

Login to another box on network server to retrieve file
        173033 by: Jay Blanchard

Re: CRON throws error, but no command line problems SOLVED
        173034 by: Jay Blanchard

Re: Login to another box on network server to retrieve file (SOLVED)
        173037 by: Jay Blanchard
        173038 by: Rolf Brusletto

sessions simply don't work
        173039 by: ken lee
        173040 by: jon
        173041 by: Brad Pauly
        173042 by: Peter Walter

session / garbage collection problem
        173043 by: Anthony Kaufman
        173047 by: Marek Kilimajer
        173049 by: Anthony Kaufman
        173051 by: Tony Crockford
        173054 by: Anthony Kaufman

Christmas
        173044 by: Eric Bolikowski
        173045 by: Eric Bolikowski
        173048 by: Chris W. Parker

PEAR::SOAP using PHP...please help!
        173046 by: Sam Masiello

include files
        173050 by: Todd
        173052 by: Chris W. Parker
        173055 by: Marek Kilimajer

ISAPI and Header function problem
        173056 by: Astron of BrOnX

HELP!! ISS does not load the ISAPI of PHP
        173057 by: E. Ricardo Santos
        173058 by: Astron of BrOnX
        173059 by: E. Ricardo Santos
        173061 by: John W. Holmes

html or php to pdf whith pdflib?
        173060 by: E. Ricardo Santos

Turck MMcache compiling
        173062 by: Ryan A

Administrivia:

To subscribe to the digest, e-mail:
        [EMAIL PROTECTED]

To unsubscribe from the digest, e-mail:
        [EMAIL PROTECTED]

To post to the list, e-mail:
        [EMAIL PROTECTED]


----------------------------------------------------------------------
--- Begin Message ---
Hi guys

Bit of a problem I'm having here with an update query on a PHP/MySQL site:

This is the db query I execute:
$result6=mysql_query("UPDATE $WorkTable SET Price=$CallCost WHERE (A_Number
= $A_Number AND StartDateTime = $D_Full AND Duration=$Duration AND
SMSDestinationName = '$SMSDestinationName')");

which returns the following SQL query:
UPDATE cdr200311 SET Price=0.225 WHERE (A_Number = 61210146 AND
StartDateTime = 2003110216502400 AND Duration=15.0167 AND SMSDestinationName
= '1010')

The query executes successfully, but nothing happens to the database... all
connections etc are in place.

Am I right to have the brackets around the WHERE conditions?

I have also tried this query in phpMyAdmin but no result... and yes, the
record does exist..

Help!

Thanks

Enda
--


--
Enda Nagle
NightSol
e: [EMAIL PROTECTED]
w: www.nightsol.net

--- End Message ---
--- Begin Message ---
Hi Enda,

Does your table have an index per record ?

If so, your WHERE clause could just use the index and thus be far simpler, if 
"A_Number" is an indexed field, then 

UPDATE cdr200311 SET Price=0.225 WHERE A_Number = 61210146

Alternatively, try removing the () around the WHERE

Darka

www.xfcpro.com


-----Original Message-----
From: Enda [mailto:[EMAIL PROTECTED]
Sent: 19 December 2003 16:33
To: Php-General
Subject: [PHP] mysql update query


Hi guys

Bit of a problem I'm having here with an update query on a PHP/MySQL site:

This is the db query I execute:
$result6=mysql_query("UPDATE $WorkTable SET Price=$CallCost WHERE (A_Number
= $A_Number AND StartDateTime = $D_Full AND Duration=$Duration AND
SMSDestinationName = '$SMSDestinationName')");

which returns the following SQL query:
UPDATE cdr200311 SET Price=0.225 WHERE (A_Number = 61210146 AND
StartDateTime = 2003110216502400 AND Duration=15.0167 AND SMSDestinationName
= '1010')

The query executes successfully, but nothing happens to the database... all
connections etc are in place.

Am I right to have the brackets around the WHERE conditions?

I have also tried this query in phpMyAdmin but no result... and yes, the
record does exist..

Help!

Thanks

Enda
--


--
Enda Nagle
NightSol
e: [EMAIL PROTECTED]
w: www.nightsol.net

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

--- End Message ---
--- Begin Message ---
Hello Enda,

Friday, December 19, 2003, 4:32:44 PM, you wrote:

E> which returns the following SQL query:
E> UPDATE cdr200311 SET Price=0.225 WHERE (A_Number = 61210146 AND
E> StartDateTime = 2003110216502400 AND Duration=15.0167 AND SMSDestinationName
E> = '1010')

E> The query executes successfully, but nothing happens to the database... all
E> connections etc are in place.

Have you tried placing quotes around the values? The timestamps should
be ok, but the price with the decimal place will almost certainly need
them.

-- 
Best regards,
 Richard                            mailto:[EMAIL PROTECTED]

--- End Message ---
--- Begin Message ---
Yes I would prefer to do this... problem is that the final table will be
populated from a monthly csv file supplied from an external source.

this file could have several hundred occurences of each value of A_Number
and other fields so the only way to have it as unique is to use several of
the fields in the recordset as the 'key'...

I tried both suggestions - thanks, but still no luck.

Any more ideas? I don't really want to have to go and rewrite the update to
include a unique id for each record!

Thanks guys for your help.

Enda
--


-----Original Message-----
From: Jonathan Wilkes [mailto:[EMAIL PROTECTED]
Sent: 19 December 2003 16:39
To: Enda; Php-General
Subject: RE: [PHP] mysql update query


Hi Enda,

Does your table have an index per record ?

If so, your WHERE clause could just use the index and thus be far simpler,
if "A_Number" is an indexed field, then

UPDATE cdr200311 SET Price=0.225 WHERE A_Number = 61210146

Alternatively, try removing the () around the WHERE

Darka

www.xfcpro.com


-----Original Message-----
From: Enda [mailto:[EMAIL PROTECTED]
Sent: 19 December 2003 16:33
To: Php-General
Subject: [PHP] mysql update query


Hi guys

Bit of a problem I'm having here with an update query on a PHP/MySQL site:

This is the db query I execute:
$result6=mysql_query("UPDATE $WorkTable SET Price=$CallCost WHERE (A_Number
= $A_Number AND StartDateTime = $D_Full AND Duration=$Duration AND
SMSDestinationName = '$SMSDestinationName')");

which returns the following SQL query:
UPDATE cdr200311 SET Price=0.225 WHERE (A_Number = 61210146 AND
StartDateTime = 2003110216502400 AND Duration=15.0167 AND SMSDestinationName
= '1010')

The query executes successfully, but nothing happens to the database... all
connections etc are in place.

Am I right to have the brackets around the WHERE conditions?

I have also tried this query in phpMyAdmin but no result... and yes, the
record does exist..

Help!

Thanks

Enda
--


--
Enda Nagle
NightSol
e: [EMAIL PROTECTED]
w: www.nightsol.net

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

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

--- End Message ---
--- Begin Message ---
I used single..

just deleted all records except 1 from the table and changed the query to
have just one WHERE condition
$result6=mysql_query("UPDATE $WorkTable SET Price=$CallCost WHERE A_Number
= $A_Number");

this worked... so looks like i'm going to have to rewrite the import bit!

unless of course someone can come in with a last minute flash of
inspiration!

i really really don't need this at 5:12 on a friday afternoon!



-----Original Message-----
From: Jonathan Wilkes [mailto:[EMAIL PROTECTED]
Sent: 19 December 2003 17:00
To: Enda
Subject: RE: [PHP] mysql update query


when you added the quotes, did you specify single or double quotes ?

-----Original Message-----
From: Enda [mailto:[EMAIL PROTECTED]
Sent: 19 December 2003 16:52
To: Php-General
Cc: Jonathan Wilkes
Subject: RE: [PHP] mysql update query


Yes I would prefer to do this... problem is that the final table will be
populated from a monthly csv file supplied from an external source.

this file could have several hundred occurences of each value of A_Number
and other fields so the only way to have it as unique is to use several of
the fields in the recordset as the 'key'...

I tried both suggestions - thanks, but still no luck.

Any more ideas? I don't really want to have to go and rewrite the update to
include a unique id for each record!

Thanks guys for your help.

Enda
--


-----Original Message-----
From: Jonathan Wilkes [mailto:[EMAIL PROTECTED]
Sent: 19 December 2003 16:39
To: Enda; Php-General
Subject: RE: [PHP] mysql update query


Hi Enda,

Does your table have an index per record ?

If so, your WHERE clause could just use the index and thus be far simpler,
if "A_Number" is an indexed field, then

UPDATE cdr200311 SET Price=0.225 WHERE A_Number = 61210146

Alternatively, try removing the () around the WHERE

Darka

www.xfcpro.com


-----Original Message-----
From: Enda [mailto:[EMAIL PROTECTED]
Sent: 19 December 2003 16:33
To: Php-General
Subject: [PHP] mysql update query


Hi guys

Bit of a problem I'm having here with an update query on a PHP/MySQL site:

This is the db query I execute:
$result6=mysql_query("UPDATE $WorkTable SET Price=$CallCost WHERE (A_Number
= $A_Number AND StartDateTime = $D_Full AND Duration=$Duration AND
SMSDestinationName = '$SMSDestinationName')");

which returns the following SQL query:
UPDATE cdr200311 SET Price=0.225 WHERE (A_Number = 61210146 AND
StartDateTime = 2003110216502400 AND Duration=15.0167 AND SMSDestinationName
= '1010')

The query executes successfully, but nothing happens to the database... all
connections etc are in place.

Am I right to have the brackets around the WHERE conditions?

I have also tried this query in phpMyAdmin but no result... and yes, the
record does exist..

Help!

Thanks

Enda
--


--
Enda Nagle
NightSol
e: [EMAIL PROTECTED]
w: www.nightsol.net

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

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

--- End Message ---
--- Begin Message ---
> just had a thought, what happens when you have only 2 records in the database, does 
> it work, is it possible that you may > have had 2 identical records in the first 
> instance, hence it not working ?

ignore my idiotic comment, it's friday, it's late and I have 2 weeks off (only 10 
minutes to go), so I wasn't really thinking when I typed it.

Honestly, a unique index may be the best bet...

-----Original Message-----
From: Enda [mailto:[EMAIL PROTECTED]
Sent: 19 December 2003 17:13
To: Php-General
Subject: Re: [PHP] mysql update query



I used single..

just deleted all records except 1 from the table and changed the query to
have just one WHERE condition
$result6=mysql_query("UPDATE $WorkTable SET Price=$CallCost WHERE A_Number
= $A_Number");

this worked... so looks like i'm going to have to rewrite the import bit!

unless of course someone can come in with a last minute flash of
inspiration!

i really really don't need this at 5:12 on a friday afternoon!

--- End Message ---
--- Begin Message --- You will need to ensure that the session save path is set to a valid directory:

e.g.

session.save_path = "C:/Temp"

Neil

E. Ricardo Santos wrote:

***********************************************
This Email Has Been Virus Swept
***********************************************

Somebody could say to me if something special exists to form for the
treatment of the sessions in a Php Windows server?



I have   a code  that works perfectly in Apache, nevertheless, when
executing it  in a Windows server the sessions do not activate.





 I am using php 4.3.3 like ISAPI. There is something I must define in
php.ini?


Thanks



-- ---------------------- www.curvedvision.com ----------------------



This communication is confidential to the intended recipient(s). If you are not that person you are not permitted to make use of the information and you are requested to notify the sender immediately of its receipt then destroy the copy in your possession. Any views or opinions expressed are those of the originator and may not represent those of Advanced System Architectures Ltd.

*** This Email Has Been Virus Checked ***
--- End Message ---
--- Begin Message ---
Hi, I need to add /usr/local/bin to the PATH used by my PHP web application. How?


Br,

Morten
--- End Message ---
--- Begin Message ---
Hi,

Saturday, December 20, 2003, 2:36:40 AM, you wrote:

M> Hi, I need to add /usr/local/bin to the PATH used by my PHP web 
M> application. How?

M> Br,

M> Morten


with getenv() and putenv()  on a page by page basis

$newpath ='/usr/local/bin';
$current_path = getenv('PATH');
$newpath = $newpath.':'.$current_path;
putenv('PATH='.$new_path);

Now any exec shells will get the new path

-- 
regards,
Tom

--- End Message ---
--- Begin Message ---
I have a dynamic table to update registries.



In this table there are fields to relate to other tables.Therefore, I create
"select" to show them.



These behaviors of server, perfectly work in the servant apache but in the
one of Windows, simply n shows nothing to me in the pagina.



When exempt of the dynamic table "select" I can see the data correctly.



It has this something that to see with php.ini?



thanks

--- End Message ---
--- Begin Message ---
I am trying to build a pattern to do the following:
- Find all occurences of HREF=" and SRC=" except those that include the HTTP:// in 
their path
- Insert my own domain string (e.g.: http://www.my_domain.com)

So has an example the input string would be :
$val = '
<A href="http://www.my_domain.com/test.php";>my_domain</A>
<A href="hello.com">hello</A>
<IMG src="images/test.jpg">
<IMG src="http://www.my_domain.com/images/tstimg.jpg>
';

And I would like to end up with:
$val = '
<A href="http://www.my_domain.com/test.php";>my_domain</A>
<A href="http://www.my_domain.com/hello.com";>hello</A>
<IMG src="http://www.my_domain.com/images/test.jpg";>
<IMG src="http://www.my_domain.com/images/tstimg.jpg>
';

Thank you in advance.

--- End Message ---
--- Begin Message ---
I am trying to build a pattern to do the following:
- Find all occurences of HREF=" and SRC=" except those that include the
HTTP:// in their path
- Insert my own domain string (e.g.: http://www.my_domain.com)

So has an example the input string would be :
$val = '<A hrEf="http://www.test.com/test.php";>ssdf</A><BR><A
HrEf="hello.com">2</A><IMG src="test.jpg"><IMG
src="http://www.test.com/images/dfgdf.jpg";>';

And I would like to end up with:

--- End Message ---
--- Begin Message ---
Hey does anyone have a good regex laying around for URLs? ereg or preg, 
doesn't matter.



-- 
Evan Nemerson
[EMAIL PROTECTED]
http://coeusgroup.com/en

--
"Truth, like gold, is to be obtained not by its growth, but by washing away 
from it all that is not gold. "

-Leo Nikolaevich Tolstoy

--- End Message ---
--- Begin Message ---
On Friday 19 December 2003 11:22 am, Evan Nemerson wrote:
> Hey does anyone have a good regex laying around for URLs? ereg or preg,
> doesn't matter.

Okay finally found this: http://www.regexp.org/msg.php?uid=512

wow. Seriously- wow.

>
>
>
> --
> Evan Nemerson
> [EMAIL PROTECTED]
> http://coeusgroup.com/en
>
> --
> "Truth, like gold, is to be obtained not by its growth, but by washing away
> from it all that is not gold. "
>
> -Leo Nikolaevich Tolstoy

-- 
Evan Nemerson
[EMAIL PROTECTED]
http://coeusgroup.com/en

--
"It is an unfortunate fact that every man who seeks to disseminate knowledge 
must contend not only against ignorance itself, but against false instruction 
as well. No sooner do we deem ourselves free from a particularly gross 
superstition, than we are confronted by some enemy to learning who would set 
aside all the intellectual progress of years, and plunge us back into the 
darkness of mediaeval disbelief."

-HP Lovecraft

--- End Message ---
--- Begin Message --- Evan Nemerson wrote:

On Friday 19 December 2003 11:22 am, Evan Nemerson wrote:


Hey does anyone have a good regex laying around for URLs? ereg or preg,
doesn't matter.



Okay finally found this: http://www.regexp.org/msg.php?uid=512


wow. Seriously- wow.




-- Evan Nemerson [EMAIL PROTECTED] http://coeusgroup.com/en

--
"Truth, like gold, is to be obtained not by its growth, but by washing away
from it all that is not gold. "

-Leo Nikolaevich Tolstoy





No kidding... one to bookmark for sure..

--
Rolf Brusletto
rolf[at]emailfeeds[dot]com
http://www.emailfeeds.com

--- End Message ---
--- Begin Message ---
Stumped am I.

I need to ftp to another box on my network...

$ftp_server = "doohickey";
$ftp_user = "root";
$ftp_pass = "roots_pass";

// connect to ftp server
$ftpc = ftp_connect($ftp_server);
if(!ftp_login($ftpc, $ftp_user, $ftp_pass)){
        echo "Could not login to $ftp_server !\n";
        exit();
}

and it throws this error

PHP Warning:  ftp_login(): Login incorrect. in
/usr/home/jblanchard/commcode_repair/commCodeRepair.php on line 35
Could not login to doohickey !

Now, when I go manually to that server I am already root, so it does not
ask for a user name, just a password. Can anyone kick me towards an
answer on this fine Friday afternoon? TIA & Hoppy Halidays!

--- End Message ---
--- Begin Message ---
[snip]
This is usually a DNS error...

I knew ....
[/snip]

Turns out the error was on the other end of the connection. Thanks!

--- End Message ---
--- Begin Message ---
[snip]
PHP Warning:  ftp_login(): Login incorrect. in
/usr/home/jblanchard/commcode_repair/commCodeRepair.php on line 35
Could not login to doohickey !
[s/snip]

Embarassed am I. Too much eggnog at the luncheon this day....

Turns out that root was not allowed ftp privs on the server I was trying
to get to for some odd reason. Tis corrected and working properly.

Happy Holidays!

--- End Message ---
--- Begin Message --- Jay Blanchard wrote:

[snip]
PHP Warning:  ftp_login(): Login incorrect. in
/usr/home/jblanchard/commcode_repair/commCodeRepair.php on line 35
Could not login to doohickey !
[s/snip]

Embarassed am I. Too much eggnog at the luncheon this day....

Turns out that root was not allowed ftp privs on the server I was trying
to get to for some odd reason. Tis corrected and working properly.

Happy Holidays!



oops! root is never a good idea to be able too login directly to any service!

--
Rolf Brusletto
rolf[at]emailfeeds[dot]com
http://www.emailfeeds.com
http://www.phpexamples.net

--- End Message ---
--- Begin Message ---
I'm getting this message all the the time I try to start a session with
session_start.

Cannot send session cookie - headers already sent

It's the first line of code in the file. I'm even getting the error with a
single session_start() function on its own in a file.
It fails on Apache on my intranet and IIS after being uploaded to a web
server. The browser is set to recieve cookies. All the books say it should
work.

Has anybody any ideas? I've wasted a whole day on this joker!

Ken Lee.

--- End Message ---
--- Begin Message ---
Maybe you should post the first few lines of your code...

        -- jon

-----Original Message-----
From: ken lee [mailto:[EMAIL PROTECTED] 
Sent: Friday, December 19, 2003 1:18 PM
To: [EMAIL PROTECTED]
Subject: [PHP] sessions simply don't work


I'm getting this message all the the time I try to start a session with
session_start.

Cannot send session cookie - headers already sent

It's the first line of code in the file. I'm even getting the error with
a single session_start() function on its own in a file. It fails on
Apache on my intranet and IIS after being uploaded to a web server. The
browser is set to recieve cookies. All the books say it should work.

Has anybody any ideas? I've wasted a whole day on this joker!

Ken Lee.

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


---
Incoming mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.551 / Virus Database: 343 - Release Date: 12/11/2003
 

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.551 / Virus Database: 343 - Release Date: 12/11/2003
 

--- End Message ---
--- Begin Message ---
On Fri, 2003-12-19 at 13:18, ken lee wrote:
> I'm getting this message all the the time I try to start a session with
> session_start.
> 
> Cannot send session cookie - headers already sent
> 
> It's the first line of code in the file. I'm even getting the error with a
> single session_start() function on its own in a file.
> It fails on Apache on my intranet and IIS after being uploaded to a web
> server. The browser is set to recieve cookies. All the books say it should
> work.

Is there anything before the first line of code? Any whitespace or html
will cause this error.

- Brad

--- End Message ---
--- Begin Message --- Ken,

I had exactly the same problem and it really stumped me for a while. Check your php start and end tags carefully - even a single space before or after the <?php ?> tags (before the session_start() ) will cause this problem. Check any included files before the session_start().

Peter

Brad Pauly wrote:

On Fri, 2003-12-19 at 13:18, ken lee wrote:

I'm getting this message all the the time I try to start a session with
session_start.

Cannot send session cookie - headers already sent

It's the first line of code in the file. I'm even getting the error with a
single session_start() function on its own in a file.
It fails on Apache on my intranet and IIS after being uploaded to a web
server. The browser is set to recieve cookies. All the books say it should
work.


Is there anything before the first line of code? Any whitespace or html
will cause this error.

- Brad

--- End Message ---
--- Begin Message ---
PHP Version 4.2.2
Apache 2
RH 9

The problem is that session files in the /tmp directory are completely
cleared out at "random" intervals of time.  We assume that the randomness is
due to our session.gc_probability setting of "1" causing it to run for 1% of
new sessions.  What we don't understand is why the garbage collector is
removing valid sessions.  session.gc_maxlifetime is set to 86400 (24 hours)
so it should keep them around for a good long time.  However, it seems that
ALL session files are deleted when the garbage collector runs.  In some
cases session files were deleted for sessions that had been around for less
than a minute.  We've thought of several hacks that would control the
problem but we can't come up with any way to fix it.

Thanks in advance,
Anthony

--- End Message ---
--- Begin Message --- What filesystem and OS is this?

Anthony Kaufman wrote:
PHP Version 4.2.2
Apache 2
RH 9

The problem is that session files in the /tmp directory are completely
cleared out at "random" intervals of time.  We assume that the randomness is
due to our session.gc_probability setting of "1" causing it to run for 1% of
new sessions.  What we don't understand is why the garbage collector is
removing valid sessions.  session.gc_maxlifetime is set to 86400 (24 hours)
so it should keep them around for a good long time.  However, it seems that
ALL session files are deleted when the garbage collector runs.  In some
cases session files were deleted for sessions that had been around for less
than a minute.  We've thought of several hacks that would control the
problem but we can't come up with any way to fix it.

Thanks in advance,
Anthony


--- End Message ---
--- Begin Message ---
Redhat 9
kernel 2.4.20-18.9bigmem
ext3 fs

"Marek Kilimajer" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> What filesystem and OS is this?
>
> Anthony Kaufman wrote:
> > PHP Version 4.2.2
> > Apache 2
> > RH 9
> >
> > The problem is that session files in the /tmp directory are completely
> > cleared out at "random" intervals of time.  We assume that the
randomness is
> > due to our session.gc_probability setting of "1" causing it to run for
1% of
> > new sessions.  What we don't understand is why the garbage collector is
> > removing valid sessions.  session.gc_maxlifetime is set to 86400 (24
hours)
> > so it should keep them around for a good long time.  However, it seems
that
> > ALL session files are deleted when the garbage collector runs.  In some
> > cases session files were deleted for sessions that had been around for
less
> > than a minute.  We've thought of several hacks that would control the
> > problem but we can't come up with any way to fix it.
> >
> > Thanks in advance,
> > Anthony
> >

--- End Message ---
--- Begin Message --- On Fri, 19 Dec 2003 13:37:06 -0800, Anthony Kaufman wrote:

PHP Version 4.2.2
Apache 2
RH 9

The problem is that session files in the /tmp directory are completely
cleared out at "random" intervals of time. We assume that the randomness is
due to our session.gc_probability setting of "1" causing it to run for 1% of
new sessions. What we don't understand is why the garbage collector is
removing valid sessions. session.gc_maxlifetime is set to 86400 (24 hours)
so it should keep them around for a good long time. However, it seems that
ALL session files are deleted when the garbage collector runs. In some
cases session files were deleted for sessions that had been around for less
than a minute. We've thought of several hacks that would control the
problem but we can't come up with any way to fix it.

I'd be interested to hear of the hacks..


I've got a hosted application that has started losing session state since they upgraded PHP and they're blaming me and I know it isn't because I have the same spec locally and the same script on different servers.

is there something I can add to my script or in an htaccess file to keep my sessions away from their garbage collection, as it seems likely that I have a similar situation to you.

TIA

Tony
--- End Message ---
--- Begin Message ---
Well, we host our own so what I was thinking wouldn't quite work for your
situation.  However, I've seen a method that I think would work pretty well
for you.  Basically, you store all the data you want to be persistant
between requests in a database.  You could use the session id you get from
the browser as the key for a sessions table.  So, getting session data looks
something like this:

$sess_id = session_id();
$result = SELECT * FROM sessions WHERE session_id = '$sess_id'

Since session_id() gets it's information from the HTTP request, and the
browser keeps the session cookie (at least it does in our case), you don't
rely on the stuff in the tmp directory at all.

You could also emulate PHP's session-in-file approach using a similar
method.

"Tony Crockford" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> On Fri, 19 Dec 2003 13:37:06 -0800, Anthony Kaufman  wrote:
>
> > PHP Version 4.2.2
> > Apache 2
> > RH 9
> >
> > The problem is that session files in the /tmp directory are completely
> > cleared out at "random" intervals of time.  We assume that the
> > randomness is
> > due to our session.gc_probability setting of "1" causing it to run for
> > 1% of
> > new sessions.  What we don't understand is why the garbage collector is
> > removing valid sessions.  session.gc_maxlifetime is set to 86400 (24
> > hours)
> > so it should keep them around for a good long time.  However, it seems
> > that
> > ALL session files are deleted when the garbage collector runs.  In some
> > cases session files were deleted for sessions that had been around for
> > less
> > than a minute.  We've thought of several hacks that would control the
> > problem but we can't come up with any way to fix it.
>
> I'd be interested to hear of the hacks..
>
> I've got a hosted application that has started losing session state since
> they upgraded PHP and they're blaming me and I know it isn't because I
> have the same spec locally and the same script on different servers.
>
> is there something I can add to my script or in an htaccess file to keep
> my sessions away from their garbage collection, as it seems likely that I
> have a similar situation to you.
>
> TIA
>
> Tony

--- End Message ---
--- Begin Message ---
Merry christmas!!!

--- End Message ---
--- Begin Message ---
Merry christmas to every PHP developer here!!!

--- End Message ---
--- Begin Message ---
Eric Bolikowski <mailto:[EMAIL PROTECTED]>
    on Friday, December 19, 2003 2:28 PM said:

> Merry christmas to every PHP developer here!!!

You too.


--
Don't like reformatting your Outlook replies? Now there's relief!
http://home.in.tum.de/~jain/software/outlook-quotefix/

--- End Message ---
--- Begin Message ---
I have posted this question to both the PHP SOAP and the PEAR General
lists and have not received a reply on either list (not a very
responsive group, I guess :) ) so I thought I would try to reach a
larger audience in hopes that perhaps one of you out there might be able
to help.

Any assistance that ANYONE can provide would be more than
appreciated...I am really stuck on how to proceed here as calling the
client script doesn't produce ANY output, even if I change the return
from emailSubmit from the SOAP_Value to a simple string...nothing.

I have done a couple of SOAP projects before using the NuSOAP library
and XML-RPC, but my latest project has me working with a client who
wants to use doc+literal instead of XML-RPC and I am having a very hard
time with it, and was hoping you all could help.

Do I need to be doing this differently because it is doc+literal instead
of XML-RPC?  Is it even more different because the XML also has complex
types?  I have gone to many different sites and seen many different
variations of how to do many different things, but I am having a LOT of
trouble getting any sort of output from my client code.

I have tried many different code variations for just a simple test
client.  This is what I am currently on:

/* START CLIENT CODE */
require_once("SOAP/Client.php") ;
$url = "http://path_to_my_wsdl/mywsdl.wsdl"; ;
$wsdl = new SOAP_WSDL($url);
$client = $wsdl->getProxy() ;

$params=array('header'=>'hi', 'body'=>'there') ;
$options=array(
'namespace' => 'urn:mxlogic.outlookaddin',
'style' => 'document',
'use' => 'literal');

print $client->emailSubmit($params, $options);

/* END CLIENT CODE */


/* START SERVER CODE */

require_once("SOAP/Server.php") ;

class SOAP_My_Server {

        var $dispatch_map = array();

        function SOAP_My_Server() {
                $this->dispatch_map['pingService'] = array(
                        'in'    => array(),
                        'out'   => array('pingReturn'=>
array('ack'=>'boolean', 'time'=>'int'))) ;
                $this->dispatch_map['emailSubmit'] = array(
                        'in'    => array('header'=>'string',
'body'=>'string'),
                        'out'   => array('submitReturn'=>'boolean')) ;
        }

        function emailSubmit($header, $body) {
                return new SOAP_Value('return', 'boolean', true);
        }

        function pingService() {
                $myreturn = array('ack'=>'1', 'time'=>'3600') ;
                return new SOAP_Value('return', 'pong', $myreturn) ;
        }
}

$options =
array('namespace'=>'urn:mxlogic.outlookaddin','type'=>'document','use'=>
'literal') ;

$server=new SOAP_Server;
$soapmyserver= new SOAP_My_Server;
$server->addObjectMap($soapmyserver,$options);
$server->service($GLOBALS['HTTP_RAW_POST_DATA']);

/* END SERVER CODE */

--- End Message ---
--- Begin Message ---
Hi,

Is it possible under PHP4 to get the name of the file that a function was
called from? To clarify, here's an example of what I'd like to do:

        --- main.php ---
        <?php
           include('include.php');
           function foo(){
              $include_file=file_that_called_foo();
              printf($include_file);
           }
        ?>
   
        --- include.php ---
        <?php
           foo();
        ?>

Does anyone know of a way to do this? I've tried several different things,
including to constant '__FILE__ ', but they all return the current file, I
am needing the included filename.

--- End Message ---
--- Begin Message ---
Todd <mailto:[EMAIL PROTECTED]>
    on Thursday, December 18, 2003 9:57 AM said:

> Is it possible under PHP4 to get the name of the file that a function
> was called from? To clarify, here's an example of what I'd like to do:

[snip]

> Does anyone know of a way to do this? I've tried several different
> things, including to constant '__FILE__ ', but they all return the
> current file, I am needing the included filename.

yes this would be very handy for error reporting purposes but alas it is
not to be. afaik there is no way to do what you want save passing
__FILE__ to the function...


functio foo($stuff, $more_stuff, $current_file)
{
        ... do stuff ...
}


<?php

        echo foo($thing, $other_thing, __FILE__);


?>

that's what i ended up doing.




chris.
--
Don't like reformatting your Outlook replies? Now there's relief!
http://home.in.tum.de/~jain/software/outlook-quotefix/

--- End Message ---
--- Begin Message --- See function debug_backtrace(), it's available since 4.3.3

Todd wrote:
Hi,

Is it possible under PHP4 to get the name of the file that a function was
called from? To clarify, here's an example of what I'd like to do:

--- main.php ---
<?php
include('include.php');
function foo(){
$include_file=file_that_called_foo();
printf($include_file);
}
?>
--- include.php ---
<?php
foo();
?>


Does anyone know of a way to do this? I've tried several different things,
including to constant '__FILE__ ', but they all return the current file, I
am needing the included filename.


--- End Message ---
--- Begin Message ---
Hi everyone, i have installed Php as ISAPI module and header("Location :
xxx.php")  is not working? And not redirect to xxx.php... But if you use Php
as CGI there isnt any problem.. Does anyone know about this problem?

Thank you for interest.

--- End Message ---
--- Begin Message ---
Good, I follow with Windows ISAPI PHP Server:

Now the IIS, in the card: " ISAPI FILTERS " show me "php"  with arrow
red and downwards. It says NOT LOADED.

Somebody knows so that this can happen?

The archives and declarations is correct, just as route a
"phpîsapi.dll". I have returned to form the IIS as it were previously and
profit not to solve the dilemma

Some commentary?



Thanks

--- End Message ---
--- Begin Message ---
Hi, here is the steps,

1 . Copy all php_*.dll from extentions dir to c:\windows\system32
2 . Copy phpîsapi.dll to c:\windows\system32
3 . Copy php4ts.dll to c:\windows\system32
4 . Copy php.ini to c:\windows\system32
5. go ISAPI Filters and add .php (c:\windows\system32\phpisapi.dll)
6. go Application Configuration select Mappings tab and add new extentions
mapping .php (c:\windows\system32\phpisapi.dll)
7. restart IIS

I hope you will understand.


"E. Ricardo Santos" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Good, I follow with Windows ISAPI PHP Server:
>
> Now the IIS, in the card: " ISAPI FILTERS " show me "php"  with arrow
> red and downwards. It says NOT LOADED.
>
> Somebody knows so that this can happen?
>
> The archives and declarations is correct, just as route a
> "phpîsapi.dll". I have returned to form the IIS as it were previously and
> profit not to solve the dilemma
>
> Some commentary?
>
>
>
> Thanks

--- End Message ---
--- Begin Message ---
php.ini in "system32" too?



"Astron Of Bronx" <[EMAIL PROTECTED]> escribió en el mensaje
news:[EMAIL PROTECTED]
> Hi, here is the steps,
>
> 1 . Copy all php_*.dll from extentions dir to c:\windows\system32
> 2 . Copy phpîsapi.dll to c:\windows\system32
> 3 . Copy php4ts.dll to c:\windows\system32
> 4 . Copy php.ini to c:\windows\system32
> 5. go ISAPI Filters and add .php (c:\windows\system32\phpisapi.dll)
> 6. go Application Configuration select Mappings tab and add new extentions
> mapping .php (c:\windows\system32\phpisapi.dll)
> 7. restart IIS
>
> I hope you will understand.
>
>
> "E. Ricardo Santos" <[EMAIL PROTECTED]> wrote in message
> news:[EMAIL PROTECTED]
> > Good, I follow with Windows ISAPI PHP Server:
> >
> > Now the IIS, in the card: " ISAPI FILTERS " show me "php"  with arrow
> > red and downwards. It says NOT LOADED.
> >
> > Somebody knows so that this can happen?
> >
> > The archives and declarations is correct, just as route a
> > "phpîsapi.dll". I have returned to form the IIS as it were previously
and
> > profit not to solve the dilemma
> >
> > Some commentary?
> >
> >
> >
> > Thanks

--- End Message ---
--- Begin Message --- Astron of BrOnX wrote:

Hi, here is the steps,

1 . Copy all php_*.dll from extentions dir to c:\windows\system32
2 . Copy phpîsapi.dll to c:\windows\system32
3 . Copy php4ts.dll to c:\windows\system32
4 . Copy php.ini to c:\windows\system32
5. go ISAPI Filters and add .php (c:\windows\system32\phpisapi.dll)
6. go Application Configuration select Mappings tab and add new extentions
mapping .php (c:\windows\system32\phpisapi.dll)
7. restart IIS

I like to replace steps 1 - 3 with


1. Copy php4isapi.dll file to the same directory as php.exe (usually from php/sapi/ to php/).

This keeps everything within the php/ directory. Just seems cleaner and makes for easier upgrades, if you ask me. :)

--
---John Holmes...

Amazon Wishlist: www.amazon.com/o/registry/3BEXC84AB3A5E/

php|architect: The Magazine for PHP Professionals – www.phparch.com
--- End Message ---
--- Begin Message ---
Hello, somebody knows like turning a file HTML or php to pdf by means of
pdflib but without having to write  line  to  line?



that is, a file already existing php or HTML, can be turned with pdflib?



This  I ask it because to where it studies pdflib, exit pdf is due to write
line  by  line  and coordinate by coordinate. A pdf  already  created can
also be mattered and to combine it with the new exit. But what  I did not
find  he is all this is the particularitity that I raise.



I hope  has explained to me correctly

--- End Message ---
--- Begin Message ---
Hi,

Holiday greetz to everyone, heres a card for ya:
http://www.jumac.com/free-birthday-christmas-holiday-greetings/upcardme.php?step=pickupid=2k03596bb8f8/Php
list/[EMAIL PROTECTED]

and now...my problem :-D     :

We just took a dedicated server (Linux) and want to install Turck MMCache
for PHP on it, we have total control of that server and can SSH in etc.
Their "support" does not want to install it and told us if we want to, we
will have to do it ourselves...

is there anyway we can ssh in and do it?
I have never done anything like this before and am on a windows 2k pro
machine...I use putty to connect.

Any help appreciated.

Cheers,
-Ryan
http://Bestwebhosters.com

--- End Message ---

Reply via email to