Re: [PHP] Filestat.c erorrs when building php-5.3.3 on solaris

2010-09-08 Thread Tom Rogers
Hi,

Thursday, September 9, 2010, 11:31:06 AM, you wrote:
TR> Hi,

TR> Thursday, September 9, 2010, 2:07:50 AM, you wrote:
SVCD>> I am trying to build php-5.3.3 and getting the following error: 

SVCD>> /users/0/php-5.3.3/TSRM -I/users/0/php-5.3.3/Zend
SVCD>> -I/usr/local/include -g -O2 -DZTS   -c
SVCD>> /users/0/php-5.3.3/ext/standard/filestat.c -o
SVCD>> ext/standard/filestat.lo 
SVCD>> /users/0/php-5.3.3/ext/standard/filestat.c: In function
SVCD>> `php_do_chgrp':
SVCD>> /users/0/php-5.3.3/ext/standard/filestat.c:416: error: too many
SVCD>> arguments to function `getgrnam_r'
SVCD>> /users/0/php-5.3.3/ext/standard/filestat.c: In function
SVCD>> `php_do_chown':
SVCD>> /users/0/php-5.3.3/ext/standard/filestat.c:517: error: too many
SVCD>> arguments to function `getpwnam_r'
SVCD>> make: *** [ext/standard/filestat.lo] Error 1

SVCD>> I have set my ORACLE_HOME, my PATH, and my LD_LIBRARY_PATH
SVCD>> And used the following configure command:

SVCD>> ./configure --prefix=/app/php533 --with-apxs2=/app/apache2215/bin/apxs
SVCD>> --with-zlib --with-zlib-dir=/usr/lib
SVCD>> --with-png-dir=/usr/include/libpng
SVCD>> --with-openssl=/shared_ro/openssl_098
SVCD>> --with-oci8=/shared_ro/users.oracle/11.1.0

SVCD>> I am using gmake 3.80. Can anyone give me a hint as to what I am doing
SVCD>> wrong in this build?

SVCD>>   -Vicki Stanfield, RHCE, CISSP


TR> From   the   error  message  it  would  seem  the  operating  system's
TR> getpwnam_r() function is not POSIX compatible.
TR> What system are you compiling on?

TR> -- 
TR> regards,
TR> Tom



It  would  seem  you  need to add -D_POSIX_PTHREAD_SEMANTICS to the cc
flags to get the right function.

-- 
regards,
Tom


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



Re: [PHP] Filestat.c erorrs when building php-5.3.3 on solaris

2010-09-08 Thread Tom Rogers
Hi,

Thursday, September 9, 2010, 2:07:50 AM, you wrote:
SVCD> I am trying to build php-5.3.3 and getting the following error: 

SVCD> /users/0/php-5.3.3/TSRM -I/users/0/php-5.3.3/Zend
SVCD> -I/usr/local/include -g -O2 -DZTS   -c
SVCD> /users/0/php-5.3.3/ext/standard/filestat.c -o
SVCD> ext/standard/filestat.lo 
SVCD> /users/0/php-5.3.3/ext/standard/filestat.c: In function
SVCD> `php_do_chgrp':
SVCD> /users/0/php-5.3.3/ext/standard/filestat.c:416: error: too many
SVCD> arguments to function `getgrnam_r'
SVCD> /users/0/php-5.3.3/ext/standard/filestat.c: In function
SVCD> `php_do_chown':
SVCD> /users/0/php-5.3.3/ext/standard/filestat.c:517: error: too many
SVCD> arguments to function `getpwnam_r'
SVCD> make: *** [ext/standard/filestat.lo] Error 1

SVCD> I have set my ORACLE_HOME, my PATH, and my LD_LIBRARY_PATH
SVCD> And used the following configure command:

SVCD> ./configure --prefix=/app/php533 --with-apxs2=/app/apache2215/bin/apxs
SVCD> --with-zlib --with-zlib-dir=/usr/lib
SVCD> --with-png-dir=/usr/include/libpng
SVCD> --with-openssl=/shared_ro/openssl_098
SVCD> --with-oci8=/shared_ro/users.oracle/11.1.0

SVCD> I am using gmake 3.80. Can anyone give me a hint as to what I am doing
SVCD> wrong in this build?

SVCD>   -Vicki Stanfield, RHCE, CISSP


From   the   error  message  it  would  seem  the  operating  system's
getpwnam_r() function is not POSIX compatible.
What system are you compiling on?

