php-general Digest 23 Oct 2012 20:48:42 -0000 Issue 8019

2012-10-23 Thread php-general-digest-help

php-general Digest 23 Oct 2012 20:48:42 - Issue 8019

Topics (messages 319555 through 319568):

Re: Recommendation request: Use Magento or build my own eCommerce?
319555 by: Marc Guay
319556 by: Mark
319557 by: Marc Guay
319558 by: Mark

Re: Missing email
319559 by: Gerardo Benitez
319561 by: Karl DeSaulniers

Re: Wrong time being displayed by PHP!
319560 by: Richard S. Crawford

PDO
319562 by: Silvio Siefke
319563 by: Nathan Nobbe
319564 by: Ashley Sheridan
319565 by: Adam Richardson
319566 by: Silvio Siefke
319567 by: Lester Caine

cron job problem
319568 by: Jim Giner

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


--
---BeginMessage---
Use Magento.  It will take you more than 6 months to build what you're
talking about all by yourself.  Magento is a pain to learn at first
but once you get into it things start to make sense and development
speeds up.

Marc
---End Message---
---BeginMessage---
On Mon, Oct 22, 2012 at 4:06 PM, Mark mark...@gmail.com wrote:

 Hi,

 I'm in a difficult situation here. I have a list of requirements for an 
 eCommerce system (Magento) where i'm getting mixed opinions about what to do. 
 Note: i do consider myself to be a quite experienced PHP programmer and 
 certainly have the skills to either make the extensions or make everything 
 from scratch. Both do require month of work! First - for the complete picture 
 - the list of requirements for the eCommerce system:
 - (buld into magento) Multishop has to be possible
 - Different payment modules have to be possible (buckaroo, afterpay, ...)
 - Online chat (with for example zopim) has to be possible
 - Advanced product permissions (magento only has manage not more specific 
 as in edit)
 - Setting pruduct margins
 - Abandoned cart alerts
 - One page checkout
 - Some javascript/ajax things like instant cart
 - A very specific order page (the Booking and Reservations plugin can do 
 that)

 Thus far it's all oke. However, if i go to the magento irc channel i'm 
 getting really mixed opinions about what to use and what to create myself. 
 They basically say that i should prevent installing as much extensions as 
 possible and try to make most of the things myself. This is where i'm getting 
 really confused.

 There are two possible routes to take here.
 1. I can go for the magento route and just take the very steep learning curve 
 it has. It will be a slow process to make the modules required (mainly the 
 advanced permissions, setting product margins and a abandoned cart 
 extension). Two of those three are very difficult to make. Certainly if you 
 consider that i'm just starting developing in any eCommerce system.

 2. Considering the steep learning curve of making extensions for Magento it 
 might be easier - in the long run - to build it all myself. In the beginning 
 that will be an even slower process then using Magento, but once the 
 structure is build it will be a much faster development process for any 
 extension.

 I know it's usually a bad thing to reinvent the wheel and i am certainly not 
 intending that. However, right now i really get the impression that i'm 
 better of making it all myself. Both approaches take many months of 
 development where the self made version is going to pay off in development 
 time in the long run when compared to magento. I am just not sure what the 
 best solution might be.

 So here is a list of pros and cons that i can think of for both approaches.

 Pros/Cons for using magento
 - [pro] a lot of existing extensions
 - [pro] i don't need to worry about security updates since the come from 
 magento
 - [pro] living community around it to help out if there are any issues
 - [con] very steep learning curve
 - [con] not straightforward to start developing in
 - [con] takes a lot of time till you can even use the basics

 Pros/Cons for self made
 - [pro] Development will go a lot faster
 - [pro] i can make it more specific for one goal
 - [pro] a much easier extension model
 - [con] security all depends on me
 - [con] i have to make complicated extensions like buckaroo and afterpay 
 myself
 - [con] no existing library of extensions to use

 Again, i'm puzzled by this. If i follow the #magento (on freenode) list then 
 i should pick magento, but make every extension myself or only use the really 
 good ones. Thus that will require a lot of time to develop them. I 'm 
 guessing about half a year. Then again, if i make it all from the ground up 
 it's probably also going to take half a year to develop (or slightly more) 
 but it will obviously be much easier to maintain since i know every 

