[PHP] Fatal error: Allowed memory size of XXXXX bytes exhausted
Hello, I have an issu with a script launched by cron. In fact, although i setup php memory_limit to high value (1G or 2Go), i have the same issue. By example with 2G : Output from command /usr/bin/php5 -d memory_limit=2G -f /home/test/www/cron.php .. Fatal error: Allowed memory size of 536870912 bytes exhausted (tried to allocate 266257 bytes) in /home/test/www/app/code/local/Ess/M2e/Model/M2eConnector.php on line 423 And with 1G : Output from command /usr/bin/php5 -d memory_limit=1G -f /home/test/www/cron.php .. Fatal error: Allowed memory size of 536870912 bytes exhausted (tried to allocate 267717 bytes) in /home/test/www/app/code/local/Ess/M2e/Model/M2eConnector.php on line 423 Result is the same... Do you know why ? This is my php version : /usr/bin/php5 -v PHP 5.2.6-1+lenny4 with Suhosin-Patch 0.9.6.2 (cli) (built: Nov 22 2009 01:50:58) Copyright (c) 1997-2008 The PHP Group Zend Engine v2.2.0, Copyright (c) 1998-2008 Zend Technologies with the ionCube PHP Loader v3.3.20, Copyright (c) 2002-2010, by ionCube Ltd., and with Zend Optimizer v3.3.9, Copyright (c) 1998-2009, by Zend Technologies On a Debian Lenny, 64 bits version. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Error message not understood
Probably a PHP compilation problem. The message seems refer to the headers (libmysql.h) used in the ../configure phase of the building process. It seems like your PHP version was compiled using a MySQL 5.0.11 version header, while your connecting to a server running MySQL 5.1.51, Have you upgraded your MySQL recently? are you using the MySQL server on the same machine that runs Apache/IIS/etc.. and PHP? Sorry for the "Italianese" english :) Luigi. Il giorno 15/ott/2010, alle ore 23.19, Tommy Pham ha scritto: >> -Original Message- >> From: Tommy Pham [mailto:tommy...@gmail.com] >> Sent: Friday, October 15, 2010 2:16 PM >> To: 'sueandant'; 'PHP' >> Subject: RE: [PHP] Error message not understood >> >>> -Original Message- >>> From: sueandant [mailto:hollandsath...@tiscali.co.uk] >>> Sent: Friday, October 15, 2010 2:02 PM >>> To: PHP >>> Subject: [PHP] Error message not understood >>> >>> Can anyone help me with this error message and explain how to correct >>> the mismatch? >>> >>> PHP Warning: mysqli_connect() [function.mysqli-connect]: Headers and client library >>> minor version mismatch. Headers:50051 Library:50151 >>> >>> tholland >> >> It would help if you provide the platform and platform version: >> Windows, Linux, Mac, FreeBSD, or other variants. >> >> And also the PHP version you're using. Did you compile PHP yourself or > use >> a distribution? >> >> Regards, >> Tommy > > Forgot to mention this earlier... too hasty on the send button ... lol. > > Since it's only a warning and you are able to connect, run [1] & [2] to see > what do you get. > > [1] http://us2.php.net/manual/en/mysqli.get-client-info.php > [2] http://us2.php.net/manual/en/mysqli.info.php > > > > -- > 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
RE: [PHP] Error message not understood
> -Original Message- > From: Tommy Pham [mailto:tommy...@gmail.com] > Sent: Friday, October 15, 2010 2:16 PM > To: 'sueandant'; 'PHP' > Subject: RE: [PHP] Error message not understood > > > -Original Message- > > From: sueandant [mailto:hollandsath...@tiscali.co.uk] > > Sent: Friday, October 15, 2010 2:02 PM > > To: PHP > > Subject: [PHP] Error message not understood > > > > Can anyone help me with this error message and explain how to correct > > the mismatch? > > > > PHP Warning: mysqli_connect() [function.mysqli-connect]: Headers and client library > > minor version mismatch. Headers:50051 Library:50151 > > > > tholland > > It would help if you provide the platform and platform version: > Windows, Linux, Mac, FreeBSD, or other variants. > > And also the PHP version you're using. Did you compile PHP yourself or use > a distribution? > > Regards, > Tommy Forgot to mention this earlier... too hasty on the send button ... lol. Since it's only a warning and you are able to connect, run [1] & [2] to see what do you get. [1] http://us2.php.net/manual/en/mysqli.get-client-info.php [2] http://us2.php.net/manual/en/mysqli.info.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Error message not understood
> -Original Message- > From: sueandant [mailto:hollandsath...@tiscali.co.uk] > Sent: Friday, October 15, 2010 2:02 PM > To: PHP > Subject: [PHP] Error message not understood > > Can anyone help me with this error message and explain how to correct the > mismatch? > > PHP Warning: mysqli_connect() [function.mysqli-connect]: Headers and client library minor > version mismatch. Headers:50051 Library:50151 > > tholland It would help if you provide the platform and platform version: Windows, Linux, Mac, FreeBSD, or other variants. And also the PHP version you're using. Did you compile PHP yourself or use a distribution? Regards, Tommy -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Error message not understood
Can anyone help me with this error message and explain how to correct the mismatch? PHP Warning: mysqli_connect() [function.mysqli-connect]: Headers and client library minor version mismatch. Headers:50051 Library:50151 tholland
Re: [PHP] RegExp question: how to add a number?
On Fri, Oct 15, 2010 at 11:07 AM, Richard Quadling wrote: > On 15 October 2010 15:45, Andrew Ballard wrote: >> On Fri, Oct 15, 2010 at 5:52 AM, Richard Quadling >> wrote: >>> On 15 October 2010 10:16, Ford, Mike wrote: > -Original Message- > From: Andre Polykanine [mailto:an...@oire.org] > Sent: 14 October 2010 21:42 > > Hi everyone, > I hope you're doing well (haven't written here for a long time :-)). > The question is as follows: I have a regexp that would do the > following. If the string begins with "Re:", it will change the > beginning to "Re[2]:"; if it doesn't, then it would add "Re:" at the > beginning. But (attention, here it is!) if the string starts with > something like "Re[4]:", it should replace it by "Re[5]:". > Here's the code: > > $start=mb_strtolower(mb_substr($f['Subject'], 0, 3)); > if ($start=="re:") { > $subject=preg_replace("/^re:(.+?)$/usi", "re[2]:$1", $f['Subject']); > } elseif ($start=="re[") { > // Here $1+1 doesn't work, it returns "Re[4+1]:"! > $subject=preg_replace("/^re\[(\d+)\]:(.+?)$/usi", "re[$1+1]:$2", > $f['Subject']); > } else { > $subject="Re: ".$f['Subject']; > } > > I know there actually exists a way to do the numeral addition > ("Re[5]:", not "Re[4+1]:"). > How do I manage to do this? This looks like a job for the "e" modifier (see http://php.net/manual/en/reference.pcre.pattern.modifiers.php, and example #4 at http://php.net/preg_replace). Something like: $subject = preg_replace("/^re\[(\d+)\:](.+?)$/eusi", "'re['.(\\1+1).']:\\2'", $f['Subject']); Cheers! Mike >>> >>> Watch out for the missing '[1]'. This needs to become '[2]' and not '[1]'. >>> >>> The callback seems to be the only way I could get the regex to work. >>> >> >> How about preg_replace_callback()? >> >> Andrew >> > > Already provided an example using that : > http://news.php.net/php.general/308728 > > It was the 'e' modifier I couldn't get to work, though I suppose, as > the code is eval'd, I should have been able to do it. > > The callback just seems a LOT easier. > Sorry - I missed the callback function in there. The loop threw me off because I thought that was part of the solution rather than a test container. Andrew -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] RegExp question: how to add a number?
On 15 October 2010 15:45, Andrew Ballard wrote: > On Fri, Oct 15, 2010 at 5:52 AM, Richard Quadling wrote: >> On 15 October 2010 10:16, Ford, Mike wrote: -Original Message- From: Andre Polykanine [mailto:an...@oire.org] Sent: 14 October 2010 21:42 Hi everyone, I hope you're doing well (haven't written here for a long time :-)). The question is as follows: I have a regexp that would do the following. If the string begins with "Re:", it will change the beginning to "Re[2]:"; if it doesn't, then it would add "Re:" at the beginning. But (attention, here it is!) if the string starts with something like "Re[4]:", it should replace it by "Re[5]:". Here's the code: $start=mb_strtolower(mb_substr($f['Subject'], 0, 3)); if ($start=="re:") { $subject=preg_replace("/^re:(.+?)$/usi", "re[2]:$1", $f['Subject']); } elseif ($start=="re[") { // Here $1+1 doesn't work, it returns "Re[4+1]:"! $subject=preg_replace("/^re\[(\d+)\]:(.+?)$/usi", "re[$1+1]:$2", $f['Subject']); } else { $subject="Re: ".$f['Subject']; } I know there actually exists a way to do the numeral addition ("Re[5]:", not "Re[4+1]:"). How do I manage to do this? >>> >>> This looks like a job for the "e" modifier (see >>> http://php.net/manual/en/reference.pcre.pattern.modifiers.php, and example >>> #4 at http://php.net/preg_replace). Something like: >>> >>> $subject = preg_replace("/^re\[(\d+)\:](.+?)$/eusi", >>> "'re['.(\\1+1).']:\\2'", $f['Subject']); >>> >>> Cheers! >>> >>> Mike >> >> Watch out for the missing '[1]'. This needs to become '[2]' and not '[1]'. >> >> The callback seems to be the only way I could get the regex to work. >> > > How about preg_replace_callback()? > > Andrew > Already provided an example using that : http://news.php.net/php.general/308728 It was the 'e' modifier I couldn't get to work, though I suppose, as the code is eval'd, I should have been able to do it. The callback just seems a LOT easier. -- Richard Quadling Twitter : EE : Zend @RQuadling : e-e.com/M_248814.html : bit.ly/9O8vFY -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] RegExp question: how to add a number?
On Fri, Oct 15, 2010 at 5:52 AM, Richard Quadling wrote: > On 15 October 2010 10:16, Ford, Mike wrote: >>> -Original Message- >>> From: Andre Polykanine [mailto:an...@oire.org] >>> Sent: 14 October 2010 21:42 >>> >>> Hi everyone, >>> I hope you're doing well (haven't written here for a long time :-)). >>> The question is as follows: I have a regexp that would do the >>> following. If the string begins with "Re:", it will change the >>> beginning to "Re[2]:"; if it doesn't, then it would add "Re:" at the >>> beginning. But (attention, here it is!) if the string starts with >>> something like "Re[4]:", it should replace it by "Re[5]:". >>> Here's the code: >>> >>> $start=mb_strtolower(mb_substr($f['Subject'], 0, 3)); >>> if ($start=="re:") { >>> $subject=preg_replace("/^re:(.+?)$/usi", "re[2]:$1", $f['Subject']); >>> } elseif ($start=="re[") { >>> // Here $1+1 doesn't work, it returns "Re[4+1]:"! >>> $subject=preg_replace("/^re\[(\d+)\]:(.+?)$/usi", "re[$1+1]:$2", >>> $f['Subject']); >>> } else { >>> $subject="Re: ".$f['Subject']; >>> } >>> >>> I know there actually exists a way to do the numeral addition >>> ("Re[5]:", not "Re[4+1]:"). >>> How do I manage to do this? >> >> This looks like a job for the "e" modifier (see >> http://php.net/manual/en/reference.pcre.pattern.modifiers.php, and example >> #4 at http://php.net/preg_replace). Something like: >> >> $subject = preg_replace("/^re\[(\d+)\:](.+?)$/eusi", >> "'re['.(\\1+1).']:\\2'", $f['Subject']); >> >> Cheers! >> >> Mike > > Watch out for the missing '[1]'. This needs to become '[2]' and not '[1]'. > > The callback seems to be the only way I could get the regex to work. > How about preg_replace_callback()? Andrew -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Help with sending credentials?
On 15 October 2010 10:51, Tommy Pham wrote: >> -Original Message- >> From: Richard Quadling [mailto:rquadl...@gmail.com] >> Sent: Friday, October 15, 2010 1:47 AM >> To: Brian Dunning >> Cc: PHP-General List >> Subject: Re: [PHP] Help with sending credentials? >> >> On 14 October 2010 21:45, Brian Dunning wrote: >> > Gents - >> > >> > I'm trying to work with a major vendor's web service, but all my efforts >> > are >> met with a 401 authentication error response. I can log in manually to this >> URL using these credentials through a browser, so I know the credentials are >> good. Unfortunately the support guys at the vendor don't see any problem >> with my code and have not been able to help. >> > >> > $url = "https://servername.com/script";; $ctx = >> > stream_context_create(array('https' => array( >> > 'timeout' => 10, >> > 'header' => sprintf("Authorization: Basic %s\r\n", >> > base64_encode("myUsername:myPassword")) >> > ))); >> > $result = file_get_contents($url, 0, $ctx); $http_response = explode(' >> > ', $http_response_header[0]); $response_code = $http_response[1]; >> > <<<=== This is evaluating to '401' >> > >> > >> > Thanks. >> >> Are they using Basic authentication? >> >> Does ... >> >> https://myUsername:mypassw...@http://servername.com/script > > Shouldn't that be https://myUsername:mypassw...@servername.com/script ? > >> >> work? >> >> Is this a SOAP based web service? >> >> Are they expecting the SOAPHeader to contain the authentication? >> >> >> >> >> -- >> Richard Quadling >> Twitter : EE : Zend >> @RQuadling : e-e.com/M_248814.html : bit.ly/9O8vFY >> > > Regards, > Tommy > > Yeah. CNP error. Thanks. -- Richard Quadling Twitter : EE : Zend @RQuadling : e-e.com/M_248814.html : bit.ly/9O8vFY -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] RegExp question: how to add a number?
On 15 October 2010 10:16, Ford, Mike wrote: >> -Original Message- >> From: Andre Polykanine [mailto:an...@oire.org] >> Sent: 14 October 2010 21:42 >> >> Hi everyone, >> I hope you're doing well (haven't written here for a long time :-)). >> The question is as follows: I have a regexp that would do the >> following. If the string begins with "Re:", it will change the >> beginning to "Re[2]:"; if it doesn't, then it would add "Re:" at the >> beginning. But (attention, here it is!) if the string starts with >> something like "Re[4]:", it should replace it by "Re[5]:". >> Here's the code: >> >> $start=mb_strtolower(mb_substr($f['Subject'], 0, 3)); >> if ($start=="re:") { >> $subject=preg_replace("/^re:(.+?)$/usi", "re[2]:$1", $f['Subject']); >> } elseif ($start=="re[") { >> // Here $1+1 doesn't work, it returns "Re[4+1]:"! >> $subject=preg_replace("/^re\[(\d+)\]:(.+?)$/usi", "re[$1+1]:$2", >> $f['Subject']); >> } else { >> $subject="Re: ".$f['Subject']; >> } >> >> I know there actually exists a way to do the numeral addition >> ("Re[5]:", not "Re[4+1]:"). >> How do I manage to do this? > > This looks like a job for the "e" modifier (see > http://php.net/manual/en/reference.pcre.pattern.modifiers.php, and example #4 > at http://php.net/preg_replace). Something like: > > $subject = preg_replace("/^re\[(\d+)\:](.+?)$/eusi", > "'re['.(\\1+1).']:\\2'", $f['Subject']); > > Cheers! > > Mike Watch out for the missing '[1]'. This needs to become '[2]' and not '[1]'. The callback seems to be the only way I could get the regex to work. -- Richard Quadling Twitter : EE : Zend @RQuadling : e-e.com/M_248814.html : bit.ly/9O8vFY -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Help with sending credentials?
> -Original Message- > From: Richard Quadling [mailto:rquadl...@gmail.com] > Sent: Friday, October 15, 2010 1:47 AM > To: Brian Dunning > Cc: PHP-General List > Subject: Re: [PHP] Help with sending credentials? > > On 14 October 2010 21:45, Brian Dunning wrote: > > Gents - > > > > I'm trying to work with a major vendor's web service, but all my efforts are > met with a 401 authentication error response. I can log in manually to this > URL using these credentials through a browser, so I know the credentials are > good. Unfortunately the support guys at the vendor don't see any problem > with my code and have not been able to help. > > > > $url = "https://servername.com/script";; $ctx = > > stream_context_create(array('https' => array( > >'timeout' => 10, > >'header' => sprintf("Authorization: Basic %s\r\n", > > base64_encode("myUsername:myPassword")) > >))); > > $result = file_get_contents($url, 0, $ctx); $http_response = explode(' > > ', $http_response_header[0]); $response_code = $http_response[1]; > > <<<=== This is evaluating to '401' > > > > > > Thanks. > > Are they using Basic authentication? > > Does ... > > https://myUsername:mypassw...@http://servername.com/script Shouldn't that be https://myUsername:mypassw...@servername.com/script ? > > work? > > Is this a SOAP based web service? > > Are they expecting the SOAPHeader to contain the authentication? > > > > > -- > Richard Quadling > Twitter : EE : Zend > @RQuadling : e-e.com/M_248814.html : bit.ly/9O8vFY > Regards, Tommy -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] searching for application like Google Doc
> -Original Message- > From: Sharl.Jimh.Tsin [mailto:amoiz.sh...@gmail.com] > Sent: Thursday, October 14, 2010 9:16 PM > To: Bob McConnell > Cc: ??; php-general@lists.php.net > Subject: Re: [PHP] searching for application like Google Doc > > Are you looking for a open-source project likes it? > > searching it via Google with "php"、"office doc"、"open source" key words > may help you. > > Best regards, > Sharl.Jimh.Tsin (From China) > > > > 2010/10/14 Bob McConnell : > > From: ?? > > > >> Is there any application like Google Doc(here I mean the spreadsheet). > > > > What is your conception of "like"? > > > > Have you looked at OpenOffice? > > > > Bob McConnell > > > > -- I think he/she is asking if there is anything out there on net that is a spreadsheet and based purely html & javascript on the front end UI and the back end is either xml or db - similar to what google doc is. Regards, Tommy -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] RegExp question: how to add a number?
> -Original Message- > From: Andre Polykanine [mailto:an...@oire.org] > Sent: 14 October 2010 21:42 > > Hi everyone, > I hope you're doing well (haven't written here for a long time :-)). > The question is as follows: I have a regexp that would do the > following. If the string begins with "Re:", it will change the > beginning to "Re[2]:"; if it doesn't, then it would add "Re:" at the > beginning. But (attention, here it is!) if the string starts with > something like "Re[4]:", it should replace it by "Re[5]:". > Here's the code: > > $start=mb_strtolower(mb_substr($f['Subject'], 0, 3)); > if ($start=="re:") { > $subject=preg_replace("/^re:(.+?)$/usi", "re[2]:$1", $f['Subject']); > } elseif ($start=="re[") { > // Here $1+1 doesn't work, it returns "Re[4+1]:"! > $subject=preg_replace("/^re\[(\d+)\]:(.+?)$/usi", "re[$1+1]:$2", > $f['Subject']); > } else { > $subject="Re: ".$f['Subject']; > } > > I know there actually exists a way to do the numeral addition > ("Re[5]:", not "Re[4+1]:"). > How do I manage to do this? This looks like a job for the "e" modifier (see http://php.net/manual/en/reference.pcre.pattern.modifiers.php, and example #4 at http://php.net/preg_replace). Something like: $subject = preg_replace("/^re\[(\d+)\:](.+?)$/eusi", "'re['.(\\1+1).']:\\2'", $f['Subject']); Cheers! Mike -- Mike Ford, Electronic Information Developer, Libraries and Learning Innovation, Leeds Metropolitan University, C507 City Campus, Woodhouse Lane, LEEDS, LS1 3HE, United Kingdom Email: m.f...@leedsmet.ac.uk Tel: +44 113 812 4730 To view the terms under which this email is distributed, please go to http://disclaimer.leedsmet.ac.uk/email.htm -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Help with sending credentials?
On 14 October 2010 21:45, Brian Dunning wrote: > Gents - > > I'm trying to work with a major vendor's web service, but all my efforts are > met with a 401 authentication error response. I can log in manually to this > URL using these credentials through a browser, so I know the credentials are > good. Unfortunately the support guys at the vendor don't see any problem with > my code and have not been able to help. > > $url = "https://servername.com/script";; > $ctx = stream_context_create(array('https' => array( > 'timeout' => 10, > 'header' => sprintf("Authorization: Basic %s\r\n", > base64_encode("myUsername:myPassword")) > ))); > $result = file_get_contents($url, 0, $ctx); > $http_response = explode(' ', $http_response_header[0]); > $response_code = $http_response[1]; <<<=== This is evaluating to '401' > > > Thanks. Are they using Basic authentication? Does ... https://myUsername:mypassw...@http://servername.com/script work? Is this a SOAP based web service? Are they expecting the SOAPHeader to contain the authentication? -- Richard Quadling Twitter : EE : Zend @RQuadling : e-e.com/M_248814.html : bit.ly/9O8vFY -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php