Community Forums
Connect with us on LinkedIn
+ Reply to Thread
Page 1 of 2 1 2 LastLast
Results 1 to 15 of 16
  1. #1
    Member
    Join Date
    Jul 2003
    Location
    Indonesia / Germany
    Posts
    79

    Default Cronjobs Syntax error - need Advise

    Hello Forum Member

    i have a php script which should running every 15 min as a cron job

    its located in /home/*****/public_html/*****/*****/serv_cron.php

    if i put in the cpanel cronjob manager only the path to this
    file i get follow error message:

    /home/****/public_html/****/*****/serv_cron.php: ?
    : No such file or directory
    /home/****/public_html/****/*****/serv_cron.php: line 2: syntax error near unexpected token `include("../config.php")'
    /home/****/public_html/****/*****/serv_cron.php: line 2: `include("../config.php"); '

    can someone please hlp me to bring light in this problem or to point me in the right direction ?
    What i have to type in in the cronjob manager ?

    Thank you for your help!

    cPanel.net Support Ticket Number:

  2. #2
    Member Jemshi's Avatar
    Join Date
    Sep 2003
    Location
    India
    Posts
    217

    Default

    I think you have missed the /usr/bin/php (interpreter).

    crontab -l from your login should show something like this.

    * * * * * /usr/bin/php _full_path_to_script

    thats all.

    cPanel.net Support Ticket Number:
    Jemshad O K
    Sys Admin
    Bobcares.com
    http://www.poornam.com
    Winners don't do different things. They do things differently

  3. #3
    Member
    Join Date
    Jul 2003
    Location
    Indonesia / Germany
    Posts
    79

    Default

    Originally posted by Jemshi
    I think you have missed the /usr/bin/php (interpreter).

    crontab -l from your login should show something like this.

    * * * * * /usr/bin/php _full_path_to_script

    thats all.

    cPanel.net Support Ticket Number:
    Thank you for your fast answer and your help.

    the problem for me is:

    i dont have shell or telnet access - so i can only setup the crontab via Cpanel - Crontabs

    and i have no glue how to write this syntax


    Thank you

    cPanel.net Support Ticket Number:

  4. #4
    Member Jemshi's Avatar
    Join Date
    Sep 2003
    Location
    India
    Posts
    217

    Default

    okay, then add this much from your control panel.

    /usr/bin/php _full_path_to_script

    and of course, your times also :-)

    cPanel.net Support Ticket Number:
    Jemshad O K
    Sys Admin
    Bobcares.com
    http://www.poornam.com
    Winners don't do different things. They do things differently

  5. #5
    Member
    Join Date
    Jul 2003
    Location
    Indonesia / Germany
    Posts
    79

    Default

    Originally posted by Jemshi
    okay, then add this much from your control panel.

    /usr/bin/php _full_path_to_script

    and of course, your times also :-)

    cPanel.net Support Ticket Number:
    Hello jemshi

    Thanx for the fast answer
    asume the script is located in a subrot folder like this:

    /home/*****/public_html/3/0815/stat_cron.php

    should i type in the path ( syntax ) like this

    sh /home/*****/public_html/3/0815/stat_cron.php

    or the syntax you type in this thread:

    /usr/bin/php /home/*****/public_html/3/0815/stat_cron.php

    i am a newbie in cpanel so please excuse me if i clarify or ask again

    Thank you
    Guido

    cPanel.net Support Ticket Number:

  6. #6
    Member Jemshi's Avatar
    Join Date
    Sep 2003
    Location
    India
    Posts
    217

    Default

    Originally posted by GuiPos
    Hello jemshi

    Thanx for the fast answer
    asume the script is located in a subrot folder like this:

    /home/*****/public_html/3/0815/stat_cron.php

    should i type in the path ( syntax ) like this

    sh /home/*****/public_html/3/0815/stat_cron.php

    or the syntax you type in this thread:

    /usr/bin/php /home/*****/public_html/3/0815/stat_cron.php

    i am a newbie in cpanel so please excuse me if i clarify or ask again

    Thank you
    Guido

    cPanel.net Support Ticket Number:
    dont use the sh line.. this means that you are asking the shell to execute php - this is not right.
    use the following line.

    /usr/bin/php /home/*****/public_html/3/0815/stat_cron.php

    cPanel.net Support Ticket Number:
    Jemshad O K
    Sys Admin
    Bobcares.com
    http://www.poornam.com
    Winners don't do different things. They do things differently

  7. #7
    Member
    Join Date
    Jul 2003
    Location
    Indonesia / Germany
    Posts
    79

    Default

    Originally posted by Jemshi
    dont use the sh line.. this means that you are asking the shell to execute php - this is not right.
    use the following line.

    /usr/bin/php /home/*****/public_html/3/0815/stat_cron.php

    cPanel.net Support Ticket Number:
    its seems to work
    i got a email :

    Failed loading /usr/local/Zend/lib/ZendOptimizer.so: /usr/local/Zend/lib/ZendOptimizer.so: undefined symbol: zend_execute_internal
    X-Powered-By: PHP/4.1.2
    Content-type: text/html

    i think now the only issue is that the zend optimizer isn't working

    thankyou

    cPanel.net Support Ticket Number:

  8. #8
    Member
    Join Date
    Mar 2002
    Location
    Alberta, Canada
    Posts
    1,509

    Default Re: Cronjobs Syntax error - need Advise

    Originally posted by GuiPos
    Hello Forum Member

    i have a php script which should running every 15 min as a cron job

    its located in /home/*****/public_html/*****/*****/serv_cron.php

    What i have to type in in the cronjob manager ?
    */15 * * * * GET http://yourdomain.com/path/to/cron_script.php > /dev/null

    This should get that script every 15 minutes, but will not send you an email every 15 minutes telling you it finished (that would be horrible), that is were the /dev/null comes into play.

    Or so I'm told anyway.
    Never tried it myself so would be interested in your feedback.

    cPanel.net Support Ticket Number:
    Helping people Host, Create, and Maintain their Web Site
    Also providing Server Admin Services - setup / troubleshooting

    http://potentproducts.com/

  9. #9
    Member
    Join Date
    Jul 2003
    Location
    Indonesia / Germany
    Posts
    79

    Default Re: Re: Cronjobs Syntax error - need Advise

    Originally posted by Website Rob
    */15 * * * * GET http://yourdomain.com/path/to/cron_script.php > /dev/null

    This should get that script every 15 minutes, but will not send you an email every 15 minutes telling you it finished (that would be horrible), that is were the /dev/null comes into play.

    Or so I'm told anyway.
    Never tried it myself so would be interested in your feedback.

    cPanel.net Support Ticket Number:
    Thank you - Website Rob

    But the problem - i have no shell or telnet access
    i can only configure this via cpanel - cronjobs

    and run in some small probs.

    cPanel.net Support Ticket Number:

  10. #10
    Member
    Join Date
    Mar 2002
    Location
    Alberta, Canada
    Posts
    1,509

    Default

    Use 'Advanced' instead of Standard within Cpanel-Cron jobs.

    cPanel.net Support Ticket Number:
    Helping people Host, Create, and Maintain their Web Site
    Also providing Server Admin Services - setup / troubleshooting

    http://potentproducts.com/

  11. #11
    Member
    Join Date
    Jul 2003
    Location
    Indonesia / Germany
    Posts
    79

    Default

    Originally posted by Website Rob
    Use 'Advanced' instead of Standard within Cpanel-Cron jobs.

    cPanel.net Support Ticket Number:
    its hard to be a newbie -> i overlook it

    i will try right now

    Thank you

    cPanel.net Support Ticket Number:

  12. #12
    Member
    Join Date
    Jul 2003
    Location
    Indonesia / Germany
    Posts
    79

    Default Re: Re: Cronjobs Syntax error - need Advise

    Originally posted by Website Rob
    */15 * * * * GET http://yourdomain.com/path/to/cron_script.php > /dev/null

    This should get that script every 15 minutes, but will not send you an email every 15 minutes telling you it finished (that would be horrible), that is were the /dev/null comes into play.

    Or so I'm told anyway.
    Never tried it myself so would be interested in your feedback.

    cPanel.net Support Ticket Number:
    i think its work fine
    but if i dont write the email address in the header of the crontabs - cpanel then is this the same solutions ?

    Thank you very much

    cPanel.net Support Ticket Number:

  13. #13
    Member
    Join Date
    Mar 2002
    Location
    Alberta, Canada
    Posts
    1,509

    Default

    Not sure what you mean?

    If you do want eMails then leave off: > /dev/null

    BTW, why do you quote every post?

    cPanel.net Support Ticket Number:
    Helping people Host, Create, and Maintain their Web Site
    Also providing Server Admin Services - setup / troubleshooting

    http://potentproducts.com/

  14. #14
    Member
    Join Date
    Jul 2003
    Location
    Indonesia / Germany
    Posts
    79

    Default

    why i allway try to catch the postreply button but my mouse is to fast after to many cafes.

    [beginner mistake]

    what i mean is - if the cronjob can not start script
    will i receive a error message ?

    cPanel.net Support Ticket Number:

  15. #15
    Member
    Join Date
    Mar 2002
    Location
    Alberta, Canada
    Posts
    1,509

    Default

    That's where your own testing comes in.

    cPanel.net Support Ticket Number:
    Helping people Host, Create, and Maintain their Web Site
    Also providing Server Admin Services - setup / troubleshooting

    http://potentproducts.com/

Similar Threads & Tags
Similar threads

  1. Parse error: syntax error, unexpected T_ECHO
    By crazyaboutlinux in forum cPanel and WHM Discussions
    Replies: 2
    Last Post: 04-03-2009, 04:58 AM
  2. syntax error
    By hassnetwork in forum New User Questions
    Replies: 3
    Last Post: 01-18-2006, 09:09 AM
  3. syntax error in X theme
    By mikeyskona in forum cPanel and WHM Discussions
    Replies: 0
    Last Post: 02-05-2004, 02:06 AM
  4. MySQL syntax error HELP!
    By MscLimp in forum cPanel and WHM Discussions
    Replies: 3
    Last Post: 09-15-2003, 02:16 PM
Linkedin       Facebook       Twitter       RSS       Flickr       YouTube