phpCOIN & Cron

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • retro
    Member
    • Jun 2004
    • 40

    #1

    phpCOIN & Cron

    I set up a cron job to run invoices_auto.php from phpCOIN so that I can automate billing, however I get this error when the job runs:

    /bin/sh: line 1: /home/foo/public_html/clients/modules/invoices/invoices_auto.php: Permission denied

    If I go to foo.com/clients/modules/invoices/invoices_auto.php then it works fine and billing statments are sent out like clockwork... anyone know how to fix this?

    Thanks!
    Denny Cave
    http://www.retrointeractive.com
  • Andy
    Senior Member
    • Mar 2004
    • 257

    #2
    What the command your using to execute the file?
    I would probably run somthing like this.

    "php /home/foo/public_html/clients/modules/invoices/invoices_auto.php"

    Any help on phpcoins forums?
    Andy

    Comment

    • retro
      Member
      • Jun 2004
      • 40

      #3
      Well I think that got me a little farther... I hadn't put the "php" in front of the path of the file.. I didn't see anything on the phpCOIN forums for my old problem, but now I have a new one that I haven't had time to look into yet... This is what I get now:

      Content-type: text/html
      X-Powered-By: PHP/4.3.4

      <br />
      <b>Warning</b>: main(/home/foo/public_html/clients/modules/invoices/atroot.php): failed to open stream: No such file or directory in <b>/home/foo/public_html/clients/modules/invoices/invoices_auto.php</b> on line <b>22</b><br /> <br />
      <b>Warning</b>: main(): Failed opening '/home/foo/public_html/clients/modules/invoices/atroot.php' for inclusion (include_path='.:/usr/lib/php:/usr/local/lib/php') in <b>/home/foo/public_html/clients/modules/invoices/invoices_auto.php</b> on line <b>22</b><br /> <br />
      <b>Warning</b>: main(/includes/core.php): failed to open stream: No such file or directory in <b>/home/foo/public_html/clients/modules/invoices/invoices_auto.php</b> on line <b>25</b><br /> <br />
      <b>Warning</b>: main(): Failed opening '/includes/core.php' for inclusion (include_path='.:/usr/lib/php:/usr/local/lib/php') in <b>/home/foo/public_html/clients/modules/invoices/invoices_auto.php</b> on line <b>25</b><br /> <br />
      <b>Warning</b>: main(lang_invoices.php): failed to open stream: No such file or directory in <b>/home/foo/public_html/clients/modules/invoices/invoices_auto.php</b> on line <b>28</b><br /> <br />
      <b>Warning</b>: main(): Failed opening 'lang_invoices.php' for inclusion (include_path='.:/usr/lib/php:/usr/local/lib/php') in <b>/home/foo/public_html/clients/modules/invoices/invoices_auto.php</b> on line <b>28</b><br /> <br />
      <b>Warning</b>: main(/invoices/invoices_funcs.php): failed to open stream: No such file or directory in <b>/home/foo/public_html/clients/modules/invoices/invoices_auto.php</b> on line <b>31</b><br /> <br />
      <b>Warning</b>: main(): Failed opening '/invoices/invoices_funcs.php' for inclusion (include_path='.:/usr/lib/php:/usr/local/lib/php') in <b>/home/foo/public_html/clients/modules/invoices/invoices_auto.php</b> on line <b>31</b><br /> <br />
      <b>Warning</b>: main(/invoices/invoices_admin.php): failed to open stream: No such file or directory in <b>/home/foo/public_html/clients/modules/invoices/invoices_auto.php</b> on line <b>32</b><br /> <br />
      <b>Warning</b>: main(): Failed opening '/invoices/invoices_admin.php' for inclusion (include_path='.:/usr/lib/php:/usr/local/lib/php') in <b>/home/foo/public_html/clients/modules/invoices/invoices_auto.php</b> on line <b>32</b><br />


      There might be help out there for that one, I haven't had time to look yet, but if anyone knows how to fix this offhand then let me know!

      And thanks Andy for that quick reply
      Denny Cave
      http://www.retrointeractive.com

      Comment

      • Frank Hagan
        Senior Member
        • Mar 2004
        • 724

        #4
        Originally posted by retro
        I set up a cron job to run invoices_auto.php from phpCOIN so that I can automate billing, however I get this error when the job runs:

        /bin/sh: line 1: /home/foo/public_html/clients/modules/invoices/invoices_auto.php: Permission denied

        If I go to foo.com/clients/modules/invoices/invoices_auto.php then it works fine and billing statments are sent out like clockwork... anyone know how to fix this?

        Thanks!
        Try using the cURL command to run the one you know works; you'll have to look up the syntax, but it should be something like:

        curl http://www.foo.com/clients/modules/i...oices_auto.php

        Comment

        • retro
          Member
          • Jun 2004
          • 40

          #5
          Originally posted by Frank Hagan
          Try using the cURL command to run the one you know works; you'll have to look up the syntax, but it should be something like:

          curl http://www.foo.com/clients/modules/i...oices_auto.php
          That worked WONDERFULLY! Thank you very much for your suggestion, I didn't even realize we had cURL available to us.

          In case anyone else runs into this problem, the command I had to run was:

          Code:
          [FONT=Tahoma]/usr/bin/curl http://www.foo.com/clients/modules/invoices/invoices_auto.php[/FONT]
          Denny Cave
          http://www.retrointeractive.com

          Comment

          • cathode
            Member
            • Oct 2004
            • 88

            #6
            Originally posted by retro
            That worked WONDERFULLY! Thank you very much for your suggestion, I didn't even realize we had cURL available to us.

            In case anyone else runs into this problem, the command I had to run was:

            Code:
            [FONT=Tahoma]/usr/bin/curl http://www.foo.com/clients/modules/invoices/invoices_auto.php[/FONT]
            Thanks, I have been trying to set up a cron for a long time, and this finally worked!

            Comment

            • samsam
              Member
              • Mar 2004
              • 79

              #7
              wget (as well as curl) works too...

              Comment

              Working...