Answers.Body: <p>Here's an example wp-cli command I use that works:</p>
  
  <pre><code>/home/ubuntu/wp-cli/wp-cli --require=/home/ubuntu/wp-cli/civicrm.php --path=/var/www/wordpress civicrm api job.execute &gt; /dev/null
  </code></pre>
  
  <p>I hope that helps!</p>
  
  <p>UPDATE: I see your problem!  "/path/to/wp" means, "path to wp-cli, including wp-cli".  I completely looked past that part at the beginning, since that's not generally where the problems are found.</p>
  
  <p>Usually, "wp-cli" is aliased to "wp" so it can automatically include the CiviCRM extension - but with cron, I usually just use the require directly.</p>
  
  <p>So log into your computer and type <code>which wp-cli</code>.  Let's say it returns <code>/usr/bin/local/wp-cli</code>.  Replace ONLY the first path to WP with that, so it looks like:</p>
  
  <p>To forestall your next question about why it doesn't work - the  is a placeholder, and the angle brackets should NOT be included in the actual statement.  Angle brackets are a common way in documentation of command-line programs to say, "insert your value here".  So instead of <code>&lt;philnicoll&gt;</code>, just write <code>philnicoll</code>.</p>
  
  <p>You should be left with something like:</p>
  
  <pre><code>/usr/bin/local/wp-cli --user=philnicholl --url=http://thetestsite.dev:8888 --path=/users/phillip/Sites/thetestsite.dev civicrm api job.execute auth=0
  </code></pre>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-02-14T08:49:37.670Z
