Ok, one issue led to another, but I finally got it worked out after I resolved three things…here they are:
Problem 1) I have 2 users of identical names, each on a different machine. I was trying to run the cronjob under the wrong user (and thus, on the wrong machine.) I switched users and that got the cronjob to email me some output – lots of error messages which led me to the next issue.
Problem 2) The php script that I’m running with this cronjob contains a couple of includes that are included relative to the php script. I just used Curl so the php script would act as though it had been called in a browser, allowing the relative includes to be, well, included. This cleared up most of the error messages I’d received in the emailed output, but there was still one error, which led me to the final issue.
Problem 3) The Curl example I found on the forum here didn’t work for me, having the word ‘curl’ in it too many times. Actually, it DID work in terms of running the script, but it was returning (along with the rest of the output) an error that read “…could not resolve host ‘curl’…” … so, I took this:
-> [color=#FF0000]cd /home/; /usr/bin/curl curl http://<myDomain.com>/path/to/php/script.php[/color]
…and edited it down to this…
-> [color=#FF0000]cd /home/; /usr/bin/curl http://<myDomain.com>/path/to/php/script.php[/color]
And voila! The cronjob is now running the script without any errors and it’s then sending nicely formatted output to my email.
But before I wrap this up, let me answer the question that I originally came with: do cronjobs and .htaccess play nice together? Yes and no. If it’s just general .htaccess (such as, say, php flags, url rewriting, hotlink prevention, etc) then yes, it works fine. However, if there is password protection via .htpasswd, the script is stopped dead in its tracks and the emailed output is none other than the HTML source of a 401 error page (Auth Req’d).
Hope someone finds this useful…and thanks a lot for the assist!!