# Mautic Installed on Domain Subfolder - correct cron jobs code?

**URL:** <https://forum.mautic.org/t/mautic-installed-on-domain-subfolder-correct-cron-jobs-code/2085>\
**Category:** Product Support\
**Created:** [July 27, 2015, 2:19am UTC](https://forum.mautic.org/t/mautic-installed-on-domain-subfolder-correct-cron-jobs-code/2085 "2015-07-27T02:19:13Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![fuzzyboy](https://avatars.discourse-cdn.com/v4/letter/f/eada6e/32.png) [@fuzzyboy](https://forum.mautic.org/u/fuzzyboy)\
**Post date:** [July 27, 2015, 2:19am UTC](https://forum.mautic.org/t/mautic-installed-on-domain-subfolder-correct-cron-jobs-code/2085/1 "2015-07-27T02:19:13Z")

</div>

Hi guys.  
  
  
  
I installed mautic on a subfolder of may domain, example [www.mydomain.com/mautic](http://www.mydomain.com/mautic)  
  
  
  
As part of the set-up, I understand I need to create cron jobs:  
  
php /path/to/mautic/app/console mautic:leadlists:update --env=prod  
  
php /path/to/mautic/app/console mautic:campaigns:update --env=prod  
  
php /path/to/mautic/app/console mautic:campaigns:trigger --env=prod  
  
and  
  
php /path/to/mautic/app/console mautic:email:process --env=prod  
  
  
  
So if I installed mautic as described above, what is the correct cron jobs code to use?  
  
  
  
Thank you very much guys…sorry for the noob question.

---

<div class="post-metadata">

**Author:** ![fuzzyboy](https://avatars.discourse-cdn.com/v4/letter/f/eada6e/32.png) [@fuzzyboy](https://forum.mautic.org/u/fuzzyboy)\
**Post date:** [July 27, 2015, 2:19am UTC](https://forum.mautic.org/t/mautic-installed-on-domain-subfolder-correct-cron-jobs-code/2085/2 "2015-07-27T02:19:13Z")

</div>

Hi guys.

I installed mautic on a subfolder of may domain, example [www.mydomain.com/mautic](http://www.mydomain.com/mautic)

As part of the set-up, I understand I need to create cron jobs:  
php /path/to/mautic/app/console mautic:leadlists:update --env=prod  
php /path/to/mautic/app/console mautic:campaigns:update --env=prod  
php /path/to/mautic/app/console mautic:campaigns:trigger --env=prod  
and  
php /path/to/mautic/app/console mautic:email:process --env=prod

So if I installed mautic as described above, what is the correct cron jobs code to use?

Thank you very much guys…sorry for the noob question.

---

<div class="post-metadata">

**Author:** ![wootme](https://avatars.discourse-cdn.com/v4/letter/w/e9bcb4/32.png) [@wootme](https://forum.mautic.org/u/wootme)\
**Post date:** [July 27, 2015, 11:27am UTC](https://forum.mautic.org/t/mautic-installed-on-domain-subfolder-correct-cron-jobs-code/2085/3 "2015-07-27T11:27:07Z")

</div>

Hi,

Is your domain a shared hosting or dedicated server?  
if it’s a shared hosting read here:  
[https://www.mautic.org/community/index.php/537-installing-mautic-on-shared-host-read-here/p1#p2234](https://www.mautic.org/community/index.php/537-installing-mautic-on-shared-host-read-here/p1#p2234)

if not, just use the path like /var/www/html/yourwebsite/mautic hope that is clear. You may have to invoke the php from your installation, so more details you share the better.

---

<div class="post-metadata">

**Author:** ![fuzzyboy](https://avatars.discourse-cdn.com/v4/letter/f/eada6e/32.png) [@fuzzyboy](https://forum.mautic.org/u/fuzzyboy)\
**Post date:** [July 28, 2015, 5:21am UTC](https://forum.mautic.org/t/mautic-installed-on-domain-subfolder-correct-cron-jobs-code/2085/4 "2015-07-28T05:21:15Z")

</div>

Hi @wootme.

Thank you for your answer. I am on a shared server - Hostgator. Do you know anything about setting up Mautic in Hostgator?

Thanks!

---

<div class="post-metadata">

**Author:** ![fuzzyboy](https://avatars.discourse-cdn.com/v4/letter/f/eada6e/32.png) [@fuzzyboy](https://forum.mautic.org/u/fuzzyboy)\
**Post date:** [July 28, 2015, 9:52am UTC](https://forum.mautic.org/t/mautic-installed-on-domain-subfolder-correct-cron-jobs-code/2085/5 "2015-07-28T09:52:00Z")

</div>

I contacted Hostgator support in case they can help with the cron jobs code, but he said they don’t provide that support. He gave me this link though:

[http://support.hostgator.com/articles/cpanel/what-do-i-put-for-the-cron-job-command](http://support.hostgator.com/articles/cpanel/what-do-i-put-for-the-cron-job-command)

I’m not sure what to think of the codes since Mautic cron jobs code looked different from what they posted in that link above.

Any help with this is highly appreciated. Thanks guys.

---

<div class="post-metadata">

**Author:** ![chad.windnagle](https://avatars.discourse-cdn.com/v4/letter/c/7feea3/32.png) [@chad.windnagle](https://forum.mautic.org/u/chad.windnagle)\
**Post date:** [July 28, 2015, 1:54pm UTC](https://forum.mautic.org/t/mautic-installed-on-domain-subfolder-correct-cron-jobs-code/2085/6 "2015-07-28T13:54:51Z")

</div>

The commands they have are very similar. This should do it:

```auto
From Hostgator:
/opt/php55/bin/php /home/username/public_html/cron.php

Changed to fit mautic:
/opt/php55/bin/php /home/username/public_html/mautic_directory/app/console mautic:leadlists:update --env=prod
```

You just have to change the path to fit correctly, and instead of ‘cron.php’ you just want the ‘console’. Then a space followed by the commands. Create a new cron for each of the jobs listed here:  
[https://www.mautic.org/docs/setup/index.html](https://www.mautic.org/docs/setup/index.html)

---

<div class="post-metadata">

**Author:** ![fuzzyboy](https://avatars.discourse-cdn.com/v4/letter/f/eada6e/32.png) [@fuzzyboy](https://forum.mautic.org/u/fuzzyboy)\
**Post date:** [July 29, 2015, 12:39am UTC](https://forum.mautic.org/t/mautic-installed-on-domain-subfolder-correct-cron-jobs-code/2085/7 "2015-07-29T00:39:53Z")

</div>

Hey @chad.windnagle.

Thank you very much. 🙂 I will give it a test and will give you an update if it works or not.

---

<div class="post-metadata">

**Author:** ![fuzzyboy](https://avatars.discourse-cdn.com/v4/letter/f/eada6e/32.png) [@fuzzyboy](https://forum.mautic.org/u/fuzzyboy)\
**Post date:** [July 29, 2015, 2:41am UTC](https://forum.mautic.org/t/mautic-installed-on-domain-subfolder-correct-cron-jobs-code/2085/8 "2015-07-29T02:41:43Z")

</div>

@chad.windnagle,

Cron job is finally working… awesome! Thank you very much. 🙂

---

<div class="post-metadata">

**Author:** ![Sokoban](https://avatars.discourse-cdn.com/v4/letter/s/9dc877/32.png) [@Sokoban](https://forum.mautic.org/u/Sokoban)\
**Post date:** [September 18, 2015, 12:14pm UTC](https://forum.mautic.org/t/mautic-installed-on-domain-subfolder-correct-cron-jobs-code/2085/9 "2015-09-18T12:14:04Z")

</div>

@wootme / @chad.windnagle / @fuzzyboy  
How do I know the correct path like example ( /opt/php55/bin/php )? By cPanel?

---

<div class="post-metadata">

**Author:** ![Sokoban](https://avatars.discourse-cdn.com/v4/letter/s/9dc877/32.png) [@Sokoban](https://forum.mautic.org/u/Sokoban)\
**Post date:** [October 1, 2015, 2:11am UTC](https://forum.mautic.org/t/mautic-installed-on-domain-subfolder-correct-cron-jobs-code/2085/10 "2015-10-01T02:11:45Z")

</div>

@escopecz , A friend of mine has this issue with addon domain (/evolucaocontinua.com/):

1- Error log after running cron job:  
[i]Content-type: text/html

  
**Parse error** : syntax error, unexpected T\_STRING, expecting T\_CONSTANT\_ENCAPSED\_STRING or '(' in **/home/cpaneluser/public\_html/evolucaocontinua.com/mautic/app/console** on line **18**  
[/i]

2- Error log after running manual trigger:  
[RuntimeException]  
Failed to start the session because headers have already been sent by “/home/cpaneluser/public\_html/evolucaocontinua.com/mautic/cron.php” at line 1.

ModSecurity might be envolved?

---

<div class="post-metadata">

**Author:** ![escopecz](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/escopecz/32/370_2.png) [@escopecz](https://forum.mautic.org/u/escopecz)\
**Post date:** [October 1, 2015, 5:15am UTC](https://forum.mautic.org/t/mautic-installed-on-domain-subfolder-correct-cron-jobs-code/2085/11 "2015-10-01T05:15:47Z")

</div>

@Sokoban try to turn off the mod\_security and you’ll know the answer. Also, please, start a new forum topic with a new question. Using already closed, unrelated topic cause:

- people who follow the topic will be spammed with information which is not related.
- people with the same problem you have will have hard time to find it.

You probably refer to the script which runs Mautic commands via browser. Make a link to that script (and other resources you mention) so others know what you are talking about. That’ll not only help others searching for answer to their similar problem, but it will also help those who want to answer your question, but they need complete information.

---

<div class="post-metadata">

**Author:** ![silavapi](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/silavapi/32/7424_2.png) [@silavapi](https://forum.mautic.org/u/silavapi)\
**Post date:** [February 2, 2020, 10:58pm UTC](https://forum.mautic.org/t/mautic-installed-on-domain-subfolder-correct-cron-jobs-code/2085/12 "2020-02-02T22:58:08Z")

</div>


