Community Forums
Connect with us on LinkedIn
Community Notice
+ Reply to Thread
Results 1 to 6 of 6
  1. #1
    Member BeNE.WS's Avatar
    Join Date
    May 2003
    Location
    Belgium
    Posts
    49

    Question Cron - PHP Script

    Hello list,

    I am executing a PHP-script via a cronjob.

    I use the following command:
    lynx -dump http://www.mydomain.com/news_search.php & /dev/null

    The cronjob is working and IS updating the news-page on my website. But every time when the cronjob runs I got the following mail:

    /bin/sh: /dev/null: Permission denied

    You have an error in your SQL syntax. Check the manual that
    corresponds to your MySQL server version for the right syntax to use
    near 'B: 4.50 (-4.44%


    When I run the script in my browser I have NO errors. The script does NOT generate output on the screen.

    Any suggestions ??

    Thanks

    cPanel.net Support Ticket Number:
    Regards,


    Steven Depuydt
    www.BeNe.WS

  2. #2
    Member
    Join Date
    Apr 2003
    Posts
    223

    Default

    change:

    lynx -dump http://www.mydomain.com/news_search.php & /dev/null

    to

    lynx -dump http://www.mydomain.com/news_search.php > /dev/null

    this sends all output straight to /dev/null and shouldnt email you unless the program (lynx) returns a none zero number (Something wrong if it does), personally i suggest looking at wget, and using that instead.

    cPanel.net Support Ticket Number:

  3. #3
    Member BeNE.WS's Avatar
    Join Date
    May 2003
    Location
    Belgium
    Posts
    49

    Default

    Thanks,

    That helped.

    Why is wget better ?
    Doesn't it leaves a file on the server everytime you do wget ?

    cPanel.net Support Ticket Number:
    Regards,


    Steven Depuydt
    www.BeNe.WS

  4. #4
    Member
    Join Date
    Aug 2002
    Posts
    1,052

    Default

    lynx is perfectly fine. You can also use GET if you'd like. No reason to use wget in this case.

    cPanel.net Support Ticket Number:

  5. #5
    Member isputra's Avatar
    Join Date
    May 2003
    Location
    Mbelitar
    Posts
    593

    Default

    what about if i want to cron the file at /home/users and not at /home/users/public_html ?

    i used php /home/users/script.php > /dev/null like suggested by other post on this forum but have result on my email :

    "Failed loading /usr/local/Zend/lib/ZendOptimizer.so: /usr/local/Zend/lib/ZendOptimizer.so: cannot open shared object file: No such file or directory"

    So what command i must use for that script to work ?

    can i use :

    lynx -dump /home/users/script.php > /dev/null

    or maybe

    /usr/bin/wget -O - /home/users/script.php > /dev/null

    Last edited by isputra; 07-25-2003 at 08:43 PM.
    It's me ...... It's me ......

  6. #6
    Member isputra's Avatar
    Join Date
    May 2003
    Location
    Mbelitar
    Posts
    593

    Default

    Nevermind.

    It's work now

    cPanel.net Support Ticket Number:
    It's me ...... It's me ......

Similar Threads & Tags
Similar threads

  1. PHP script not sending email when called throught a cron with lynx
    By BianchiDude in forum cPanel and WHM Discussions
    Replies: 8
    Last Post: 04-08-2011, 07:20 PM
  2. Cron Job, Run PHP script
    By bowers01 in forum New User Questions
    Replies: 2
    Last Post: 11-18-2010, 04:23 PM
  3. PHP script as Cron job
    By pphas in forum cPanel and WHM Discussions
    Replies: 4
    Last Post: 02-07-2008, 03:20 AM
  4. cron jobs - how to run a simple php script
    By adentone in forum cPanel and WHM Discussions
    Replies: 7
    Last Post: 09-19-2005, 07:26 AM
  5. Cron tab php script
    By opticempire in forum cPanel and WHM Discussions
    Replies: 2
    Last Post: 07-09-2003, 12:11 PM
Linkedin       Facebook       Twitter       RSS       Flickr       YouTube