[PHP] cron job problem

2012-10-23 Thread Jim Giner
I have a php script that has been triggered by my hoster's cron 
process(?) to run once a day since last March.  It's been running fine - 
and I've made no changes to it.  Suddenly in the last couple of days it 
is running twice it seems.  The whole process sends an email at its 
conclusion and the receipient tells me today that she's getting two 
emails only a minute apart.


Any ideas on why this might happen?  I haven't contact my host company 
yet - thought I'd ask around first.


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



Re: [PHP] cron job problem

2012-10-23 Thread Daniel Brown
On Tue, Oct 23, 2012 at 4:48 PM, Jim Giner jim.gi...@albanyhandball.com wrote:
 I have a php script that has been triggered by my hoster's cron process(?)
 to run once a day since last March.  It's been running fine - and I've made
 no changes to it.  Suddenly in the last couple of days it is running twice
 it seems.  The whole process sends an email at its conclusion and the
 receipient tells me today that she's getting two emails only a minute apart.

 Any ideas on why this might happen?  I haven't contact my host company yet -
 thought I'd ask around first.

Though not really a PHP question, there are several reasons this
could happen, including a race condition that is being encountered due
to a slowdown of the host system or changes to the system's
environment.  Are the emails she's receiving identical?

-- 
/Daniel P. Brown
Network Infrastructure Manager
http://www.php.net/

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



Re: [PHP] cron job problem

2012-10-23 Thread Jim Giner

On 10/23/2012 4:56 PM, Daniel Brown wrote:

On Tue, Oct 23, 2012 at 4:48 PM, Jim Giner jim.gi...@albanyhandball.com wrote:

I have a php script that has been triggered by my hoster's cron process(?)
to run once a day since last March.  It's been running fine - and I've made
no changes to it.  Suddenly in the last couple of days it is running twice
it seems.  The whole process sends an email at its conclusion and the
receipient tells me today that she's getting two emails only a minute apart.

Any ideas on why this might happen?  I haven't contact my host company yet -
thought I'd ask around first.


 Though not really a PHP question, there are several reasons this
could happen, including a race condition that is being encountered due
to a slowdown of the host system or changes to the system's
environment.  Are the emails she's receiving identical?


Yes - same msg same time

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



[PHP] Help using PHP 5.3.3 mail() with Apache James

2012-10-23 Thread Steven Pogue
Has anyone been successful at using the above on a RHEL 6.2 environment? I 
am able to use Postfix using the php.ini SENDMAIL_PATH but when I bring 
down PostFix, start Apache James and switch the sendmail_path value to 
point to the Apache James 2.3.2 provided wrapper 
(/opt/james-2.3.2/bin/sendmail.py) the return code on mail() indicates it 
failed and no record of the wrapper being invoked.

Calling the wrapper directly from the command-line works as expected so 
the problem is somewhere between PHP and the sendmail_path invocation.


Thanks,
Steve

Re: [PHP] cron job problem

2012-10-23 Thread Daniel Brown
On Tue, Oct 23, 2012 at 4:59 PM, Jim Giner jim.gi...@albanyhandball.com wrote:

 Yes - same msg same time

If it wouldn't be a problem, can you provide the script here (or
on a site like Pastebin), as well as the crontab time entry for this?
While checking the crontab, make sure a duplicate entry for this
wasn't somehow added.

In the event that you'd like to keep this information from the
archives and general mailing list (and depending on the security
implications based upon what's divulged, I'd recommend it), I invite
you to send it to me privately, off-list, and I'll take a look at it
later tonight or tomorrow morning.

