Results 1 to 4 of 4
  1. #1
    Crazy like a fox suzigeek's Avatar
    Join Date
    January 18th, 2005
    ftp get not working.
    Hi all,

    I've developed some php scripts that automatically download and populate my databases. They work flawlessly when executed from my desktop browser.

    I set them up to run as cron jobs through cpanel on my server directly so I won't have to think about it.

    The scripts that retrieve files via a http address work fine BUT my scripts that log into an ftp server(CJ) and try to download the file fail.

    The connection is made but I get this error:
    ftp_get(): Error opening *******_5604_20060114.txt.gz

    So for some reason it can't open the file. I have searched all over for any correlation between ftp_get and cron and I can't find anything specifically about it.

    These scripts do work but not when executed through cron.
    Here is my cron command:

    php -f /home/*****/public_html/test/download.php

    Anyone with any experience with this??


  2. #2
    Affiliate Manager
    Join Date
    January 18th, 2005
    This is what I use for my PHP cron jobs:

    lynx --dump >> /dev/null

  3. #3
    ABW Ambassador sjangro's Avatar
    Join Date
    January 18th, 2005
    suzigeek, it's hard to tell without more details, but given that it works from the command-line, but not from cron, it's probably a permissions problem or the path that's getting used by the script in cron is not valid.

    In the script, try explicitly specifying the path to where the file is to be stored.

    And, if that doesn't work, try creating and specifying a directory with world write privileges (chmod 777 dirname) and download the file there. With those open permissions, use a subdirectory that's only used for this purpose.

    Like chet, I use another method. I use wget or curl to get the file and then perl or php to operate on the downloaded file.

    wget -q

  4. #4
    Crazy like a fox suzigeek's Avatar
    Join Date
    January 18th, 2005
    Thanks for your help I ended up testing ftp_pasv option to false and that got it to work!

    Thanks again

    edited: on a side not I used google for my initial search and it gave me squat, then I tried msn again not much-- surprisingly enough Yahoo yeilded the best search results for me today. Actual information, not a bunch of garbage which Google seemed to have the most of.
    Last edited by suzigeek; January 15th, 2006 at 02:10 PM.

  5. Newsletter Signup

+ Reply to Thread

Similar Threads

  1. FTP for Datafeeds No Longer Working!
    By glittered in forum Google Affiliate Network - GAN
    Replies: 2
    Last Post: January 1st, 2010, 05:34 AM
  2. Is Linkshares FTP working?
    By Gordon in forum Rakuten LinkShare - LS
    Replies: 12
    Last Post: June 24th, 2005, 05:13 PM
  3. FTp not working?
    By mprime in forum WebMerge (
    Replies: 1
    Last Post: March 11th, 2004, 02:19 PM

Posting Permissions

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