-- 
regards,
Tom


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



Re: [PHP] Broken pipes, time outs, PHP, and mail

2010-09-08 Thread Dave M G

Ash, Bob,

Thank you for replying.


There is one other possibility. According to the RFCs, the standard line
ending for email is CRLF. Make sure your system is sending both
characters after each line. There is a slim chance the server is cutting
you off after some number of bytes if you are only sending a LF.


This is actually a possiblity. I think I might be only using LF.

Some of the text being sent in the emails is entered via a form on a web 
page. Is it possible to enforce CRLF on that text?


--
Dave M G

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



Re: [PHP] logical AND assignments

2010-09-08 Thread David Harkness
On Wed, Sep 8, 2010 at 9:55 AM, Peter Lind  wrote:

> || and && would work exactly like 'or' and 'and' in the above. ==, !=,
> === and !=== have higher precedence than || or &&
>

Ah, you're correct. The only operators between &&/|| and and/or and the
ternary ?: and assignment operators. Thus the need for the parentheses in

$Condition2 = (true and false);

to make $Condition2 false. The parentheses in

$Condition4 = (true && false);

are redundant since && has higher precedence than = (assignment).

Robert, how do the results differ from your expectations?

David


RE: Re: [PHP] Broken pipes, time outs, PHP, and mail

2010-09-08 Thread Bob McConnell
From: a...@ashleysheridan.co.uk

> Could it be that there are connection limits on the remote server?
> 
> Thanks,
> Ash

Only if you are opening a new connection for each message. Any decent
SMTP client should be able to send multiple messages over a single
connection.

You could capture the traffic with Wireshark. Set the capture filter to
only grab SMTP traffic to that server's IP address. Unless it is going
through SSL/TLS, you can read the handshake messages. They will look
something like this:

-8<
220 lists.php.net ESMTP Postfix
EHLO ashleysheridan.co.uk
250-mail.php.net
250-PIPELINING
250-SIZE 1024
250-VRFY
250-ETRN
250-STARTTLS
250-AUTH LOGIN PLAIN
250 8BITMIME
MAIL FROM:
250 Ok
RCPT TO:
250 Ok
-8<

The lines beginning with numbers are the server's responses. All of them
should be ASCII/UTF-8 text.

There is one other possibility. According to the RFCs, the standard line
ending for email is CRLF. Make sure your system is sending both
characters after each line. There is a slim chance the server is cutting
you off after some number of bytes if you are only sending a LF.

Bob McConnell

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



Re: [PHP] Reformat array result.

2010-09-08 Thread chris h
Paul,

How are you matching the records in the "event count" array to the ones in
the timestamp array?

Is it safe to say that:
"$timestamp[ $i ]" corresponds to "$eventCount[ $i ]"?

If so, you could just iterate through the timestamp array; on each iteration
create a record in a new array that holds the timestamp and whatever the
corresponding eventCount record is.  Something like:


$newTimeArray = array();

foreach ($timestamps as $i => $singleTimestamp) {

  $newTimeArray[ $i ] = array(
'timestamp' => $singleTimestamp,
'count' => $eventCounts[ $i ]
  );

}


Now if "$timestamp[ $i ]" does NOT correspond to "$eventCount[ $i ]" then I
think we'll need you to explain how that relationship works, unless I missed
something :)


Chris.


On Wed, Sep 8, 2010 at 1:02 PM, Paul Halliday wrote:

> I have been starting at this problem blankly for a couple hours now.
> Hopefully someone can help.
>
> I have a query that returns an event count grouped by hour:
>
> timestamp:
> Array ( [0] => 2010-09-08 03 [1] => 2010-09-08 04 [2] => 2010-09-08 05
> [3] => 2010-09-08 06 [4] => 2010-09-08 07 [5] => 2010-09-08 08 [6] =>
> 2010-09-08 09 [7] => 2010-09-08 10 [8] => 2010-09-08 11 [9] =>
> 2010-09-08 12 [10] => 2010-09-08 13 [11] => 2010-09-08 14 [12] =>
> 2010-09-08 15 [13] => 2010-09-08 16 ) 24
>
> event count:
> Array ( [0] => 1731 [1] => 885 [2] => 544 [3] => 668 [4] => 748 [5] =>
> 754 [6] => 933 [7] => 2422 [8] => 6713 [9] => 31925 [10] => 18827 [11]
> => 16743 [12] => 16875 [13] => 11775 )
>
> Lets say that coming into this, I knew that the query spanned 36 hours
> and started at 01:00. How can I manipulate the resulting array to
> contain the missing time stamps and a value of 0.
>
> The effect I am shooting for looks like this:
>
> http://www.pintumbler.org/example.png
>
> So 0  - > 23 will be static and I just walk through the array and
> populate those. If we hit 23, start a new row and continue. The matrix
> will always be the same though.
>
> I think I know what needs to happen, I just cant come up with the logic.
>
> Any push in the right direction would be appreciated.
> --
> Paul Halliday
> Ideation | Individualization | Learner | Achiever | Analytical
> http://www.pintumbler.org
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>


