php-general Digest 4 Feb 2011 13:37:49 -0000 Issue 7165
Topics (messages 311135 through 311143):
Re: Memcache problems
311135 by: Alex Nikitin
311136 by: Jostein Eriksen
311137 by: Adam Richardson
311138 by: Jostein Eriksen
311139 by: Alex Nikitin
bread and buytter php
311140 by: Kirk Bailey
311141 by: Paul M Foster
311142 by: David Robley
override built-in mail()
311143 by: Steve Staples
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 ---
There could be many a reasons for this, and it really depends on your setup.
For example, is php and memcache on the same server, if they are not what is
the network topology like, it could be a piece of hardware starting to
malfunction, it could be an issue with the networking driver, on the other
hand it could be neither; but to help you figure out where to look, one
should hope to see a little bit more info...
~Alex
On Thu, Feb 3, 2011 at 3:10 PM, Jostein Eriksen <[email protected]> wrote:
> Hi,
>
> I've been having some problems with memcache lately.
> It seems to me that php is dropping connection to the memcache server mid
> way through the scripts.
> I've sat the failure_callback to log failures. And I'm getting a lot of
> them. Several every minute.
>
> I'm quite stuck now and realy dont know where to go from here.
> I've tried to telnet into the server. And there is no problem with either
> set nor get commands. I've started the memcached daemon with -vvv to see if
> I can dig anything interesting from the logs, but I can find no errors of
> any kind in them. There is also no errors that I can find in the php_error
> log.
>
> I would appreciate some help, if anyone have any ideas of what is going on.
>
> thanks.
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
--- End Message ---
--- Begin Message ---
Both php and memcached is running on the same server.
memcached version 1.2.2
php5-memcache version 2.2.0
php version 5.2.4
here is a snippet from my code that may be of interest
$cfg['serverList'] = array('127.0.0.1', 11211, 1, 1);
...
$this->memcache = new Memcache();
foreach($cfg['serverList'] as $value){
/** host, port, persistent, weight, timeout, retry interval, status,
failure callback */
$this->memcache->addServer($value[0], $value[1], false, $value[2],
$value[3], 2, true, array($this, 'fail'));
}
/Jostein
On 02/03/2011 09:34 PM, Alex Nikitin wrote:
There could be many a reasons for this, and it really depends on your setup.
For example, is php and memcache on the same server, if they are not what is
the network topology like, it could be a piece of hardware starting to
malfunction, it could be an issue with the networking driver, on the other
hand it could be neither; but to help you figure out where to look, one
should hope to see a little bit more info...
~Alex
On Thu, Feb 3, 2011 at 3:10 PM, Jostein Eriksen<[email protected]> wrote:
Hi,
I've been having some problems with memcache lately.
It seems to me that php is dropping connection to the memcache server mid
way through the scripts.
I've sat the failure_callback to log failures. And I'm getting a lot of
them. Several every minute.
I'm quite stuck now and realy dont know where to go from here.
I've tried to telnet into the server. And there is no problem with either
set nor get commands. I've started the memcached daemon with -vvv to see if
I can dig anything interesting from the logs, but I can find no errors of
any kind in them. There is also no errors that I can find in the php_error
log.
I would appreciate some help, if anyone have any ideas of what is going on.
thanks.
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
--- End Message ---
--- Begin Message ---
On Thu, Feb 3, 2011 at 4:19 PM, Jostein Eriksen <[email protected]> wrote:
> Both php and memcached is running on the same server.
> memcached version 1.2.2
> php5-memcache version 2.2.0
> php version 5.2.4
>
> here is a snippet from my code that may be of interest
> $cfg['serverList'] = array('127.0.0.1', 11211, 1, 1);
> ...
> $this->memcache = new Memcache();
> foreach($cfg['serverList'] as $value){
> /** host, port, persistent, weight, timeout,
> retry interval, status, failure callback */
> $this->memcache->addServer($value[0],
> $value[1], false, $value[2], $value[3], 2, true, array($this, 'fail'));
> }
>
>
Are you sure you copied this correctly?
In the code above, you set the array key 'serverList' to an array containing
('127.0.0.1', 11211, 1, 1);
Then, you foreach through the values of the 'serverList' array (first
iteration, value would equal '127.0.0.1', second, value would equal 11211,
etc.)
Then, you use array notation to access the first position of $value. In the
first iteration of the foreach, $value would equal '127.0.0.1', so $value[0]
would give you '1', $value[1] would give you '2', etc.
Do you see what I'm saying? Did you forget or omit other relevant code? Or,
I'm just having a really bad code day (in this case, I'll likely see my
error just after sending this email.)
Adam
--
Nephtali: A simple, flexible, fast, and security-focused PHP framework
http://nephtaliproject.com
--- End Message ---
--- Begin Message ---
On 02/03/2011 10:49 PM, Adam Richardson wrote:
On Thu, Feb 3, 2011 at 4:19 PM, Jostein Eriksen<[email protected]> wrote:
Both php and memcached is running on the same server.
memcached version 1.2.2
php5-memcache version 2.2.0
php version 5.2.4
here is a snippet from my code that may be of interest
$cfg['serverList'] = array('127.0.0.1', 11211, 1, 1);
...
$this->memcache = new Memcache();
foreach($cfg['serverList'] as $value){
/** host, port, persistent, weight, timeout,
retry interval, status, failure callback */
$this->memcache->addServer($value[0],
$value[1], false, $value[2], $value[3], 2, true, array($this, 'fail'));
}
Are you sure you copied this correctly?
In the code above, you set the array key 'serverList' to an array containing
('127.0.0.1', 11211, 1, 1);
Then, you foreach through the values of the 'serverList' array (first
iteration, value would equal '127.0.0.1', second, value would equal 11211,
etc.)
Then, you use array notation to access the first position of $value. In the
first iteration of the foreach, $value would equal '127.0.0.1', so $value[0]
would give you '1', $value[1] would give you '2', etc.
Do you see what I'm saying? Did you forget or omit other relevant code? Or,
I'm just having a really bad code day (in this case, I'll likely see my
error just after sending this email.)
Adam
My bad.
it should be:
'serverList' => array(
/** host, port, weight, timeout */
'default' => array('127.0.0.1', 11211,
1, 1),
)),
Didn't copy/paste the $cfg = line, so it got messed up.
/Jostein
--- End Message ---
--- Begin Message ---
Short of some process going crazy, which you should check for, some psing,
top and netstat, i cant think of any reason you should ever get a connection
drop, short of a hardware failure (memory perhaps), or an experimental
kernel settings or modules or something... i cant think of any way that a
connection to 127.0.0.1 would ever possibly get dropped, loopback device
never hits your network hardware...
~Alex
On Thu, Feb 3, 2011 at 5:00 PM, Jostein Eriksen <[email protected]> wrote:
> On 02/03/2011 10:49 PM, Adam Richardson wrote:
>
>> On Thu, Feb 3, 2011 at 4:19 PM, Jostein Eriksen<[email protected]>
>> wrote:
>>
>> Both php and memcached is running on the same server.
>>> memcached version 1.2.2
>>> php5-memcache version 2.2.0
>>> php version 5.2.4
>>>
>>> here is a snippet from my code that may be of interest
>>> $cfg['serverList'] = array('127.0.0.1', 11211, 1, 1);
>>> ...
>>> $this->memcache = new Memcache();
>>> foreach($cfg['serverList'] as $value){
>>> /** host, port, persistent, weight,
>>> timeout,
>>> retry interval, status, failure callback */
>>> $this->memcache->addServer($value[0],
>>> $value[1], false, $value[2], $value[3], 2, true, array($this, 'fail'));
>>> }
>>>
>>>
>>> Are you sure you copied this correctly?
>>
>> In the code above, you set the array key 'serverList' to an array
>> containing
>> ('127.0.0.1', 11211, 1, 1);
>>
>> Then, you foreach through the values of the 'serverList' array (first
>> iteration, value would equal '127.0.0.1', second, value would equal 11211,
>> etc.)
>>
>> Then, you use array notation to access the first position of $value. In
>> the
>> first iteration of the foreach, $value would equal '127.0.0.1', so
>> $value[0]
>> would give you '1', $value[1] would give you '2', etc.
>>
>> Do you see what I'm saying? Did you forget or omit other relevant code?
>> Or,
>> I'm just having a really bad code day (in this case, I'll likely see my
>> error just after sending this email.)
>>
>> Adam
>>
>>
> My bad.
>
> it should be:
> 'serverList' => array(
> /** host, port, weight, timeout */
> 'default' => array('127.0.0.1',
> 11211, 1, 1),
> )),
>
> Didn't copy/paste the $cfg = line, so it got messed up.
>
> /Jostein
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
--- End Message ---
--- Begin Message ---
Where is a good place for bread and butter day in day out routinely
needed functionality in php?
--
end
Very Truly yours,
- Kirk Bailey,
Largo Florida
kniht
+-----+
| BOX |
+-----+
think
--- End Message ---
--- Begin Message ---
On Thu, Feb 03, 2011 at 10:47:08PM -0500, Kirk Bailey wrote:
> Where is a good place for bread and butter day in day out routinely
> needed functionality in php?
I reeeally think you're going to have to be a little more specific.
Paul
--
Paul M. Foster
http://noferblatz.com
--- End Message ---
--- Begin Message ---
Kirk Bailey wrote:
> Where is a good place for bread and butter day in day out routinely
> needed functionality in php?
>
Content management system? Framework? PEAR? Write your own library/classes?
Cheers
--
David Robley
Iraqi Bingo B-52..F-16..A-10.. F-18..F-117..B-2
Today is Setting Orange, the 35th day of Chaos in the YOLD 3177.
--- End Message ---
--- Begin Message ---
Hello Guys/Gals,
it's friday (at least where I am it is) and I have an issue with a
script that I just started using again. The problem is, is that it uses
the built in PHP mail() function, and on my testing server, mail()
doesn't work. The other issue, is that I use SMTP Auth to connect to my
mail server, so that when mail sends out, it comes from my mail server
so that there is less of a chance for being marked as SPAM.
So, what I am looking to do, is use either the trust old Pear::Mail or
PHPMailer scripts (I am sure there are other ones out there, but those
are the 2 I am most familiar with).
So now to my actual question. How can I override the built-in PHP
mail() function, to let either of those 2 (or something else someone may
suggest) to act in the same manner as the mail() function?
Is this easy? I've googled, but haven't seen any reference to doing
what I am looking to do (maybe I just can't google)
Steve
--- End Message ---