Older versions worked well but after upgrading to version 1.9.2 e-mails don't send anymore. I set up cron with command line : php -f /home4/myserver_name/public_html/cron.sh 5min The only e-mail I get is the cron_daemon sending me the cron.sh file..!! After researching for hours and trying different solutions I am at my witts end. Nothing worked. Ant help his highly appreciated! Thx in advance!

  • Did you check the Magento and Apache (php) logs for any errors? – Sander Mangel Nov 10 '15 at 7:31
  • thx for reminding me...here is what it shows: HP Warning: PHP Startup: Unable to load dynamic library '/usr/php/54/usr/lib64/php/modules/imagick.so' - /usr/php/54/usr/lib64/php/modules/imagick.so: cannot open shared object file: No such file or directory in Unknown on line 0 [10-Nov-2015 09:05:13 UTC] PHP Notice: Undefined index: SCRIPT_NAME in /home4/myserver_name/public_html/cron.php on line 40 – thomasrihs Nov 10 '15 at 9:08
  • So that means you need to install the imagick library on your server – Sander Mangel Nov 10 '15 at 9:10
  • 2
    I'm voting to close this question as off-topic because it's about a missing php library – Sander Mangel Nov 10 '15 at 9:10
  • First of all...thx for your help and input! Really appreciate it! – thomasrihs Nov 10 '15 at 9:11

I think this is the problem: php -f /home4/myserver_name/public_html/cron.sh, you're trying to run a shell file with PHP. You should use one of these:

  • php -f /home4/myserver_name/public_html/cron.php
  • sh /home4/myserver_name/public_html/cron.sh

And if that's still not working and you're getting the error messages of missing libraries (as you've commented on your question) but you've them already installed and configured I think you've to check if PHP is using the right .ini when running it with CLI:

  • Create a phpinfo.php file in your /home4/myserver_name/public_html/ directory with this line: <?php echo phpinfo();
  • Visit your website with /phpinfo.php and check which .ini files are loaded
  • Run php --ini from the terminal and check if it's using the same .ini files

If that's not the case, you can use the -c parameter: -c <path>|<file> Look for php.ini file in this directory. With that parameter you've to point to the directory of the .ini file that's loaded by the server (which you've found in the phpinfo.php file you've created). So that could be something like: php -f /home4/myserver_name/public_html/cron.php -c /home4/myserver_name/ when that's where the .ini lives. And don't forget to remove the phpinfo.php file!

| improve this answer | |
  • I had cron.php before and it did not work! I will look into it..thx again..really apppreciated! – thomasrihs Nov 10 '15 at 17:32
  • You should never invoke the PHP file directly. Not only does it not have job control/sanity checks, but also requires arguments to run properly. Only the shell script should be run. – Ben Lessani - Sonassi Nov 11 '15 at 9:29
  • Thank you for your input...I guess to use the cron.sh is the correct way...thx again! – thomasrihs Nov 13 '15 at 3:57

Not the answer you're looking for? Browse other questions tagged or ask your own question.