-- 
/Daniel P. Brown
Network Infrastructure Manager
http://www.php.net/

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



Re: [PHP] cron job problem

2012-10-23 Thread Ashley Sheridan
On Tue, 2012-10-23 at 16:59 -0400, Jim Giner wrote:

 On 10/23/2012 4:56 PM, Daniel Brown wrote:
  On Tue, Oct 23, 2012 at 4:48 PM, Jim Giner jim.gi...@albanyhandball.com 
  wrote:
  I have a php script that has been triggered by my hoster's cron process(?)
  to run once a day since last March.  It's been running fine - and I've made
  no changes to it.  Suddenly in the last couple of days it is running twice
  it seems.  The whole process sends an email at its conclusion and the
  receipient tells me today that she's getting two emails only a minute 
  apart.
 
  Any ideas on why this might happen?  I haven't contact my host company yet 
  -
  thought I'd ask around first.
 
   Though not really a PHP question, there are several reasons this
  could happen, including a race condition that is being encountered due
  to a slowdown of the host system or changes to the system's
  environment.  Are the emails she's receiving identical?
 
 Yes - same msg same time
 


Are they definitely only in the cron list once? Could someone have tried
to help by adding the job into the daily.cron, but forgotten to remove
it from the regular crontab?
-- 
Thanks,
Ash
http://www.ashleysheridan.co.uk




Re: [PHP] cron job problem

2012-10-23 Thread Ashley Sheridan
On Tue, 2012-10-23 at 17:12 -0400, Jim Giner wrote:

 
 
 On 10/23/2012 5:19 PM, Ashley Sheridan wrote:
 
  
  On Tue, 2012-10-23 at 16:59 -0400, Jim Giner wrote: 
  
   On 10/23/2012 4:56 PM, Daniel Brown wrote:
On Tue, Oct 23, 2012 at 4:48 PM, Jim Giner 
jim.gi...@albanyhandball.com wrote:
I have a php script that has been triggered by my hoster's cron 
process(?)
to run once a day since last March.  It's been running fine - and I've 
made
no changes to it.  Suddenly in the last couple of days it is running 
twice
it seems.  The whole process sends an email at its conclusion and the
receipient tells me today that she's getting two emails only a minute 
apart.
   
Any ideas on why this might happen?  I haven't contact my host company 
yet -
thought I'd ask around first.
   
 Though not really a PHP question, there are several reasons this
could happen, including a race condition that is being encountered due
to a slowdown of the host system or changes to the system's
environment.  Are the emails she's receiving identical?
   
   Yes - same msg same time
   
  
  
  Are they definitely only in the cron list once? Could someone have
  tried to help by adding the job into the daily.cron, but forgotten
  to remove it from the regular crontab?
  -- 
  Thanks,
  Ash
  http://www.ashleysheridan.co.uk
  
  
  
 
 daily.cron?  regular crontab?  Don't know of what you speak.
 
 This is my only cron-initiated task.  My provider gives me a screen to
 enter the command and the desired time to run it and it's been that
 way for months.  I have had no need to change it so I'm surprised this
 is happening.
   


Crontab is the daemon which runs cron jobs, and some distros have set up
special files called cron.daily (or daily.cron I don't recall),
cron.hourly, etc to make it easier to schedule jobs.

As you're entering this through a control panel (presumably a web-based
one?) I would guess that's not the problem. It could be that the
hostings control panel software has had a hiccup?

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




Re: [PHP] Help using PHP 5.3.3 mail() with Apache James

2012-10-23 Thread Daniel Brown
On Tue, Oct 23, 2012 at 5:00 PM, Steven Pogue spo...@us.ibm.com wrote:
 Has anyone been successful at using the above on a RHEL 6.2 environment? I
 am able to use Postfix using the php.ini SENDMAIL_PATH but when I bring
 down PostFix, start Apache James and switch the sendmail_path value to
 point to the Apache James 2.3.2 provided wrapper
 (/opt/james-2.3.2/bin/sendmail.py) the return code on mail() indicates it
 failed and no record of the wrapper being invoked.

 Calling the wrapper directly from the command-line works as expected so
 the problem is somewhere between PHP and the sendmail_path invocation.