Answers.Text: Thank you, though I'm not exactly sure how to change your command to suit my case.
Answers.UserDisplayName: user3869177
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-02-14T16:32:29.853Z
Answers.Text: @philnicholl I just updated my answer, hope it helps.
Answers.UserDisplayName: Jon G - Megaphone Tech
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-02-16T14:38:52.603Z
Answers.Text: Thank you, Jon. I'd previously moved and renamed wp-cli as wp and moved it to /usr/bin - running `which wp` confirms this returning `/usr/bin/wp` . So I tried running `usr/bin/wp --user=philnicholl --url=http://thetestsite.dev:8888 --path=/users/phillip/Sites/thetestsite.dev civicrm api job.execute auth=0` and got `Error establishing a database connection` which seems like an improvement. Where now? Thank you for your help.
Answers.UserDisplayName: user3869177
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-02-16T14:47:59.513Z
Answers.Text: The wiki CIVICRM instructions for the wp-cli method do seem rather confusing in that /path/to/wp appears twice in the code but represents two different things and then in the following comments it says 'Replace </path/to/wp civicrm>' Presumably the last placeholder chevron is in the wrong place and should be after wp and not after civicrm.
Answers.UserDisplayName: user3869177
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-02-16T15:55:28.693Z
Answers.Text: I fixed the database connection problem following instructions here: http://laurenpittenger.com/wpcli-error-establishing-database-connection-mamp/ I had to unlock my bash profile using instructions here: http://stackoverflow.com/questions/15824493/my-bash-profile-is-locked-how-do-i-edit-it  All good now: Cron running OK. Thanks very much.
Answers.UserDisplayName: user3869177
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-02-13T20:17:52.763Z
Answers.LastActivityDate: 2016-02-14T16:32:15.073Z
Answers.LastEditDate: 2016-02-14T16:32:15.073Z
Answers.UserDisplayName: Jon G - Megaphone Tech
Body: <p>I'm testing CiviCRM 4.7 in a WordPress 4.4.2 installation. I'm running this on a local server with Mac OSX 10.11.2 using MAMP Pro.</p>
  
  <p>I'm trying to configure cron using the wp-cli method. I've installed, renamed and moved wp-cli and running <code>wp --info</code> in /Applications/MAMP/bin gives</p>
  
  <p>PHP binary: /usr/bin/php
  PHP version:    5.5.30
  php.ini used:<br>
  WP-CLI root dir:    phar://wp-cli.phar
  WP-CLI global config:<br>
  WP-CLI project config:<br>
  WP-CLI version: 0.22.0
  Phils-MacBook-Air:bin phillip$</p>
  
  <p><code>wp help</code> shows the WordPress commands</p>
  
  <p>I'm now trying to implement</p>
  
  <pre><code>/path/to/wp --user=&lt;cron&gt; --url=&lt;http://example.com&gt; --path=&lt;/path/to/wp&gt; civicrm api job.execute auth=0
  </code></pre>
  
  <p>In my case I'm trying</p>
  
  <pre><code>/users/phillip/Sites/thetestsite.dev --user=&lt;philnicholl&gt; --url=&lt;http://thetestsite.dev:8888&gt; --path=&lt;/users/phillip/Sites/thetestsite.dev&gt; civicrm api job.execute auth=0
  </code></pre>
  
  <p>but I get</p>
  
  <p>-bash: philnicholl: No such file or directory</p>
  
  <p>(philnicholl is my WordPress administrator username)</p>
  
  <p>I know I'm missing something obvious.</p>
  
  <p>I'm have experience with WordPress and Mamp Pro but am new to both CLI and CIVICRM. Any help would be much appreciated.</p>
  
  <p>Thank you.</p>
  
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2016-02-14T07:25:22.187Z
Comments.Text: Just checking - does your command literally include the '<', '>' around the user, url and path values?  If so, remove them - they are meant as placeholders in the example line.  Bash interprets them as stdin, stdout redirection.
Comments.UserDisplayName: Aidan
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2016-02-14T08:09:54.007Z
Comments.Text: Thank you. Running `/users/phillip/Sites/thetestsite.dev --user=philnicholl --url=http://thetestsite.dev:8888 --path=/users/phillip/Sites/thetestsite.dev civicrm api job.execute auth=0` I now get `-bash: /Users/phillip/Sites/thetestsite.dev: is a directory` I'm trying to follow these instructions: [https://wiki.civicrm.org/confluence/display/CRMDOC/Managing+Scheduled+Jobs#ManagingScheduledJobs-wp-climethod] Does the `/path/to/wp` in the instructions refer to the path to the root folder of the local site or to wp-cli.phar renamed as wp now in /usr/bin/ ?
Comments.UserDisplayName: user3869177
Tags: <cron><cli><mamp>
Title: Configuring cron using wp-cli on local server with Mamp Pro
ThreadText: # Configuring cron using wp-cli on local server with Mamp Pro
  
  (Asked by: username_0 on 2016-02-13)
  
  I'm testing CiviCRM 4.7 in a WordPress 4.4.2 installation. I'm running this on a local server with Mac OSX 10.11.2 using MAMP Pro.
  
  I'm trying to configure cron using the wp-cli method. I've installed, renamed and moved wp-cli and running `wp --info` in /Applications/MAMP/bin gives
  
  PHP binary: /usr/bin/php
  PHP version: 5.5.30
  php.ini used:  
  WP-CLI root dir: phar://wp-cli.phar
  WP-CLI global config:  
  WP-CLI project config:  
  WP-CLI version: 0.22.0
  Phils-MacBook-Air:bin phillip$
  
  `wp help` shows the WordPress commands
  
  I'm now trying to implement
  
  ```
  /path/to/wp --user=<cron> --url=<http://example.com> --path=</path/to/wp> civicrm api job.execute auth=0
  
  ```
  
  In my case I'm trying
  
  ```
  /users/phillip/Sites/thetestsite.dev --user=<philnicholl> --url=<http://thetestsite.dev:8888> --path=</users/phillip/Sites/thetestsite.dev> civicrm api job.execute auth=0
  
  ```
  
  but I get
  
  -bash: philnicholl: No such file or directory
  
  (philnicholl is my WordPress administrator username)
  
  I know I'm missing something obvious.
  
  I'm have experience with WordPress and Mamp Pro but am new to both CLI and CIVICRM. Any help would be much appreciated.
  
  Thank you.
  
  **Tags:** cron, cli, mamp
  
  > **Comments:**
  > **username_1**: Just checking - does your command literally include the '<', '>' around the user, url and path values?  If so, remove them - they are meant as placeholders in the example line.  Bash interprets them as stdin, stdout redirection.  
  > **username_0**: Thank you. Running `/users/phillip/Sites/thetestsite.dev --user=philnicholl --url=http://thetestsite.dev:8888 --path=/users/phillip/Sites/thetestsite.dev civicrm api job.execute auth=0` I now get `-bash: /Users/phillip/Sites/thetestsite.dev: is a directory` I'm trying to follow these instructions: [https://wiki.civicrm.org/confluence/display/CRMDOC/Managing+Scheduled+Jobs#ManagingScheduledJobs-wp-climethod] Does the `/path/to/wp` in the instructions refer to the path to the root folder of the local site or to wp-cli.phar renamed as wp now in /usr/bin/ ?  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_2 on 2016-02-13. Score: 1 | Accepted answer
  
  Here's an example wp-cli command I use that works:
  
  ```
  /home/ubuntu/wp-cli/wp-cli --require=/home/ubuntu/wp-cli/civicrm.php --path=/var/www/wordpress civicrm api job.execute > /dev/null
  
  ```
  
  I hope that helps!
  
  UPDATE: I see your problem! "/path/to/wp" means, "path to wp-cli, including wp-cli". I completely looked past that part at the beginning, since that's not generally where the problems are found.
  
  Usually, "wp-cli" is aliased to "wp" so it can automatically include the CiviCRM extension - but with cron, I usually just use the require directly.
  
  So log into your computer and type `which wp-cli`. Let's say it returns `/usr/bin/local/wp-cli`. Replace ONLY the first path to WP with that, so it looks like:
  
  To forestall your next question about why it doesn't work - the is a placeholder, and the angle brackets should NOT be included in the actual statement. Angle brackets are a common way in documentation of command-line programs to say, "insert your value here". So instead of `<philnicoll>`, just write `philnicoll`.
  
  You should be left with something like:
  
  ```
  /usr/bin/local/wp-cli --user=philnicholl --url=http://thetestsite.dev:8888 --path=/users/phillip/Sites/thetestsite.dev civicrm api job.execute auth=0
  
  ```
  
  > **Comments:**
  > **username_0**: Thank you, though I'm not exactly sure how to change your command to suit my case.  
  > **username_2**: @philnicholl I just updated my answer, hope it helps.  
  > **username_0**: Thank you, Jon. I'd previously moved and renamed wp-cli as wp and moved it to /usr/bin - running `which wp` confirms this returning `/usr/bin/wp` . So I tried running `usr/bin/wp --user=philnicholl --url=http://thetestsite.dev:8888 --path=/users/phillip/Sites/thetestsite.dev civicrm api job.execute auth=0` and got `Error establishing a database connection` which seems like an improvement. Where now? Thank you for your help.  
  > **username_0**: The wiki CIVICRM instructions for the wp-cli method do seem rather confusing in that /path/to/wp appears twice in the code but represents two different things and then in the following comments it says 'Replace </path/to/wp civicrm>' Presumably the last placeholder chevron is in the wrong place and should be after wp and not after civicrm.  
  > **username_0**: I fixed the database connection problem following instructions here: http://laurenpittenger.com/wpcli-error-establishing-database-connection-mamp/ I had to unlock my bash profile using instructions here: http://stackoverflow.com/questions/15824493/my-bash-profile-is-locked-how-do-i-edit-it  All good now: Cron running OK. Thanks very much.  
  
  ---
  
  