Welcome Guest, Not a member yet? Register   Sign In
Calling CI controller inside sub folder by cronjob
#1

Hi there
I'd like to use cronjob to call a CI method from a controller inside a sub folder (using CI 3). I tried it these ways:
  • php -f /home/user/public_html/index.php Subfolder/controller function -O /dev/null
  • php -f /home/user/public_html/index.php subfolder/Controller function -O /dev/null
  • php -f /home/user/public_html/index.php subfolder/controller function -O /dev/null
  • php -f /home/user/public_html/index.php subfolder controller function -O /dev/null
Nothing worked so far. Maybe you can give me a hint how to achieve this.
Reply
#2

According to the user guide you need to be in the right directory. Try this:
Code:
cd /home/user/public_html && php index.php subfolder/controller function -O /dev/null

You may also need to specify the full path for the php command:
Code:
cd /home/user/public_html && /usr/bin/php index.php subfolder/controller function -O /dev/null
CodeIgniter 4 tutorials (EN/FR) - https://includebeer.com
/*** NO support in private message - Use the forum! ***/
Reply




Theme © iAndrew 2016 - Forum software by © MyBB