# Campaign Emails not sent: Fixed, Parse Error line 136, php for cron job

**URL:** <https://forum.mautic.org/t/campaign-emails-not-sent-fixed-parse-error-line-136-php-for-cron-job/7859>\
**Category:** Product Support\
**Created:** [March 9, 2017, 12:25am UTC](https://forum.mautic.org/t/campaign-emails-not-sent-fixed-parse-error-line-136-php-for-cron-job/7859 "2017-03-09T00:25:58Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![alainarae](https://avatars.discourse-cdn.com/v4/letter/a/c68b51/32.png) [@alainarae](https://forum.mautic.org/u/alainarae)\
**Post date:** [March 9, 2017, 12:25am UTC](https://forum.mautic.org/t/campaign-emails-not-sent-fixed-parse-error-line-136-php-for-cron-job/7859/1 "2017-03-09T00:25:58Z")

</div>

So I had a frustrating time getting this to all work, but here is what I did if it helps anyone.  
  
  
  
My test emails would send, but my campaign emails would not. I tried Cronfig and still no dice.  
  
  
  
To find out the error I went to my cron jobs page in cpanel, above the Add new cron job there is an option to Add Email so I get an email telling my if and how the cron job ran or if it had an error. (make sure to update/remove your email after you figure it all out or your inbox gets flooded with these updates).  
  
  
  
Here is the error I got:  
  
  
  
Parse error: syntax error, unexpected ‘$result’ (T\_VARIABLE) in /home4/username/public\_html/domain.com/m/plugins/MauticCitrixBundle/Helper/CitrixHelper.php on line 136  
  
  
  
In reading online, it seems that this is not a CitrixHelper.php issue, but rather, a PHP VERSION ERROR. Just as we need 5.6 or better with Mautic, if your server runs cron jobs on the server’s default php of 5.4, then the discrepancy make the problem.  
  
  
  
It turns out that even though I updated my php to 7.0 in cpanel, you have to update the php that the cron job is using. Basically I changed my cron job from this:  
  
  
  
**php-cli** /home4/username/public\_html/domain.com/m/app/console mautic:campaigns:trigger  
  
  
  
to this:  
  
  
  
**/opt/php70/bin/php** /home4/username/public\_html/domain.com/m/app/console mautic:campaigns:trigger  
  
  
  
in order to make sure my cron was using the same php version as everything else and viola! Success!

---

<div class="post-metadata">

**Author:** ![alainarae](https://avatars.discourse-cdn.com/v4/letter/a/c68b51/32.png) [@alainarae](https://forum.mautic.org/u/alainarae)\
**Post date:** [March 9, 2017, 12:25am UTC](https://forum.mautic.org/t/campaign-emails-not-sent-fixed-parse-error-line-136-php-for-cron-job/7859/2 "2017-03-09T00:25:58Z")

</div>

So I had a frustrating time getting this to all work, but here is what I did if it helps anyone.

My test emails would send, but my campaign emails would not. I tried Cronfig and still no dice.

To find out the error I went to my cron jobs page in cpanel, above the Add new cron job there is an option to Add Email so I get an email telling my if and how the cron job ran or if it had an error. (make sure to update/remove your email after you figure it all out or your inbox gets flooded with these updates).

Here is the error I got:

Parse error: syntax error, unexpected ‘$result’ (T\_VARIABLE) in /home4/username/public\_html/domain.com/m/plugins/MauticCitrixBundle/Helper/CitrixHelper.php on line 136

In reading online, it seems that this is not a CitrixHelper.php issue, but rather, a PHP VERSION ERROR. Just as we need 5.6 or better with Mautic, if your server runs cron jobs on the server’s default php of 5.4, then the discrepancy make the problem.

It turns out that even though I updated my php to 7.0 in cpanel, you have to update the php that the cron job is using. Basically I changed my cron job from this:

php-cli /home4/username/public\_html/domain.com/m/app/console mautic:campaigns:trigger

to this:

/opt/php70/bin/php /home4/username/public\_html/domain.com/m/app/console mautic:campaigns:trigger

in order to make sure my cron was using the same php version as everything else and viola! Success!

---

<div class="post-metadata">

**Author:** ![alainarae](https://avatars.discourse-cdn.com/v4/letter/a/c68b51/32.png) [@alainarae](https://forum.mautic.org/u/alainarae)\
**Post date:** [March 23, 2017, 6:32am UTC](https://forum.mautic.org/t/campaign-emails-not-sent-fixed-parse-error-line-136-php-for-cron-job/7859/3 "2017-03-23T06:32:48Z")

</div>

UPDATE: all my sites on shared hosting crashed on php7.0 as it is “unstable”

Back to finding a solution - cronfig sort of works, but only every 30 min and initial emails for campaigns not consistently going out… would welcome any other options

---

<div class="post-metadata">

**Author:** ![boyan](https://avatars.discourse-cdn.com/v4/letter/b/d9b06d/32.png) [@boyan](https://forum.mautic.org/u/boyan)\
**Post date:** [April 19, 2017, 12:44pm UTC](https://forum.mautic.org/t/campaign-emails-not-sent-fixed-parse-error-line-136-php-for-cron-job/7859/4 "2017-04-19T12:44:36Z")

</div>

@alainarae I have the same issue now, how did you fix it, please help!

---

<div class="post-metadata">

**Author:** ![alainarae](https://avatars.discourse-cdn.com/v4/letter/a/c68b51/32.png) [@alainarae](https://forum.mautic.org/u/alainarae)\
**Post date:** [August 3, 2017, 11:57pm UTC](https://forum.mautic.org/t/campaign-emails-not-sent-fixed-parse-error-line-136-php-for-cron-job/7859/5 "2017-08-03T23:57:03Z")

</div>

@boyan  
Sorry for the delay - just saw this. I have it working - but don’t remember everything I did… I believe I reinstalled directly into my site. Here are my cron jobs if that helps: (I installed into folder “m” instead of “mautic” because I did not want to type the whole word everytime I went to work on it - I am lazy

36,40 \* \* \* \* /opt/php56/bin/php /home4/username/public\_html/domain.com/m/app/console mautic:segments:update  
5,20,35,50 \* \* \* \* /opt/php56/bin/php /home4/username/public\_html/domain.com/m/app/console mautic:campaigns:update  
\*/22 \* \* \* \* /opt/php56/bin/php /home4/username/public\_html/domain.com/m/app/console mautic:campaigns:trigger

My PHP is set back to 5.6

Probably not super helpful, but just in case