What is the output of the following code?

?php
echo 'pre'.PHP_EOL;
echo trim(`ls -al /opt/james-2.3.2/bin/sendmail.py`).PHP_EOL;
echo '/pre'.PHP_EOL;
?

-- 
/Daniel P. Brown
Network Infrastructure Manager
http://www.php.net/

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



Re: [PHP] cron job problem

2012-10-23 Thread Daniel Brown
On Tue, Oct 23, 2012 at 5:34 PM, Ashley Sheridan
a...@ashleysheridan.co.uk wrote:


 Crontab is the daemon which runs cron jobs, and some distros have set up
 special files called cron.daily (or daily.cron I don't recall),
 cron.hourly, etc to make it easier to schedule jobs.

Quick clarification and correction here:

The cron *daemon* is crond, while the *script* that is
batch-processed by cron is called the crontab.  When it is executed,
it is referred to as a cron job.

That said, Ash is right about the rest.  Different OS flavors
(BSD, Linux, UNIX, SunOS/Solaris, HP-UX, et cetera) often use
different path and file standards.  Linux, in general, uses a command
`crontab` which opens the local user's environment-configured editor
to modify the user's crontab in the spool.

-- 
/Daniel P. Brown
Network Infrastructure Manager
http://www.php.net/

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



Re: [PHP] Help using PHP 5.3.3 mail() with Apache James

2012-10-23 Thread Steven Pogue
Dan,
I assume you meant to add a system() call into it...if so, here is what 
was presented.

-rwxrwxrwx. 1 root root 3878 Sep  6 14:45 /opt/james-2.3.2/bin/sendmail.py
-rwxrwxrwx. 1 root root 3878 Sep  6 14:45 /opt/james-2.3.2/bin/sendmail.py


Steve



From:
Daniel Brown danbr...@php.net
To:
Steven Pogue/Raleigh/IBM@IBMUS
Cc:
php-general@lists.php.net
Date:
10/23/2012 05:24 PM
Subject:
Re: [PHP] Help using PHP 5.3.3 mail() with Apache James
Sent by:
paras...@gmail.com



On Tue, Oct 23, 2012 at 5:00 PM, Steven Pogue spo...@us.ibm.com wrote:
 Has anyone been successful at using the above on a RHEL 6.2 environment? 
I
 am able to use Postfix using the php.ini SENDMAIL_PATH but when I bring
 down PostFix, start Apache James and switch the sendmail_path value to
 point to the Apache James 2.3.2 provided wrapper
 (/opt/james-2.3.2/bin/sendmail.py) the return code on mail() indicates 
it
 failed and no record of the wrapper being invoked.

 Calling the wrapper directly from the command-line works as expected so
 the problem is somewhere between PHP and the sendmail_path invocation.

What is the output of the following code?

?php
echo 'pre'.PHP_EOL;
echo trim(`ls -al /opt/james-2.3.2/bin/sendmail.py`).PHP_EOL;
echo '/pre'.PHP_EOL;
?

-- 
/Daniel P. Brown
Network Infrastructure Manager
http://www.php.net/




Re: [PHP] cron job problem

2012-10-23 Thread David OBrien
On Tue, Oct 23, 2012 at 5:31 PM, Daniel Brown danbr...@php.net wrote:

 On Tue, Oct 23, 2012 at 5:34 PM, Ashley Sheridan
 a...@ashleysheridan.co.uk wrote:
 
 
  Crontab is the daemon which runs cron jobs, and some distros have set up
  special files called cron.daily (or daily.cron I don't recall),
  cron.hourly, etc to make it easier to schedule jobs.

 Quick clarification and correction here:

 The cron *daemon* is crond, while the *script* that is
 batch-processed by cron is called the crontab.  When it is executed,
 it is referred to as a cron job.

 That said, Ash is right about the rest.  Different OS flavors
 (BSD, Linux, UNIX, SunOS/Solaris, HP-UX, et cetera) often use
 different path and file standards.  Linux, in general, uses a command
 `crontab` which opens the local user's environment-configured editor
 to modify the user's crontab in the spool.

 --
 /Daniel P. Brown
 Network Infrastructure Manager
 http://www.php.net/

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


script runs
ntp updates server time
script runs again?


Re: [PHP] cron job problem

2012-10-23 Thread Jim Giner

On 10/23/2012 6:18 PM, David OBrien wrote:

On Tue, Oct 23, 2012 at 5:31 PM, Daniel Brown danbr...@php.net wrote:


On Tue, Oct 23, 2012 at 5:34 PM, Ashley Sheridan
a...@ashleysheridan.co.uk wrote:



Crontab is the daemon which runs cron jobs, and some distros have set up
special files called cron.daily (or daily.cron I don't recall),
cron.hourly, etc to make it easier to schedule jobs.


 Quick clarification and correction here:

 The cron *daemon* is crond, while the *script* that is
batch-processed by cron is called the crontab.  When it is executed,
it is referred to as a cron job.

 That said, Ash is right about the rest.  Different OS flavors
(BSD, Linux, UNIX, SunOS/Solaris, HP-UX, et cetera) often use
different path and file standards.  Linux, in general, uses a command
`crontab` which opens the local user's environment-configured editor
to modify the user's crontab in the spool.

--
/Daniel P. Brown
Network Infrastructure Manager
http://www.php.net/

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



script runs
ntp updates server time
script runs again?


But why now?  This process has been running just fine for months.

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



Re: [PHP] cron job problem

2012-10-23 Thread Ashley Sheridan
On Tue, 2012-10-23 at 18:36 -0400, Jim Giner wrote:

 On 10/23/2012 6:18 PM, David OBrien wrote:
  On Tue, Oct 23, 2012 at 5:31 PM, Daniel Brown danbr...@php.net wrote:
 
  On Tue, Oct 23, 2012 at 5:34 PM, Ashley Sheridan
  a...@ashleysheridan.co.uk wrote:
 
 
  Crontab is the daemon which runs cron jobs, and some distros have set up
  special files called cron.daily (or daily.cron I don't recall),
  cron.hourly, etc to make it easier to schedule jobs.
 
   Quick clarification and correction here:
 
   The cron *daemon* is crond, while the *script* that is
  batch-processed by cron is called the crontab.  When it is executed,
  it is referred to as a cron job.
 
   That said, Ash is right about the rest.  Different OS flavors
  (BSD, Linux, UNIX, SunOS/Solaris, HP-UX, et cetera) often use
  different path and file standards.  Linux, in general, uses a command
  `crontab` which opens the local user's environment-configured editor
  to modify the user's crontab in the spool.
 
  --
  /Daniel P. Brown
  Network Infrastructure Manager
  http://www.php.net/
 
  --
  PHP General Mailing List (http://www.php.net/)
  To unsubscribe, visit: http://www.php.net/unsub.php
 
 
  script runs
  ntp updates server time
  script runs again?
 
 But why now?  This process has been running just fine for months.
 


Have you tried removing the job entirely from cron and re-adding it? It
might be enough to kick-start the process into behaving.
-- 
Thanks,
Ash
http://www.ashleysheridan.co.uk




Re: [PHP] cron job problem

2012-10-23 Thread Jim Giner

On 10/23/2012 6:57 PM, Ashley Sheridan wrote:

On Tue, 2012-10-23 at 18:36 -0400, Jim Giner wrote:


On 10/23/2012 6:18 PM, David OBrien wrote:

On Tue, Oct 23, 2012 at 5:31 PM, Daniel Brown danbr...@php.net wrote:


On Tue, Oct 23, 2012 at 5:34 PM, Ashley Sheridan
a...@ashleysheridan.co.uk wrote:



Crontab is the daemon which runs cron jobs, and some distros have set up
special files called cron.daily (or daily.cron I don't recall),
cron.hourly, etc to make it easier to schedule jobs.


  Quick clarification and correction here:

  The cron *daemon* is crond, while the *script* that is
batch-processed by cron is called the crontab.  When it is executed,
it is referred to as a cron job.

  That said, Ash is right about the rest.  Different OS flavors
(BSD, Linux, UNIX, SunOS/Solaris, HP-UX, et cetera) often use
different path and file standards.  Linux, in general, uses a command
`crontab` which opens the local user's environment-configured editor
to modify the user's crontab in the spool.

--
/Daniel P. Brown
Network Infrastructure Manager
http://www.php.net/

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



script runs
ntp updates server time
script runs again?


But why now?  This process has been running just fine for months.




Have you tried removing the job entirely from cron and re-adding it? It
might be enough to kick-start the process into behaving.


Yes my host asked me to do that earlier.  And nope - no better.

I have told them it's gotta be something on their end because I tested 
the script from a browser displaying what it was doing and it ran fine. 
 Removed my debug settings and ran it from a browser and again it ran 
fine.  Re-scheduled the cron task and it ran wrong.


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



Re: [PHP] cron job problem

2012-10-23 Thread Ashley Sheridan
On Tue, 2012-10-23 at 18:51 -0400, Jim Giner wrote:

 On 10/23/2012 6:57 PM, Ashley Sheridan wrote:
  On Tue, 2012-10-23 at 18:36 -0400, Jim Giner wrote:
 
  On 10/23/2012 6:18 PM, David OBrien wrote:
  On Tue, Oct 23, 2012 at 5:31 PM, Daniel Brown danbr...@php.net wrote:
 
  On Tue, Oct 23, 2012 at 5:34 PM, Ashley Sheridan
  a...@ashleysheridan.co.uk wrote:
 
 
  Crontab is the daemon which runs cron jobs, and some distros have set up
  special files called cron.daily (or daily.cron I don't recall),
  cron.hourly, etc to make it easier to schedule jobs.
 
Quick clarification and correction here:
 
The cron *daemon* is crond, while the *script* that is
  batch-processed by cron is called the crontab.  When it is executed,
  it is referred to as a cron job.
 
That said, Ash is right about the rest.  Different OS flavors
  (BSD, Linux, UNIX, SunOS/Solaris, HP-UX, et cetera) often use
  different path and file standards.  Linux, in general, uses a command
  `crontab` which opens the local user's environment-configured editor
  to modify the user's crontab in the spool.
 
  --
  /Daniel P. Brown
  Network Infrastructure Manager
  http://www.php.net/
 
  --
  PHP General Mailing List (http://www.php.net/)
  To unsubscribe, visit: http://www.php.net/unsub.php
 
 
  script runs
  ntp updates server time
  script runs again?
 
  But why now?  This process has been running just fine for months.
 
 
 
  Have you tried removing the job entirely from cron and re-adding it? It
  might be enough to kick-start the process into behaving.
 
 Yes my host asked me to do that earlier.  And nope - no better.
 
 I have told them it's gotta be something on their end because I tested 
 the script from a browser displaying what it was doing and it ran fine. 
   Removed my debug settings and ran it from a browser and again it ran 
 fine.  Re-scheduled the cron task and it ran wrong.
 


It does sound like it's definitely a problem their end. Could you alter
the script in some way to check for a token set on the correct schedule?
Or, perhaps rename the script and set up the cron to it again, so that
if there is a secondary link to it in cron it will fail, and might give
you an idea about where it's being called from.

I know this is all a crazy attempt to prove it's a problem with the
hosting, but from experience they can sometimes be slow to recognise it
without a lot of definite proof.

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