CRON JOB gurus what is wrong with this ??

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • halfpint
    GFY's Halfpint
    • Jun 2007
    • 15223

    #1

    CRON JOB gurus what is wrong with this ??

    One of the scripts I purchased wants me to set a cron job as follows

    0 * * * * php "path to your website dir"/cron.php

    So I set it up like this in Cpanel on a shared hosting account in the Advanced (Unix Style)

    Minute Hour Day Month Weekday Command
    0 * * * * /home/username/public_html/cron.php


    I keep getting emails saying this

    /bin/sh: /home/usermname/public_html/cron.php: Permission denied

    Does this mean that the cron job is not being done or being denied permissions or does it mean my email address is not acepting emails from the cron job


    If it is the cron job that is being denied should I change the file permissions on the cron.php or have I done something else wrong

    Thanks
    Last edited by halfpint; 09-12-2009, 01:40 PM.

    Get FREE website listings on Cryptocoinshops.net
  • lazzlo
    Confirmed User
    • Sep 2003
    • 3709

    #2
    Not a guru by any means but maybe the file needs execute permissions.

    Comment

    • brassmonkey
      Pay It Forward
      • Sep 2005
      • 77385

      #3
      make sure the path to php is right
      TRUMP 2026 KEKAW!!! - The Laken Riley Act Is Law!
      DACA ENDED - SUPPORT AZ HCR 2060 52R - email: brassballz-at-techie.com

      Comment

      • lazzlo
        Confirmed User
        • Sep 2003
        • 3709

        #4
        or there's in error in the path

        Comment

        • greg80
          Confirmed User
          • May 2007
          • 1644

          #5
          change file permision so that user that is running that cron command can execute the file

          (make the file executable for it's owner)
          Say no to GoDaddy and high renewal prices! Go with NameSilo - FREE private whois for life, $8.99 regstrations and renewals. Free redirects, emails, great control panel and more! NameSilo rocks!

          Comment

          • baddog
            So Fucking Banned
            • Apr 2001
            • 107089

            #6
            Not sure about cPanel, but with DirectAdmin you use the URL, so public_html would not be in the path.

            Comment

            • brassmonkey
              Pay It Forward
              • Sep 2005
              • 77385

              #7
              {PATH TO PHP} is usual /usr/local/bin/php

              {PATH TO PHP} /home/******/public_html/cron.php
              TRUMP 2026 KEKAW!!! - The Laken Riley Act Is Law!
              DACA ENDED - SUPPORT AZ HCR 2060 52R - email: brassballz-at-techie.com

              Comment

              • frank7799
                Confirmed User
                • Jul 2003
                • 1974

                #8
                If you set it up like this:

                /home/username/public_html/cron.php

                try this way instead (adding php and a space):

                php /home/username/public_html/cron.php

                If you just use /home/username/public_html/cron.php, the system will try to execute it as a shell script, I think, which causes the above error.
                Last edited by frank7799; 09-12-2009, 01:56 PM.

                Comment

                • fuzebox
                  making it rain
                  • Oct 2003
                  • 22353

                  #9
                  You forgot to put "php" in front of the file you wanted to run.

                  Comment

                  • halfpint
                    GFY's Halfpint
                    • Jun 2007
                    • 15223

                    #10
                    Originally posted by m4yadult
                    If you set it up like this:

                    /home/username/public_html/cron.php

                    try this way insted (adding php and a space):

                    php /home/username/public_html/cron.php

                    If you just use /home/username/public_html/cron.php, the system will try to execute it as a shell script, I think, which caused the above error.
                    ha I think thats the problem because the installation says set the cron up as this

                    0 * * * * php "path to your website dir"/cron.php

                    It has the "php" with a space in front


                    thanks

                    Get FREE website listings on Cryptocoinshops.net

                    Comment

                    • woj
                      <&(©¿©)&>
                      • Jul 2002
                      • 47880

                      #11
                      Originally posted by fuzebox
                      You forgot to put "php" in front of the file you wanted to run.

                      if that doesn't work, try full path to php /usr/bin/php or /usr/local/bin/php
                      Custom Software Development, email: woj#at#wojfun#.#com to discuss details or skype: wojl2000 or gchat: wojfun or telegram: wojl2000
                      Affiliate program tools: Hosted Galleries Manager Banner Manager Video Manager
                      Wordpress Affiliate Plugin Pic/Movie of the Day Fansign Generator Zip Manager

                      Comment

                      • halfpint
                        GFY's Halfpint
                        • Jun 2007
                        • 15223

                        #12
                        Originally posted by fuzebox
                        You forgot to put "php" in front of the file you wanted to run.
                        thanks .. I just realised what I had done when m4yadult posted


                        thanks guys for the help

                        Get FREE website listings on Cryptocoinshops.net

                        Comment

                        • frank7799
                          Confirmed User
                          • Jul 2003
                          • 1974

                          #13
                          Originally posted by halfpint
                          thanks guys for the help
                          No problem.

                          Comment

                          • PornMD
                            Mainstream Businessman
                            • Jan 2007
                            • 9291

                            #14
                            GFY CAN be a beautiful thing - problem solved in 20 mins, nice.
                            Want to crush it in mainstream with Facebook ads? Hit me up.

                            Comment

                            • halfpint
                              GFY's Halfpint
                              • Jun 2007
                              • 15223

                              #15
                              Originally posted by PornMD
                              GFY CAN be a beautiful thing - problem solved in 20 mins, nice.
                              Yep and its free ....people bitch about GFY all the time

                              I have asked for help a number of times on GFY and people on here have always helped

                              Thanks GFY and all the peeps that have helped me over the last 2 years

                              Get FREE website listings on Cryptocoinshops.net

                              Comment

                              • HomerSimpson
                                Too lazy to set a custom title
                                • Sep 2005
                                • 13826

                                #16
                                needs path to php...

                                example
                                0 * * * * /usr/bin/php -q /home/user/public_html/cron.php

                                you can also use some other command such as get or wget

                                0 * * * * GET http://www.yoursite.com/cron.php
                                0 * * * * wget http://www.yoursite.com/cron.php
                                Make a bank with Chaturbate - the best selling webcam program
                                Ads that can't be block with AdBlockers !!! /// Best paying popup program (Bitcoin payouts) !!!

                                PHP, MySql, Smarty, CodeIgniter, Laravel, WordPress, NATS... fixing stuff, server migrations & optimizations... My ICQ: 27429884 | Email:

                                Comment

                                • fris
                                  Too lazy to set a custom title
                                  • Aug 2002
                                  • 55705

                                  #17
                                  make sure the php file has a shebang
                                  Since 1999: 69 Adult Industry awards for Best Hosting Company and professional excellence.

                                  Comment

                                  • brassmonkey
                                    Pay It Forward
                                    • Sep 2005
                                    • 77385

                                    #18
                                    Originally posted by HomerSimpson
                                    needs path to php...

                                    example
                                    0 * * * * /usr/bin/php -q /home/user/public_html/cron.php

                                    you can also use some other command such as get or wget

                                    0 * * * * GET http://www.yoursite.com/cron.php
                                    0 * * * * wget http://www.yoursite.com/cron.php
                                    yep .
                                    TRUMP 2026 KEKAW!!! - The Laken Riley Act Is Law!
                                    DACA ENDED - SUPPORT AZ HCR 2060 52R - email: brassballz-at-techie.com

                                    Comment

                                    Working...