/usr/bin/wget: Permission denied

If you’ve ever got the error /bin/sh: /usr/bin/wget: Permission denied when trying to execute a .php script using a cron job, spent minutes/hours trying to find a solution to this, well, I hope this post will help you to save some time.

It’s possible that your hosting provider, for security reasons, is not allowing you to execute the wget command. If you want to use the wget (or GET) command, you can do two things:

a) send an email to your hosting provider’s support department. Or

b) you can try using the following command:

php -q /path/to/script.php

The above example worked for me nicely. However, if it still doesn’t work for you, then contact your hosting provider; maybe there are other things that they need to take care of (or fix) first before you can work with cron jobs.

Cheers!

11 Comments

  1. Jim
    Posted August 13, 2006 at 12:52 pm | Permalink

    Thanks, big help :)

  2. Posted August 13, 2006 at 12:56 pm | Permalink

    Glad to be of assistance ;)

  3. Richard
    Posted October 7, 2006 at 8:15 pm | Permalink

    Thanks :)

  4. Posted April 27, 2007 at 6:54 pm | Permalink

    thanks, it worked for me too

  5. anata
    Posted September 7, 2007 at 10:05 pm | Permalink

    Thanks .

  6. vefa
    Posted January 5, 2008 at 2:45 pm | Permalink

    thaks

  7. Alex
    Posted February 11, 2008 at 3:11 pm | Permalink

    Thanks, i was having problems using wget, did a search on the error I was getting and found this solution. Perfect !!

  8. Posted February 11, 2008 at 3:45 pm | Permalink

    glad I could be of help :)

  9. Tarik
    Posted April 26, 2008 at 11:41 am | Permalink

    Thank you, worked great.

  10. alex
    Posted May 13, 2008 at 4:34 pm | Permalink

    thanks, you made me stop working for hours.:)

  11. Posted July 15, 2008 at 11:23 pm | Permalink

    it really helps we have been stucked at this point due to first experience in handling cron job i cant resolve the problem at my own thanx for helping dude. you rocks