Community Forums
Connect with us on LinkedIn
+ Reply to Thread
Results 1 to 2 of 2
  1. #1
    Member
    Join Date
    Jan 2004
    Posts
    35

    Default CRON and PHP scripts

    This one has me stumped!

    Had a server running Redhat 4 and WHM/cPanel (up to date stable). Got a new server, running RedHat 5 and WHM/cPanel (up to date release). Used the WHM Transfer function to migrate the sites over to the new server.

    Now, what I am finding is that CRON jobs that were running fine on the old server will no longer work on the new one. Here's the specifics:

    We run a program on this server for weather creation (forecasts, current condition images, etc.) In particular, we have a PHP script which calls the weather program to generate an image which shows the current conditions for a town and saves it in a folder on the server. This script works fine when we run it on the command line and produces the desired output.

    However, when we setup this script to run as a CRON job, we don't get the output of the image. Instead, it looks like it is just interpreting the script as text and spitting that out as a result of the CRON, but no image.

    Again, I can run this PHP script at the command line and it works every time, but getting it to run as a CRON has me stopped in my tracks. What is really confusing is that it was working on the previous server!


    Here's an example of the script (forecast.php) which runs fine at the command line:
    /usr/bin/php /full_server_path/hw3.php forecast=hourly pands=27524 state=nc config=png alt=4042front hwvusename=weatherimage
    This will execute properly on the command line in the following two ways:

    1. If I am in the folder with the script and type:

    ./forecast.php

    2. I am anywhere on the server and type:

    /full_server_path_to_script/forecast.php


    When setting up the CRON, I have tried setting the command to run as:

    /full_server_path_to_script/forecast.php

    php /full_server_path_to_script/forecast.php

    Neither of those produce the output of the image as it does when I execute on the command line.

    The version of PHP being used is: PHP 4.4.7 (cli)

    Any words of wisdom about how to get this to run properly again on a CRON?

    Thanks!

  2. #2
    Member
    Join Date
    May 2007
    Posts
    6

    Default

    Did you ever get this fixed. I am having a similar problem with a different part of HamWeather

Similar Threads & Tags
Similar threads

  1. Replies: 4
    Last Post: 05-21-2010, 10:10 AM
  2. /scripts/upcp Cron
    By dxer in forum cPanel and WHM Discussions
    Replies: 2
    Last Post: 04-13-2008, 11:40 AM
  3. CGI scripts not sending email, php scripts will
    By BianchiDude in forum cPanel and WHM Discussions
    Replies: 1
    Last Post: 11-17-2006, 04:20 AM
  4. Replies: 2
    Last Post: 12-11-2005, 09:45 PM
  5. Cron /scripts/upcp
    By pcdior in forum cPanel and WHM Discussions
    Replies: 0
    Last Post: 12-30-2004, 02:37 AM
Linkedin       Facebook       Twitter       RSS       Flickr       YouTube