Re: [PHP] Broken pipes, time outs, PHP, and mail

2010-09-08 Thread a...@ashleysheridan.co.uk
In order to help we really need to have a look at the code in question. You say 
the code is derived from another class you downloaded. Are you able to post the 
important bits of it in an email, or put it all on a pastebin?

Thanks,
Ash
http://www.ashleysheridan.co.uk

- Reply message -
From: "Dave M G" 
Date: Wed, Sep 8, 2010 18:45
Subject: [PHP] Broken pipes, time outs, PHP, and mail
To: 

Bob,

Thank you for replying.

> Your code should be able to re-open the
> connection at this point and resend the message that triggered the
> error. Then resume working on the rest of your list.

Unfortunately, it seems that this is not happening. The loop that sends 
out individual mail dies, and the remaining mails stop being sent.

Is there perhaps some way I can force the PHP code to ignore the one 
mailing that failed and continue with the rest?

-- 
Dave M G

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



Re: [PHP] Broken pipes, time outs, PHP, and mail

2010-09-08 Thread Dave M G

Bob,

Thank you for replying.


Your code should be able to re-open the
connection at this point and resend the message that triggered the
error. Then resume working on the rest of your list.


Unfortunately, it seems that this is not happening. The loop that sends 
out individual mail dies, and the remaining mails stop being sent.


Is there perhaps some way I can force the PHP code to ignore the one 
mailing that failed and continue with the rest?


--
Dave M G

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



Re: [PHP] Broken pipes, time outs, PHP, and mail

2010-09-08 Thread a...@ashleysheridan.co.uk
Could it be that there are connection limits on the remote server?

Thanks,
Ash
http://www.ashleysheridan.co.uk

- Reply message -
From: "Bob McConnell" 
Date: Wed, Sep 8, 2010 18:24
Subject: [PHP] Broken pipes, time outs, PHP, and mail
To: 

From: Dave M G

> I have a set of scripts that sends out emails to a list of about 150 
> people. Sometimes it works fine.
> 
> Other times, it dies part way through the list, and in my error logs I

> get this output:
> 
> fputs() [function.fputs]: send of 22
bytes 
> failed with errno=32 Broken pipe /public_html/class.smtp.php 489
> 
> The code that sends the mail is derived from here:
> http://www.phpclasses.org/browse/file/920.html
> 
> It's mostly rock solid code, so far as I know, so I suspect the
problem 
> to more with my server settings or something.
> 
> That said, I don't know what differentiates a failed mailing and a 
> successful one.
> 
> After a Google search, it seems "broken pipes" are a matter of time 
> outs. That's about as far as I understand it, though.
> 
> Can anyone throw me a tip as to how I might diagnose this problem?

"Broken pipe" is a euphemism for "Network error". There are any number
of causes including the remote server closing the socket, a switch or
hub between here and there is bogged down by backup traffic, or a
segment your connection passes through became too busy with higher
priority video traffic. The actual details are difficult to determine
and none of the administrators involved will ever admit they had a
problem. In most cases the TCP/IP error will simply tell you it timed
out waiting for a response. Your code should be able to re-open the
connection at this point and resend the message that triggered the
error. Then resume working on the rest of your list.

Bob McConnell

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



RE: [PHP] Broken pipes, time outs, PHP, and mail

2010-09-08 Thread Bob McConnell
From: Dave M G

> I have a set of scripts that sends out emails to a list of about 150 
> people. Sometimes it works fine.
> 
> Other times, it dies part way through the list, and in my error logs I

