Skip to main content

How to enable message delivery

By default, the extension sends notifications through a background process that is launched by cron and requires the PHP function exec to be enabled. If this function is disabled on the server, messages will not be delivered.

1. Check if exec is available for PHP (CLI)

Run the following command as the same user that runs cron/Magento to see if exec is disabled:

php -i | grep disable_functions

Or use the command below to output the full list of disabled functions:

php -r 'echo ini_get("disable_functions"), PHP_EOL;'

If exec appears in the list, it is disabled for CLI, and background processes will not run.


2. Enable the exec function

Enable the exec function in the PHP (CLI) configuration by removing it from disable_functions, then restart cron if required. Alternatively, ask your server administrator or hosting provider to do this.

If enabling exec is not possible, you need to add a direct cron job to start the message subscriber. Open the crontab:

crontab -e

And add the following line and save cron tab:

* * * * * path_to_php_binary magento_install_dir/bin/magento mirasvit:message-queue:subscribe >> /var/log/mirasvit_message_queue.log 2>&1

Where:

  • path_to_php_binary: the full path to the PHP executable.
  • magento_install_dir: the path to the Magento installation root.
  • The log is redirected to /var/log/mirasvit_message_queue.log so you can verify that it is running (you may choose a different log path).

After enabling exec or adding the cron job, the subscriber will start correctly, and messages will be delivered to the selected recipients.