php-general Digest 9 Aug 2012 20:45:24 -0000 Issue 7916
Topics (messages 318657 through 318659):
PHP 5.4.5 Sendmail issues on Mountain Lion
318657 by: Mr. Gecko
Re: XML/PHP web service
318658 by: Alejandro Michelin Salomon
Re: PHP session variables
318659 by: Tedd Sperling
Administrivia:
To subscribe to the digest, e-mail:
php-general-digest-subscr...@lists.php.net
To unsubscribe from the digest, e-mail:
php-general-digest-unsubscr...@lists.php.net
To post to the list, e-mail:
php-gene...@lists.php.net
----------------------------------------------------------------------
--- Begin Message ---
I have been having issues on Mountain Lion with PHP 5.4.5 and sendmail.
The issue I'm having is after a while of PHP FPM running, sendmail doesn't
receive any response from php as to what to send and they just start eating CPU
like no tomorrow.
Result from ps -ev
PID STAT TIME SL RE PAGEIN VSZ
RSS LIM TSIZ %CPU %MEM COMMAND
63033 R+ 36:04.95 0 0 0 2487444
11592 - 0 7.5 0.3
/usr/local/sbin/php-fpm -y /usr/local/etc/php-fpm.conf
62705 R+ 71:46.92 0 0 0 2487444
11488 - 0 9.3 0.3
/usr/local/sbin/php-fpm -y /usr/local/etc/php-fpm.conf
64097 S+ 6:13.31 0 0 0 2486420
10872 - 0 11.1 0.3 /usr/local/sbin/php-fpm
-y /usr/local/etc/php-fpm.conf
62852 R+ 98:04.71 0 0 0 2487444
10724 - 0 17.6 0.3 /usr/local/sbin/php-fpm
-y /usr/local/etc/php-fpm.conf
63192 R+ 16:56.78 0 0 0 2487444
10536 - 0 18.0 0.3 /usr/local/sbin/php-fpm
-y /usr/local/etc/php-fpm.conf
62696 S+ 82:22.54 0 0 0 2486932
10508 - 0 7.0 0.3
/usr/local/sbin/php-fpm -y /usr/local/etc/php-fpm.conf
63228 R+ 48:22.29 0 0 0 2486932
10376 - 0 11.2 0.2 /usr/local/sbin/php-fpm
-y /usr/local/etc/php-fpm.conf
64245 S+ 0:01.39 0 0 0 2485396
10068 - 0 0.0 0.2
/usr/local/sbin/php-fpm -y /usr/local/etc/php-fpm.conf
64170 S+ 0:01.91 0 0 0 2486800
9980 - 0 0.0 0.2
/usr/local/sbin/php-fpm -y /usr/local/etc/php-fpm.conf
64016 S+ 12:42.38 0 0 0 2486932
9832 - 0 17.3 0.2 /usr/local/sbin/php-fpm
-y /usr/local/etc/php-fpm.conf
63735 R+ 25:47.13 0 0 0 2485908
9804 - 0 6.6 0.2
/usr/local/sbin/php-fpm -y /usr/local/etc/php-fpm.conf
62697 R+ 108:26.24 0 0 0 2488980
9520 - 0 5.5 0.2
/usr/local/sbin/php-fpm -y /usr/local/etc/php-fpm.conf
64417 S+ 0:00.55 0 0 0 2490004
9164 - 0 0.0 0.2
/usr/local/sbin/php-fpm -y /usr/local/etc/php-fpm.conf
62695 S+ 0:01.12 0 0 0 2453520
7220 - 0 0.0 0.2
/usr/local/sbin/php-fpm -y /usr/local/etc/php-fpm.conf
63356 R+ 30:00.65 0 0 0 2484628
6664 - 0 7.2 0.2
/usr/local/sbin/php-fpm -y /usr/local/etc/php-fpm.conf
64416 S+ 0:00.52 0 0 0 2484116
6308 - 0 0.0 0.2
/usr/local/sbin/php-fpm -y /usr/local/etc/php-fpm.conf
63834 R+ 16:53.13 0 0 0 2483604
6224 - 0 6.2 0.1
/usr/local/sbin/php-fpm -y /usr/local/etc/php-fpm.conf
62972 R+ 92:41.92 0 0 0 2484628
5984 - 0 5.7 0.1
/usr/local/sbin/php-fpm -y /usr/local/etc/php-fpm.conf
63123 R+ 77:41.10 0 0 0 2456980
5792 - 0 7.5 0.1
/usr/local/sbin/php-fpm -y /usr/local/etc/php-fpm.conf
63896 R+ 20:12.37 0 0 0 2456468
5740 - 0 17.4 0.1 /usr/local/sbin/php-fpm
-y /usr/local/etc/php-fpm.conf
64090 R+ 16:42.77 0 0 0 2475156
4664 - 0 6.4 0.1
/usr/local/sbin/php-fpm -y /usr/local/etc/php-fpm.conf
63894 R+ 25:53.20 0 0 0 2474132
4660 - 0 11.2 0.1 /usr/local/sbin/php-fpm
-y /usr/local/etc/php-fpm.conf
63024 R+ 91:44.42 0 0 0 2434384
1692 - 0 11.3 0.0 /usr/sbin/sendmail -t -i
62968 S+ 97:13.03 0 0 0 2434384
1692 - 0 18.9 0.0 /usr/sbin/sendmail -t -i
64215 R+ 12:42.18 0 0 0 2434384
1692 - 0 5.7 0.0
/usr/sbin/sendmail -t -i
63189 R+ 71:10.12 0 0 0 2434384
1692 - 0 5.7 0.0
/usr/sbin/sendmail -t -i
64091 R+ 16:32.74 0 0 0 2434384
1692 - 0 6.1 0.0
/usr/sbin/sendmail -t -i
62842 S+ 107:38.59 0 0 0 2434384
1692 - 0 15.6 0.0 /usr/sbin/sendmail -t -i
63465 S+ 48:01.11 0 0 0 2434384
1692 - 0 6.9 0.0
/usr/sbin/sendmail -t -i
64085 R+ 16:41.19 0 0 0 2434384
1692 - 0 6.6 0.0
/usr/sbin/sendmail -t -i
64081 S+ 16:52.15 0 0 0 2434384
1692 - 0 11.2 0.0 /usr/sbin/sendmail -t -i
63897 R+ 25:30.53 0 0 0 2434384
1692 - 0 8.4 0.0
/usr/sbin/sendmail -t -i
63686 R+ 35:50.08 0 0 0 2434384
1692 - 0 5.5 0.0
/usr/sbin/sendmail -t -i
64000 S+ 20:15.85 0 0 0 2434384
1692 - 0 11.1 0.0 /usr/sbin/sendmail -t -i
63891 R+ 25:37.14 0 0 0 2434384
1692 - 0 16.0 0.0 /usr/sbin/sendmail -t -i
63108 S+ 81:59.72 0 0 0 2434384
1692 - 0 5.8 0.0
/usr/sbin/sendmail -t -i
63829 R+ 29:42.40 0 0 0 2434384
1692 - 0 12.1 0.0 /usr/sbin/sendmail -t -i
64404 S+ 6:12.46 0 0 0 2434384
1692 - 0 16.9 0.0 /usr/sbin/sendmail -t -i
63143 R+ 77:55.06 0 0 0 2434384
1692 - 0 5.7 0.0
/usr/sbin/sendmail -t -i
64094 S+ 0:00.01 0 0 0 2434356
1676 - 0 0.0 0.0
/usr/sbin/postdrop -r
63111 S+ 0:00.01 0 0 0 2434356
1676 - 0 0.0 0.0
/usr/sbin/postdrop -r
63027 S+ 0:00.01 0 0 0 2434356
1676 - 0 0.0 0.0
/usr/sbin/postdrop -r
63193 S+ 0:00.01 0 0 0 2434356
1676 - 0 0.0 0.0
/usr/sbin/postdrop -r
64088 S+ 0:00.01 0 0 0 2434356
1676 - 0 0.0 0.0
/usr/sbin/postdrop -r
64218 S+ 0:00.01 0 0 0 2434356
1676 - 0 0.0 0.0
/usr/sbin/postdrop -r
64003 S+ 0:00.01 0 0 0 2434356
1676 - 0 0.0 0.0
/usr/sbin/postdrop -r
63895 S+ 0:00.01 0 0 0 2434356
1676 - 0 0.0 0.0
/usr/sbin/postdrop -r
64407 S+ 0:00.01 0 0 0 2434356
1676 - 0 0.0 0.0
/usr/sbin/postdrop -r
62971 S+ 0:00.01 0 0 0 2434356
1676 - 0 0.0 0.0
/usr/sbin/postdrop -r
63832 S+ 0:00.01 0 0 0 2434356
1676 - 0 0.0 0.0
/usr/sbin/postdrop -r
64084 S+ 0:00.01 0 0 0 2434356
1676 - 0 0.0 0.0
/usr/sbin/postdrop -r
63690 S+ 0:00.01 0 0 0 2434356
1676 - 0 0.0 0.0
/usr/sbin/postdrop -r
63146 S+ 0:00.01 0 0 0 2434356
1672 - 0 0.0 0.0
/usr/sbin/postdrop -r
63468 S+ 0:00.01 0 0 0 2434356
1672 - 0 0.0 0.0
/usr/sbin/postdrop -r
62845 S+ 0:00.02 0 0 0 2434356
1672 - 0 0.0 0.0
/usr/sbin/postdrop -r
63898 S+ 0:00.01 0 0 0 2434356
1668 - 0 0.0 0.0
/usr/sbin/postdrop -r
36047 S 0:00.59 0 0 0 2434476
1836 - 0 0.0 0.0 qmgr -l -t fifo
-u
36044 Ss 0:01.88 0 0 0 2434328
1740 - 0 0.0 0.0 master
64355 S 0:00.03 0 0 0 2434408
1716 - 0 0.0 0.0 pickup -l -t
fifo -u
According to FPM status page, some of these were running for as long as 8h 10m
48s 630ms 580µs.
As soon as I quit PHP-FPM, I see this message in postfix's log:
Aug 8 17:06:29 mrgeckosmedia.local postfix/sendmail[61602]: fatal: _www(70):
No recipient addresses found in message header
I looked at the error log with "error_reporting = E_ALL & ~E_STRICT &
~E_DEPRECATED" configured and saw nothing mail related.
I know mail works, as the tests I have done worked well. Even the mail function
which is called from the scripts that were running for hours due to this issue
worked in my testing.
Any help? This slows down my server and makes me so I have to quit and relaunch
php-fpm. I may be missing some feedback from customers.
--- End Message ---
--- Begin Message ---
Philip :
Try this:
Client:
$client = new SoapClient( null, array( 'encoding' => 'utf-8', 'soap_version'
=> SOAP_1_2, 'trace' => 1,
'uri' => 'tns: Server', 'location' => 'php
server URL here'));
// Cut off <?xml version="1.0" encoding="utf-8"?>, to not have two xml start
tag in the soap message.
$xmlres = $client->__soapCall( 'ProXML', array( str_replace( '<?xml
version="1.0" encoding="utf-8"?>'."\n", '', $sXml )));
echo '<pre>', $xmlres, '</pre>'; // print the xml output or
var_export($xmlres, true) if $xmlres is an array.
SERVER:
class Receiver
{
public function ProXML ( $sXML )
{
libxml_use_internal_errors(true); // enabled use libxml errors
// try..catch to cacth simplexmlelement errors
try
{
$xml = new SimpleXMLElement( '<?xml version="1.0"
encoding="utf-8"?>' . $sXML ); // Try to create a xml object with the string
passed
} catch (Exception $e) {
$aErrors = libxml_get_errors(); // get errors
foreach ( $aErros as $oErro )
{
switch ( $oErro->level )
{
case LIBXML_ERR_WARNING:
$sCod .= '<return><code>' . $oErro->code .
'</code><menssage>' . utf8_encode( 'warning: ' . $oErro->message ) .
'</menssage></return>';
break;
case LIBXML_ERR_ERROR:
$sCod .= '<resposta><codigo>' . $oErro->code .
'</code><menssage>' . utf8_encode( 'Error: ' . $oErro->message ) .
'</menssage></return>';
break;
case LIBXML_ERR_FATAL:
$sCod .= '<resposta><codigo>' . $oErro->code .
'</code><menssage>' . utf8_encode( ' Fatal Error: ' . $oErro->message ) .
'</menssage></return>';
break;
}
}
}
work here ...
}
}
$server = new SoapServer(null, array( 'uri' => 'tns: Server' ));
$server->setClass('Receiver');
$server->handle();
Alejandro M.S
-----Mensagem original-----
De: Phillip Baker [mailto:phil...@freewolf.net]
Enviada em: quarta-feira, 8 de agosto de 2012 19:12
Para: php-gene...@lists.php.net
Assunto: [PHP] XML/PHP web service
Greetings all,
I am looking for some options here.
I am in need of creating a service on our web server that will always be
available and automated.
It will accept an XML file.
I will be checking to see if the XML file is valid and then passing it on to
another server.
But I need to accept this file without using a submit form.
I have never done anything like this and looking for ideas.
I am using a lamp environment and looking for suggestions.
I am looking to set this up so that our vendors can set up scripts to
automatically post XML files to our servers.
Blessed Be
Phillip
"In the Jim Crow South, for example, government failed and indeed refused to
protect blacks from extra-legal violence. Given our history, it's stunning
we fail to question those who would force upon us a total reliance on the
state for defense."
-- Robert J. Cottrol
--- End Message ---
--- Begin Message ---
On Aug 8, 2012, at 5:41 PM, Jim Giner <jim.gi...@albanyhandball.com> wrote:
> On 8/8/2012 11:24 AM, Ansry User 01 wrote:
>> I am setting the _SESSION variables in one of my file, but whenever I leave
>> the php page session variables are not accessible. Not sure what I need to
>> do additionally other then defining _SESSION[].
>> Any pointer.
>>
> You must make it a habit to start each script with
>
> session_start();
>
I like this way:
if (!session_id())
{
session_start();
}
Cheers,
tedd
_____________________
t...@sperling.com
http://sperling.com
--- End Message ---