Answers.Body: <p>The first thing I would check is the TimeZone setting in WP.  Go to Settings--> General.  That cannot be the default (UTC +0) as the default does not exist in php (UTC does, but not UTC +0).  That should solve the TZ mismatch.  Best to use one of these - <a href="http://php.net/manual/en/timezones.america.php" rel="nofollow noreferrer">http://php.net/manual/en/timezones.america.php</a>  for NY I'd use <code>America/New_York</code></p>
  
  <p>As far as cron, I recommend that you set it using the wp-cli method as detailed here:  <a href="https://wiki.civicrm.org/confluence/display/CRMDOC/Managing+Scheduled+Jobs" rel="nofollow noreferrer">https://wiki.civicrm.org/confluence/display/CRMDOC/Managing+Scheduled+Jobs</a></p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-04-12T00:13:43.510Z
Answers.Text: Timestamp suggestion worked.  Thank you!  Still working on wp-cli.  Tried to include additional questions in my original question but not sure if you could see it, so left my questions as a separate answer, too. Any help will be greatly appreciated.
Answers.UserDisplayName: user1147171
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-04-12T02:12:49.347Z
Answers.Text: Have put my wp-cli questions in a new post:  http://civicrm.stackexchange.com/questions/18119/cron-not-running-but-it-is-trying-to-use-wp-cli-in-crontab-with-wordpress
Answers.UserDisplayName: user1147171
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-04-11T19:48:03.750Z
Answers.LastActivityDate: 2017-04-11T19:48:03.750Z
Answers.UserDisplayName: Kevin Cristiano
Body: <p>Running CiviCRM 4.7 on WordPress 4.7.3, hosted on a shared Linux server at 1and1.com. The WordPress site is using PHP 7.0 but apparently the latest version I can use from the command line is 5.5.</p>
  
  <p>Two problems (perhaps related?)</p>
  
  <p>The system status screen says "Cron not running". Cron is running.  I currently have crontab sending me an email every 15 minutes using the cronTest.php file which contains this:</p>
  
  <pre><code>&lt;?php mail('cronuser@gmail.com','Cron Job Test Script',phpversion()); ?&gt;
  </code></pre>
  
  <p>That is working, sending me the email and reporting PHP version 5.5.38.</p>
  
  <p>I'm also trying to use cli.php to execute the CiviCRM Job, but that doesn't seem to be working.</p>
  
  <p>Here's my whole crontab (with sensitive info changed):</p>
  
  <pre><code>*/15 * * * * /usr/bin/php5.5 /mysharedserver/homepages/34/d11111111/htdocs/cronTest.php
  */15 * * * * /usr/bin/php5.5 /mysharedserver/homepages/34/d11111111/htdocs/mysubdir/wp-content/plugins/civicrm/civicrm/bin/cli.php -s mydomain.org -u cronuser -p cronuserpassword -e Job -a execute
  </code></pre>
  
  <p>I have also tried wget in crontab without success:</p>
  
  <pre><code>0 * * * * wget -O - -q -t 1 'http://mydomain.org/wp-content/plugins/civicrm/civicrm/bin/cron.php'?name=cronuser&amp;pass=cronuserpassword@&amp;key=mysitekey
  </code></pre>
  
  <p>I also tried wget with the single quote after the site key.</p>
  
  <p>The timestamp error in CiviCRM system status says:</p>
  
  <pre><code>Timestamps reported by MySQL (eg "2017-04-11 14:58") and PHP (eg "2017-04-11 18:58" ) are mismatched
  </code></pre>
  
  <p>I have checked the PHP time using <code>date_default_timezone_get()</code> in the folder where WordPress is installed, and using SQL <code>CURTIME()</code> and <code>CURDATE()</code>, the times and dates match -- both show the time and date in New York. I have also created a php.ini in the directory where WordPress is running, with a directive setting the time to America/New York:</p>
  
  <pre><code>date.timezone = "America/New_York"
  </code></pre>
  
  <p>So CiviCRM must be getting its PHP time somewhere other than in the directory where WordPress is installed? I thought maybe that would be the directory where PHP 5.5 is running, so I tried running the PHP function date_default_timezone_get() in /usr/bin/php5.5 and got:</p>
  
  <pre><code>X-Powered-By: PHP/5.5.38 Content-type: text/html date_default_timezone_set: America/New_York
  </code></pre>
  
  <p>Using this SQL command:</p>
  
  <pre><code>SELECT @@global.time_zone, @@session.time_zone
  </code></pre>
  
  <p>I get SYSTEM for both values. I haven't pursued the SQL question any further than that, since the SQL time seems correct (New York time). </p>
  
  <p>I'm looks to me like the PHP time is the problem, but I'm not sure where to go from here.</p>
  
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2017-04-11T20:25:08.107Z
Comments.Text: Welcome!  Although these both relate to your new installation this would be better asked as two separate questions, maybe with a link in each to the other.
Comments.UserDisplayName: Aidan
Tags: <wordpress><php><cron><sql><timestamp>
Title: New install, system status says "cron not running" and "timestamp mismatch"
ThreadText: # New install, system status says "cron not running" and "timestamp mismatch"
  
  (Asked by: username_0 on 2017-04-11)
  
  Running CiviCRM 4.7 on WordPress 4.7.3, hosted on a shared Linux server at 1and1.com. The WordPress site is using PHP 7.0 but apparently the latest version I can use from the command line is 5.5.
  Two problems (perhaps related?)
  The system status screen says "Cron not running". Cron is running.  I currently have crontab sending me an email every 15 minutes using the cronTest.php file which contains this:
  
  
  That is working, sending me the email and reporting PHP version 5.5.38.
  I'm also trying to use cli.php to execute the CiviCRM Job, but that doesn't seem to be working.
  Here's my whole crontab (with sensitive info changed):
  */15 * * * * /usr/bin/php5.5 /mysharedserver/homepages/34/d11111111/htdocs/cronTest.php
  */15 * * * * /usr/bin/php5.5 /mysharedserver/homepages/34/d11111111/htdocs/mysubdir/wp-content/plugins/civicrm/civicrm/bin/cli.php -s mydomain.org -u cronuser -p cronuserpassword -e Job -a execute
  
  I have also tried wget in crontab without success:
  0 * * * * wget -O - -q -t 1 'http://mydomain.org/wp-content/plugins/civicrm/civicrm/bin/cron.php'?name=cronuser&pass=cronuserpassword@&key=mysitekey
  
  I also tried wget with the single quote after the site key.
  The timestamp error in CiviCRM system status says:
  Timestamps reported by MySQL (eg "2017-04-11 14:58") and PHP (eg "2017-04-11 18:58" ) are mismatched
  
  I have checked the PHP time using date_default_timezone_get() in the folder where WordPress is installed, and using SQL CURTIME() and CURDATE(), the times and dates match -- both show the time and date in New York. I have also created a php.ini in the directory where WordPress is running, with a directive setting the time to America/New York:
  date.timezone = "America/New_York"
  
  So CiviCRM must be getting its PHP time somewhere other than in the directory where WordPress is installed? I thought maybe that would be the directory where PHP 5.5 is running, so I tried running the PHP function date_default_timezone_get() in /usr/bin/php5.5 and got:
  X-Powered-By: PHP/5.5.38 Content-type: text/html date_default_timezone_set: America/New_York
  
  Using this SQL command:
  SELECT @@global.time_zone, @@session.time_zone
  
  I get SYSTEM for both values. I haven't pursued the SQL question any further than that, since the SQL time seems correct (New York time). 
  I'm looks to me like the PHP time is the problem, but I'm not sure where to go from here.
  
  **Tags:** wordpress, php, cron, sql, timestamp
  
  > **Comments:**
  > **username_1**: Welcome!  Although these both relate to your new installation this would be better asked as two separate questions, maybe with a link in each to the other.  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_2 on 2017-04-11. Score: 1
  
  The first thing I would check is the TimeZone setting in WP. Go to Settings--> General. That cannot be the default (UTC +0) as the default does not exist in php (UTC does, but not UTC +0). That should solve the TZ mismatch. Best to use one of these - <http://php.net/manual/en/timezones.america.php> for NY I'd use `America/New_York`
  
  As far as cron, I recommend that you set it using the wp-cli method as detailed here: <https://wiki.civicrm.org/confluence/display/CRMDOC/Managing+Scheduled+Jobs>
  
  > **Comments:**
  > **username_3**: Timestamp suggestion worked.  Thank you!  Still working on wp-cli.  Tried to include additional questions in my original question but not sure if you could see it, so left my questions as a separate answer, too. Any help will be greatly appreciated.  
  > **username_3**: Have put my wp-cli questions in a new post:  http://civicrm.stackexchange.com/questions/18119/cron-not-running-but-it-is-trying-to-use-wp-cli-in-crontab-with-wordpress  
  
  ---
  
  