Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New Coder
    Join Date
    Nov 2005
    Posts
    41
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Exclamation cron job wont run imagecreatefrompng

    So i have a script on my server that creates a set of images from one. When the script is called in the browser the script runs fine. When it runs as a cron job it fails.

    now to see if i am getting an error i ran the script from the command prompt as the same user that is running the cron job. and i get this error

    call to undefined function: imagecreatefrompng()

    but this works in the browser!!! any ideas?

  • #2
    Master Coder
    Join Date
    Jun 2003
    Location
    Cottage Grove, Minnesota
    Posts
    9,470
    Thanks
    8
    Thanked 1,085 Times in 1,076 Posts
    Specifically, how do you "call" the script?

    If you're using your browser to do something like: makephoto.php?photo=mypic.png

    And you're doing the same thing with the CRON, the method you use
    in your PHP script (to read the variable $photo) may be your problem.

    Example:

    $photo=$_POST['photo'];
    $photo=$_GET['photo'];
    $photo=$_REQUEST['photo'];

    If you're not sure whether to use POST or GET, use REQUEST ... that
    will handle all incoming variables.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •