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 3235846
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T17:33:13+00:00 2026-05-17T17:33:13+00:00

I have several PHP files to be run by cron. I set up the

  • 0

I have several PHP files to be run by cron. I set up the crons using command-

crontab crontab.txt

Inside the crontab.txt file, I have written cron commands like this:-

#(Updating tutor activities) - every minute
* * * * * /usr/bin/wget -O - -q -t 1 http://project/cron/tutor_activities.php

But none of the functionalities are working (database queries, sending reminder mails etc.). Running the URLs manually works.

Then I put my mail address in MAILTO and received the mails. In the mail, I received entire HTML source of the page. What is expected in the mail? Why are my functionalities not working?

Updates
If I change my cron commands to

 #(Updating tutor activities) - every minute
    * * * * * /usr/bin/wget http://project/cron/tutor_activities.php

Still no success and this comes in my mail –

--15:03:01--  http://project/cron/tutor_activities.php
          => `tutor_activities.php'
Resolving project... IP Address
Connecting to test.project|IP Address|:80... connected.
HTTP request sent, awaiting response... 301 Moved Permanently
Location: http://project./ [following]
--15:03:01--  http://project./
          => `index.html.1'
Resolving project.... IP Address
Connecting to project.|IP Address|:80... connected.
HTTP request sent, awaiting response... 302 Found
Location: http://project/home/ [following]
--15:03:01--  http://project/home/
          => `index.html.1'
Resolving project... IP Address
Connecting to wproject|IP Address|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: unspecified [text/html]
index.html.1 has sprung into existence.
Retrying.

And lots of index.html.1 , index.html.2 files are accumulating in the root of my project. I do not want these files to be created. Just want the files to execute.

Same results if I use either of the two commands –

   * * * * * /usr/bin/wget http://project/cron/tutor_activities.php

   * * * * * wget http://project/cron/tutor_activities.php

running php command with MAILTO set sends me this error /bin/sh: php: command not found.

* * * * * php /path/to/test.php

So, I am not able to use php command.

I have written a simple mailto() inside my test.php. The mail does not come when run through cron (using both wget and php fails) but running the URL manually works.

My problem
To make it clear again, my main problem is that the functionality inside the cron files is not running. Creation of files is a secondary issue.

Any help would be appreciated

Thanks,
Sandeepan

  • 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-17T17:33:13+00:00Added an answer on May 17, 2026 at 5:33 pm

    I found the problem myself. I did not put the same URL in my crontab file which I was running manually and that was my mistake.

    While running manually I was just typing test in the URL, my browsers’s list of saved URLs was appearing and I was selecting the URL http://www.test.project.com/cron/tutor_activities.php, but in the crontab file I had put http://test.project.com/cron/tutor_activities.php. I was mistakenly assuming this would run http://www.test.project.com/cron/tutor_activities.php (because we have a rewrite rule present to add www)

    But the rewrite rule was redirecting it to http://www.test.project.com/home. That’s why the HTML content in the mails.

    So, the most important thing to learn here is to make sure we don’t miss the minute things and don’t assume that we did everything correctly. In my case, better to copy-paste the working URL into the cron file.

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

Sidebar

Related Questions

I have a index.php file that will include several external files: content/templates/id1/template.php content/templates/id2/template.php content/templates/id3/template.php
i have the strangest bug. in my php file i include several php files:
I have several PHP files include()ing other files from several other directories. In one
I'm writing multilingual website. I have several files on server like: /index.php /files.php /funny.php
i have several php files, and there's references to .html files in those. I
I have a PHP script that needs to download several files from a remote
If i have several PHP files and im setting a session variable in one
I have the next problem. I have several PHP systems running in different Windows
I have a php installation where i want to have several extensions loaded via
I have a php application that is installed on several servers and all of

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.