1

I have a CRON task set up and it is being called at the correct intervals. The PHP script it is calling will only execute commands written directly into that script, like mail();. But when I try and call another class (with require_once())like class.PHPMailer.php from that script that will not work. I've tried absolute and relative path.

Is a CRON executed PHP script restricted in any way?

nino
  • 11
  • 4
  • its user restricted, to put it simple it will run with the privileges of the user that created it or the user defined at it. If your require_once is not working it should give you an error for loading it, have you tried running it from the terminal to see if anything shows up with the same user its using on cron? – Prix Oct 07 '14 at 20:59
  • 2
    CLI php generally has a different .ini file than webserver-based PHP, which means it can have different modules loaded, and definitely had different settings for things like max_execution_time and memory_limit and even things like include_path. – Marc B Oct 07 '14 at 21:02
  • @MarcB generally, no. It just has different inis if you downloaded it from some distro which did it for you. But generally, PHP uses the same ini for everything. (You can yourself create extra inis per SAPI, but it's not by default) – bwoebi Oct 07 '14 at 21:15
  • @Prix, haven't tried terminal yet. The user I set the task up with is is the primary for that account. It's Godaddy cpanel account. I have the permissions on the PHP file set to 777 also. – nino Oct 07 '14 at 23:03

0 Answers0