Please whitelist cPanel in your adblocker so that you’re able to see our version release promotions, thanks!

The Community Forums

Interact with an entire community of cPanel & WHM users!

Cron - PHP Script

Discussion in 'General Discussion' started by BeNE.WS, Jul 3, 2003.

  1. BeNE.WS

    BeNE.WS Well-Known Member

    Joined:
    May 14, 2003
    Messages:
    49
    Likes Received:
    0
    Trophy Points:
    156
    Location:
    Belgium
    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:
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  2. X-Istencedotcom

    X-Istencedotcom Well-Known Member

    Joined:
    Apr 14, 2003
    Messages:
    223
    Likes Received:
    0
    Trophy Points:
    166
  3. BeNE.WS

    BeNE.WS Well-Known Member

    Joined:
    May 14, 2003
    Messages:
    49
    Likes Received:
    0
    Trophy Points:
    156
    Location:
    Belgium
    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:
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  4. ciphervendor

    ciphervendor Well-Known Member

    Joined:
    Aug 26, 2002
    Messages:
    1,052
    Likes Received:
    0
    Trophy Points:
    166
    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:
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  5. isputra

    isputra Well-Known Member

    Joined:
    May 3, 2003
    Messages:
    575
    Likes Received:
    0
    Trophy Points:
    166
    Location:
    Mbelitar
    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
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
    #5 isputra, Jul 25, 2003
    Last edited: Jul 25, 2003
  6. isputra

    isputra Well-Known Member

    Joined:
    May 3, 2003
    Messages:
    575
    Likes Received:
    0
    Trophy Points:
    166
    Location:
    Mbelitar
    Nevermind.

    It's work now :D

    cPanel.net Support Ticket Number:
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
Loading...

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice