Community Forums
Connect with us on LinkedIn
Community Notice
+ Reply to Thread
Results 1 to 4 of 4
  1. #1
    Member
    Join Date
    Mar 2002
    Posts
    248

    Default why a php script won't run when place in cron.. fine when i run it manually..

    Hi all,

    I couldn't find any error to trace down the reason why my php script did not run though cron indicate that it was started. When i run the script manually, it works.

    I couldn't remember what caused this.

  2. #2
    Member
    Join Date
    Jan 2005
    Posts
    81

    Default

    If you try to run the script in the command line, in example:

    php your_script.php
    does it say any errors ?

    Besides, check if there are several php installed.

    You can try with:

    whereis php


    or with:

    locate php

    Regards
    Adrian Perez Reyes

    Matnews
    AdminCPD

  3. #3
    cPanel Partner NOC cPanel Partner NOC Badge AndyReed's Avatar
    Join Date
    May 2004
    Location
    Minneapolis, MN
    Posts
    2,223

    Default

    Quote Originally Posted by gundamz View Post
    I couldn't find any error to trace down the reason why my php script did not run though cron indicate that it was started. When i run the script manually, it works.
    Did you restart crond? If yes, it is very likely the entry in crontab is not correct.
    Andy Reed
    RHCE and CCNA
    ServerTune.com

  4. #4
    Member
    Join Date
    May 2006
    Location
    Johannesburg, South Africa
    Posts
    881

    Default

    try php -q -f /home/{account}/public_html/{path_to_cron_script.php} OR lynx --dump http://www.yourdomain.com/{path_to_cron_script.php} in your crontab entry
    • cPanel :: Fantastico :: RVSkin :: WHM :: ModernBill
    • Reseller Hosting :: SSL Certificates :: Domain Registrations :: Affiliate Program
    • Blog Hosting :: CMS Hosting :: Forum Hosting :: E-Commerce Hosting
    SoftDux- The Leaders in Software
    Use the coupon: cpanel-06 to get 20% off our packages

Similar Threads & Tags
Similar threads

  1. Cron Job, Run PHP script
    By bowers01 in forum New User Questions
    Replies: 2
    Last Post: 11-18-2010, 04:23 PM
  2. One PHP script on website won't run
    By knipper in forum cPanel and WHM Discussions
    Replies: 5
    Last Post: 02-08-2009, 12:09 PM
  3. Manually run the maildir conversion script?
    By GTFO in forum cPanel and WHM Discussions
    Replies: 3
    Last Post: 06-27-2008, 12:42 PM
  4. Call Script that Deletes Logs after Stats Run Manually?
    By thewird in forum cPanel and WHM Discussions
    Replies: 0
    Last Post: 01-12-2008, 09:11 AM
  5. cron jobs - how to run a simple php script
    By adentone in forum cPanel and WHM Discussions
    Replies: 7
    Last Post: 09-19-2005, 07:26 AM
Linkedin       Facebook       Twitter       RSS       Flickr       YouTube