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

  • Home
  • SEARCH
  • 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 511757
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T07:14:59+00:00 2026-05-13T07:14:59+00:00

I have a PHP script that I need to run every minute. I have

  • 0

I have a PHP script that I need to run every minute. I have made sure that the script works from the command line, and I’m using absolute paths to avoid any environment issues:

/usr/bin/php -q /var/www/myapp/services/myservice.php

Manually running that as root from the command line works fine, as I can see from the log file that my script writes to. To be sure, the script has execute permissions as well.

However, when placing the same exact command in a cron:

* * * * * /usr/bin/php -q /var/www/myapp/services/myservice.php

It does not run or at least it appear so. I’ve tried redirecting the output to another log file too:

* * * * * /usr/bin/php -q /var/www/myapp/services/myservice.php >> /mylog.log 2>&1

Still nothing. I have no indication whatsoever of the script being ran. I guess it doesn’t, but I have no idea what else to look for. I even restarted the cron daemon.

I know there are similar questions on StackOverflow, but none of the answers turned out to be a solution for me. This is literally driving me crazy, I will greatly appreciate any help.

  • 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-05-13T07:15:00+00:00Added an answer on May 13, 2026 at 7:15 am

    I found a solution for my issue:

    https://serverfault.com/questions/97828/php-from-command-line-path-problems/97881#97881

    It turns out I needed to cd (change directory) into the script dir and then call it. Surprising, since I’m using absolute paths, but it works. Thanks to those who have taken the time to respond.

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

Sidebar

Ask A Question

Stats

  • Questions 245k
  • Answers 245k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer You can do the following to get your number: Set… May 13, 2026 at 8:12 am
  • Editorial Team
    Editorial Team added an answer How do i map domain name to userid when request… May 13, 2026 at 8:12 am
  • Editorial Team
    Editorial Team added an answer Browsers do not listen on port 80, HTTP servers do… May 13, 2026 at 8:12 am

Related Questions

i am using form authentication for my website which is written in ASP.Net, but
I have a PHP script that executes a .bat file using system(cmd /c C:\dir\file.bat);
I have the following situation. I have a PHP script that imports a CSV
I have a php script that is run once a minute. The script runs
I have a cron job the executes a PHP script. The cron is setup

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.