Skip to content

Run Symfony2 command from cronjobs in CPanel on a shared host

Let's see how to program tasks scheduled in CPanel shared hosting to run custom commands of Symfony2.

In our example we will have the following file structure of our Symfony project in our shared server:

 

 

 

/src/AppBundle/Command/TestCommand.php

 

 

Now we run each time our command and to save the result in the test_command.log file. To do this just go in our CPanel:

Home > Advanced > Cron Jobs

Replace {username} by your user name on your shared hosting account.

 

Share on Facebook1Tweet about this on TwitterShare on Google+0Share on Reddit0Email this to someone

I 'm a programmer , systems analyst and designer of websites , apps and software since 2006. Study in Marseille and currently living in Rio de Janeiro and work as Symfony developer.