> get this output:
> 
> fputs() [function.fputs]: send of 22
bytes 
> failed with errno=32 Broken pipe /public_html/class.smtp.php 489
> 
> The code that sends the mail is derived from here:
> http://www.phpclasses.org/browse/file/920.html
> 
> It's mostly rock solid code, so far as I know, so I suspect the
problem 
> to more with my server settings or something.
> 
> That said, I don't know what differentiates a failed mailing and a 
> successful one.
> 
> After a Google search, it seems "broken pipes" are a matter of time 
> outs. That's about as far as I understand it, though.
> 
> Can anyone throw me a tip as to how I might diagnose this problem?

"Broken pipe" is a euphemism for "Network error". There are any number
of causes including the remote server closing the socket, a switch or
hub between here and there is bogged down by backup traffic, or a
segment your connection passes through became too busy with higher
priority video traffic. The actual details are difficult to determine
and none of the administrators involved will ever admit they had a
problem. In most cases the TCP/IP error will simply tell you it timed
out waiting for a response. Your code should be able to re-open the
connection at this point and resend the message that triggered the
error. Then resume working on the rest of your list.

Bob McConnell

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



[PHP] Reformat array result.

2010-09-08 Thread Paul Halliday
I have been starting at this problem blankly for a couple hours now.
Hopefully someone can help.

I have a query that returns an event count grouped by hour:

timestamp:
Array ( [0] => 2010-09-08 03 [1] => 2010-09-08 04 [2] => 2010-09-08 05
[3] => 2010-09-08 06 [4] => 2010-09-08 07 [5] => 2010-09-08 08 [6] =>
2010-09-08 09 [7] => 2010-09-08 10 [8] => 2010-09-08 11 [9] =>
2010-09-08 12 [10] => 2010-09-08 13 [11] => 2010-09-08 14 [12] =>
2010-09-08 15 [13] => 2010-09-08 16 ) 24

event count:
Array ( [0] => 1731 [1] => 885 [2] => 544 [3] => 668 [4] => 748 [5] =>
754 [6] => 933 [7] => 2422 [8] => 6713 [9] => 31925 [10] => 18827 [11]
=> 16743 [12] => 16875 [13] => 11775 )

Lets say that coming into this, I knew that the query spanned 36 hours
and started at 01:00. How can I manipulate the resulting array to
contain the missing time stamps and a value of 0.

The effect I am shooting for looks like this:

http://www.pintumbler.org/example.png

So 0  - > 23 will be static and I just walk through the array and
populate those. If we hit 23, start a new row and continue. The matrix
will always be the same though.

I think I know what needs to happen, I just cant come up with the logic.

Any push in the right direction would be appreciated.
-- 
Paul Halliday
Ideation | Individualization | Learner | Achiever | Analytical
http://www.pintumbler.org

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



Re: [PHP] logical AND assignments

2010-09-08 Thread David Harkness
The reason for "and" to have such a low precedence is so you can use it to
perform conditional processing. You can probably achieve every effect using
"&&", but you'd need more parentheses. More typically you would use "or" in
this fashion:

defined('DS') or define('DS', DIRECTORY_SEPARATOR);

This checks if DS is defined and defines it if not.

APP_ENV != 'prod' or die('This feature must not be used in production');

If we're in production, stop execution with an error. Using || here would
try to logically or the string 'prod' with the return value of die(). Of
course, die() doesn't return, so the script would exit no matter what
APP_ENV was set to.

David


[PHP] Filestat.c erorrs when building php-5.3.3 on solaris

2010-09-08 Thread STANFIELD, VICKI CTR DFAS
I am trying to build php-5.3.3 and getting the following error: 

/users/0/php-5.3.3/TSRM -I/users/0/php-5.3.3/Zend
-I/usr/local/include -g -O2 -DZTS   -c
/users/0/php-5.3.3/ext/standard/filestat.c -o
ext/standard/filestat.lo 
/users/0/php-5.3.3/ext/standard/filestat.c: In function
`php_do_chgrp':
/users/0/php-5.3.3/ext/standard/filestat.c:416: error: too many
arguments to function `getgrnam_r'
/users/0/php-5.3.3/ext/standard/filestat.c: In function
`php_do_chown':
/users/0/php-5.3.3/ext/standard/filestat.c:517: error: too many
arguments to function `getpwnam_r'
make: *** [ext/standard/filestat.lo] Error 1

I have set my ORACLE_HOME, my PATH, and my LD_LIBRARY_PATH
And used the following configure command:

