If I disable the .htaccess file, the cron job will execute, otherwise it wont. I’m not really sure why this is happening, since the cron job is using an absolute path to a file on the server, and not making any requests through the server. Isn’t it?
Has anyone come up with this sort of thing before?
Given that it’s been working for me for over two years (on three accounts), I would recommend that you check your PHP executable location AND add the -q switch before the PHP filename that you want CRON to execute.
NOTE 1: I cannot find the meaning of the -q switch so it may not be necessary – just something to try if all else fails.
NOTE 2: DreamHost’s example is /usr/local/php5/bin/php /home/<USER NAME>/path/to/script.php, i.e., the php executable is in the binary directory of the php5 but does NOT use the -q switch.
Can you give us some background about what you script does? We don’t necessarily need to see the code, but I think ScallioXTX is on the right track here. I’d bet that your script is trying to connect to your website over HTTP and the cron job is interfering with that part of the script.
Boy, that became a difficult challenge and I’m not even sure I found the proper meaning in the way you used it. What I found states it suppressed html output in older cgi versions. In PHP 5.2 the -q was deprecated.
i use emacs in c-mode for editing. in 4.3, starting a cli script like so:
#!/usr/bin/php -q /* -- c -- */
<?php
told emacs to drop into c-mode automatically when i loaded the file for editing. the ‘-q’ flag didn’t actually do anything (in the older cgi versions, it suppressed html output when the script was run) but it caused the commented mode line to be ignored by php.
in 5.2, ‘-q’ has apparently been deprecated. replace it with ‘–’ to achieve the 4.3 invocation-with-emacs-mode-line behavior:
#!/usr/bin/php – /* -- c -- */
<?php
don’t go back to your 4.3 system and replace ‘-q’ with ‘–’; it seems to cause php to hang waiting on STDIN…
Thanks for that info. I was checking Apache.org for details on that (should have been a Linux website, I know ) and found nothing. Other website examples used the -q but gave no definition of that switch.
I hope Micky gave it a try both with and without and will report back here with results.
BTW, (belated) congrats on becoming a TL! Well deserved.
Not a problem, I had never seen that switch option before, so I was curious as to what it could possibly mean myself (and it was a challenge to find what little info about it I did find).