I hope you might be able to give some insight on this. I have a script on my site that gets mail from the mailserver then adds it to the database so we can read it from our support ticket section. If we run this script manually everything runs fine. We have a cronjob setup to run this every 10 minutes and get new mail. The problem we are having is that when the cron job runs it does not pickup any mail with ' (single quote) in the subject or body of the mail. If we run the script manually this does not happen. Any idea on why this would happen? Shouldn't cron it exactly the same as if we ran it manually? Thanks for any help! Brian
Just to be clear here: when you say 'run it manually' do you mean via the command line or through a browser? And when you say it's a cron job: is it a job that runs it via the CLI or one that runs it via wget? It almost sounds like you're testing manually via the browser and setting the cron job to run it via the CLI (or vice versa). Without any more information I'd guess that one environment has magic quotes on and the other doesn't.
I'm not really sure, I guess the cronjob is from the commandline, it's just a line in my crontab file. When I say run it manually I mean just load the php page in a browser so the code executes. I have a vague idea of what you mean when you say magic quotes but I'm not the programmer so I'm a little lost on what to do here. What can I do to test and fix it?
Not necessarily. Without knowing the exact commands you are running, it's hard to tell, but in general, scripts/processes that are run through cron do not get an environment set. I would make sure that you are giving the full path to all the commands that you are running. If you are running wget, don't just put the command "wget" in your call, use "/usr/bin/wget" (this is usually the path to wget, but it could be different on your server). This also goes for any commands you are running inside your script.