Maybe your web server is running under a user that doesn't have permission to execute the script, while the cron job is running as the the root user. So if the web server is running as user "apache", for example, and the script is owned by root (or by anybody other than apache actually), then the web server won't execute the script because the Unix permission on the script (the file) is only 755 -- rwx for the owner (first digit), but only rw (not x -- the needed executable bit) for the group (second digit) and for the "world" (third digit). The "apache" non-owner is in the "world" category, so no joy.