Good day. There is a project on Laravel, a year already lives. I wanted to try a new development environment VALET. Nakatil on Sierra osx. The project has packages using php-imap, respectively, installed the appropriate extension. Mail does not go and in the error log about the use of an undefined constant. 'Use of undefined Constant SORTDATE - assumed vendors package for work with mail. This constant is defined in http://php.net/manual/en/imap.constants.php. The package installed in the project uses several constants. 'by' => ['date' => SORTDATE, 'arrival' => SORTARRIVAL, 'from' => SORTFROM, 'subject' => SORTSUBJECT, 'size' => SORTSIZE] What really confuses. If I check the value of these constants anywhere in the project, I will see the correct values. phpinfo () kindly informs me that IMAP is connected. But for some reason, when the core of the framework is assembled in the log, these errors and so the mail does not go accordingly. The same project works normally in the Homestead environment. I can not understand what the problem is. Who has ideas I will be glad to hear.

As it turned out, the error occurs when the schedule script is executed, and accordingly everything that runs on a schedule does not work. If you run from the console all the scripts work fine. As the reason is seen, the console command is launched in the environment in which IMAP is not connected for php. It remains to understand how the environment is formed for the skip executed by cron.

Here is my cron

PATH = / usr / local / opt / php70 / bin: / usr / local / sbin: / usr / local / bin: / usr / bin: / bin: / usr / sbin: / sbin

          • php / Users / vlad / Code / macpwn / artisan schedule: run >> / dev / null 2> & 1

The list of paths is taken from the console environment in which this command works ok. But after adding PATH cron stopped running.

  • It all worked. - Vladimir Prokopchuk

0