./configure --prefix=/app/php533 --with-apxs2=/app/apache2215/bin/apxs
--with-zlib --with-zlib-dir=/usr/lib --with-png-dir=/usr/include/libpng
--with-openssl=/shared_ro/openssl_098
--with-oci8=/shared_ro/users.oracle/11.1.0

I am using gmake 3.80. Can anyone give me a hint as to what I am doing
wrong in this build?

  -Vicki Stanfield, RHCE, CISSP

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



RE: [PHP] RE: PHP list posting confirmation for vicki.stanfield....@dfas.mil

2010-09-08 Thread STANFIELD, VICKI CTR DFAS
That was a mistake. My apologies. I meant to change the Subject line
before hitting send.

  -Vicki Stanfield, RHCE, CISSP
Web Management Group
tso-cs-web-t...@dfas.mil

Defense Finance and Accounting Service
Technical Services Organization - Corporate Services
vicki.stanfield@dfas.mil
(317)510-3375

-Original Message-
From: tedd [mailto:tedd.sperl...@gmail.com] 
Sent: Wednesday, September 08, 2010 9:22 AM
To: STANFIELD, VICKI CTR DFAS; php-general@lists.php.net
Subject: [PHP] RE: PHP list posting confirmation for
vicki.stanfield@dfas.mil

At 9:03 AM -0400 9/8/10, STANFIELD, VICKI CTR DFAS wrote:
>I am trying to build php-5.3.3 and getting the following error:


And what does the Subject line say about your problem? Absolutely
nothing!

Please understand that these Q&A's are kept in the archives for 
others to read, review, and resolve their problems.

You will do much better at getting your question answered by 
following normal practices for most all list servers. IOW, briefly 
describe your problem in the subject line and submit your problem.

Cheers,

tedd

-- 
---
http://sperling.com/

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



[PHP] RE: PHP list posting confirmation for vicki.stanfield....@dfas.mil

2010-09-08 Thread tedd

At 9:03 AM -0400 9/8/10, STANFIELD, VICKI CTR DFAS wrote:

I am trying to build php-5.3.3 and getting the following error:



And what does the Subject line say about your problem? Absolutely nothing!

Please understand that these Q&A's are kept in the archives for 
others to read, review, and resolve their problems.


You will do much better at getting your question answered by 
following normal practices for most all list servers. IOW, briefly 
describe your problem in the subject line and submit your problem.


Cheers,

tedd

--
---
http://sperling.com/

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



[PHP] Recall: PHP list posting confirmation for vicki.stanfield....@dfas.mil

2010-09-08 Thread STANFIELD, VICKI CTR DFAS
STANFIELD, VICKI CTR DFAS would like to recall the message, "PHP list posting 
confirmation for vicki.stanfield@dfas.mil".

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



[PHP] RE: PHP list posting confirmation for vicki.stanfield....@dfas.mil

2010-09-08 Thread STANFIELD, VICKI CTR DFAS
I am trying to build php-5.3.3 and getting the following error: 

/users/0/php-5.3.3/TSRM -I/users/cin05038/php-5.3.3/Zend
-I/usr/local/include -g -O2 -DZTS   -c
/users/0/php-5.3.3/ext/standard/filestat.c -o
ext/standard/filestat.lo 
/users/0/php-5.3.3/ext/standard/filestat.c: In function
`php_do_chgrp':
/users/0/php-5.3.3/ext/standard/filestat.c:416: error: too many
arguments to function `getgrnam_r'
/users/0/php-5.3.3/ext/standard/filestat.c: In function
`php_do_chown':
/users/0/php-5.3.3/ext/standard/filestat.c:517: error: too many
arguments to function `getpwnam_r'
make: *** [ext/standard/filestat.lo] Error 1

I have set my ORACLE_HOME, my PATH, and my LD_LIBRARY_PATH
And used the following configure command:

./configure --prefix=/app/php532 --with-apxs2=/app/apache2215/bin/apxs
--with-zlib --with-zlib-dir=/usr/lib --with-png-dir=/usr/include/libpng
--with-openssl=/shared_ro/openssl_098
--with-oci8=/shared_ro/users.oracle/11.1.0

I have tried the make that came on Solaris 10 and gmake and get the same
error either way. Can anyone give me a hint as to what I am doing wrong
in this build?

  -Vicki Stanfield, RHCE, CISSP
Web Management Group


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