I need cron job "app/console mautic:emails:send" activated on cPanel. What do I need to set, since it is NOT working now?

Your software
My Mautic version is: 2.15.3
My PHP version is: 7.1

Your problem
My problem is:
I need cron job “/MY_DIR/app/console mautic:emails:send” activated on cPanel. What do I need to set, since it is NOT working now?

These errors are showing in the e-mail that this cron job sends on my account each time it executes:
Parse error: syntax error, unexpected ‘$value’ (T_VARIABLE) in /MY_DIR/vendor/aws/aws-sdk-php/src/functions.php on line 36

It is this function:
https://gyazo.com/eda7b9e4ac5126a24393ee755ec0e42b

Steps I have tried to fix the problem:
Commented out the contents of this function inside { }
and another error appeared… So I need to know what needs to be set on my cPanel so that this may work properly.

Thank you

Unless you are using the queue to send emails (instead of Send immediately in Configuration > Email) you don’t need the mautic:emails:send cron job. I’m assuming since you’re using cPanel you’re very likely on a shared web host. It’s better to migrate your instance to a VPS where you have root access so you can modify all the PHP runtime settings. Your web host might be using a non-standard config with PHP that is causing this problem.

1 Like

I couldn’t agree more, besides the configuration/limitations imposed by the hosting company, there are also other reasons not to use CPanel with Mautic, see more here:

1 Like

Thank you, but what we HAVE to use is the “Queue” option. That is why we decided to use cron jobs.
My cron job actually runs, but the messages are stuck in “spool” and no sending is done. I like to let you know that all the SMTP settings are proper and correct - tested and verified this.

Can somebody provide an answer to my issue in my heading post in this thread?
Is there a bug in the Mautic software in the lines of code I shared? What can we do to fix this or how can we do a workaround? If this is a case, then where ever we migrate this will be issue again and again.

But when speaking on the subject… actually, our first option with which we started was with “Send immediately” but after sending of the first batch of for instance 100 addresses, the “Send immediately” was stopping, so the process HAD to be started all over again to continue… which apparently is NOT an option :frowning: Can you share why was this process stopping, since we could not find out in the configuration what was causing this issue.

Hi there,

Sorry to hear you’re having a problem.

Are you using AWS to send emails? If so, when you send a test mail, or test connection from email settings, do you get success? Is this only happening when you send via AWS using Cron?

You mentioned having problems using send immediately when you hit 100 odd sends, have you checked you’re not in sandbox or on a restricted send volume with Amazon?

Hi and thank you for your feedback,

first, we are not in sandbox mode. Please, check this link to get updated about our sending limits: https://gyazo.com/e349837267b0c5738774b2a2fdb37879

Second,
“Test Connection” pass successfully.
“Send test mail” pass successfully.

And, I would like to remind what I specified at the beginning:

These errors are showing in the e-mail that this cron job sends on my account each time it executes:
https://gyazo.com/bc561e758cae66009e33bdb27f88d134

  1. zend_execute_ex and ioncube issue and
  2. Parse error : syntax error, unexpected ‘$value’ (T_VARIABLE) in /MY_DIR/vendor/aws/aws-sdk-php/src/functions.php on line 36

It is this function:
https://gyazo.com/eda7b9e4ac5126a24393ee755ec0e42b

Steps I have tried to fix the problem:
Commented out the contents of this function inside { }
and another error appeared… So I need to know what needs to be set on my cPanel so that this may work properly. Is this Mautic bug and how can I be sure that this IS working, and on which environment? Is there any test report to confirm that?

Thank you so much!
Kindly,
Ivan

Linking up your Github issue so that there is a two-way reference in case people come across it there

1 Like

Thanks for clarifying. It’s often helpful to ensure the basics are functioning correctly before diving into more technical issues, hence my questions around ensuring that the basic sending is working with AWS (you were not explicit in earlier threads about whether sending immediately was happening when using AWS).

As many others are using Mautic 2.15.3 with SES at scale and it is working perfectly without this error, and nobody else has reported this error on Github or the forums (from my searching I could not find any other related reports), it would point to there being something specific in your environment which is causing this error.

As others have mentioned, using Mautic in a shared hosting environment at scale is often going to cause you problems, simply because your hosting provider will have limitations on the resources available to you.

I would recommend asking them to check in their logs, and see if they can spot anything happening when your crons are firing that might be causing this issue.

It might be that a process is using too many resources and is being killed automatically, hence the job never completes, for example.

If that is the case, no amount of tweaking or modifying in Mautic will resolve this problem, and as mentioned above, you would be better off on a small VPS (which is often around the same price as a hosting account) where you have full control over the server.

Thank you for this reply. I have read it to the end :slight_smile:
About the error… do you want to say that

  • Parse error : syntax error, unexpected ‘$value’ (T_VARIABLE) in /MY_DIR/vendor/aws/aws-sdk-php/src/functions.php on line 36
    is not Mautic issue? Do you say that this is not syntax error (although it specifies that it is syntax error)? Do you want to say that this is only server resources caused issue that is not referring Mautic source code?
    Sorry to set this things like this, but I have to ask more directly and specifically, because I am little bit confused about what I see in the error specification and your explanation on the other side :frowning:

It is not Mautic, It is not AWS, it is not Cpanel, it’s the combination of all that what get’s you in that precarious position. Please, for your own sake, stop using Cpanel to install/run Mautic, unless you fully master Cpanel already.

2 Likes

Are you sure that you’re running that version of PHP listed?

Hey, @ivanskmkd

Have you double-checked your PHP version as @MxyzptlkFishStix has recommended?

Hi @Yosu_Cadilla. yes. Tried with 7.1 version, as well as with 7.0 and 5.6. Checked and tried. All the same :frowning: