Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9079323
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T19:48:38+00:00 2026-06-16T19:48:38+00:00

I am trying to run in mac a php script using cron. I want

  • 0

I am trying to run in mac a php script using cron. I want this php script to run every one minute. I read several sources online and from my understanding is better if I use launchd. In any case, I try to make it work with cron and then if it works fine I might try to use launchd.

So here is what I do:

I wrote this command in a txt file:

    * * * * * /usr/bin/php /Applications/MAMP/htdocs/php_test/main_script.php

There I have the path to php (I found it with the “which php” command) and the path to my php script.

I named the txt file: crontasks.txt and I run it through terminal with this command:

       crontab /Users/dkar/Desktop/crontasks.txt

When I list the crons (crontab -l) I see that this job is listed. But nothing comes as output every one minute. The output is supposed to be an image stored in a specified folder. What am I missing here?
Thanks in advance
D.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-16T19:48:39+00:00Added an answer on June 16, 2026 at 7:48 pm

    You might have a slight miscomprehension how crond processes the “crontab” files. It would suffice to run the command crontab -e, which would let you edit your personal crontab or you edit the system crontab.

    If you use crontab -e it will open the default editor (vi/vim) and you can enter the line:

      * * * * * /usr/bin/php /Applications/MAMP/htdocs/php_test/main_script.php
    

    Then you simply save your file. If you want to use the system crontab you will have to edit it directly and enter the line. Additionally the system crontab has one more field for the username. Like this:

      * * * * * /usr/bin/php root /Applications/MAMP/htdocs/php_test/main_script.php
    

    On the next full minute your script will be executed by crond.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to run this script on Mac OS 10.7 (Lion) and I'm getting
I am trying to run this shell script command through applescript on my mac
I am trying to run /Applications/MAMP/bin/php/php5.4.3/bin/pear From Terminal on Mac OS X Lion. I
I'm trying to run on my mac os 10.6 a Ruby script that apparently
I'm trying to run the following line of script in bash on Mac OS
Here is my Code that I'm trying to run on Mac OS X: import
I'm trying to run ActiveMQ on Mac OSX 10.5.7. I have Java version 1.5.0_19
I am trying to run our App on Mac Lion. App is built on
For a new project I'm trying to run postgres locally. Mac Lion has Postgres
I'm working with XAMPP on Mac OS X. I'm trying to run a Symfony

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.