1. Please take a little time for this simple survey! Thank you for participating!
    Dismiss Notice
  2. Dear Pleskians, please read this carefully! New attachments and other rules Thank you!
    Dismiss Notice
  3. Dear Pleskians, I really hope that you will share your opinion in this Special topic for chatter about Plesk in the Clouds. Thank you!
    Dismiss Notice

weird - php script not updating mysql from cron?

Discussion in 'Plesk for Linux - 8.x and Older' started by michaellunsford, Sep 9, 2005.

  1. michaellunsford

    michaellunsford Regular Pleskian

    25
    90%
    Joined:
    Jul 25, 2005
    Messages:
    131
    Likes Received:
    0
    root cron calls a php file that reads a tab delimited text file and inserts the data into a mysql database. What's strange is I'm getting the cron e-mail that shows everything working fine, but the database seems to never get updated.

    If I run the php script from ssh or even a browser, I get the same detailed results that show up in the cron email, but the database gets updated.

    To add mystery, I have a duplicate cron script on a different server that is working just fine.

    Am I missing some weird setting in the cron control panel to make this work?
     
  2. hardweb

    hardweb Guest

    0
     
    It looks like a path problem, be aware due to the env there is a little difference if you execute a file from root shell or from cron.
     
  3. michaellunsford

    michaellunsford Regular Pleskian

    25
    90%
    Joined:
    Jul 25, 2005
    Messages:
    131
    Likes Received:
    0
    How can I remedy or code around the path problem?
     
  4. michaellunsford

    michaellunsford Regular Pleskian

    25
    90%
    Joined:
    Jul 25, 2005
    Messages:
    131
    Likes Received:
    0
    So, is there a way to change the "env" or code around the difference between cron and root shell login? would a system call to "sudo /usr/bin/php" work?
     
Loading...