4

I'm using yii2 basic template for my application. I created a console command which executed successfully on my local. But when I run it in terminal on my bluehost site, I got this error "Exception 'yii\base\InvalidConfigException' with message 'Unable to determine the entry script file path.'"

I learn that the issue was about the php environment, that uses cgi instead of cli, got the info here https://github.com/yiisoft/yii2/issues/6244

I confirm it when checking the php -v host: PHP 5.4.34 (cgi-fcgi) (built: Oct 21 2014 17:19:35) local(dev): PHP 5.5.14 (cli) (built: Sep 9 2014 19:09:25)

How I can change this server environment to use cli instead of cgi. A step by step guide with bluehost environment would be appreciated.

Pelang
  • 421
  • 7
  • 19
  • solve this issue with the help from this site http://zurmo.org/forums/index.php?/topic/4516-setting-up-bluehost-cron-jobs-on-shared-server/ – Pelang Mar 19 '15 at 02:59

3 Answers3

12

You're trying to run console command with PHP CGI, which have different environment.

You should use PHP CLI, so call php-cli instead of php.

Abdulla Nilam
  • 36,589
  • 17
  • 64
  • 85
Anton Oliinyk
  • 176
  • 2
  • 5
3

Solve my same problem with

/usr/local/bin/php /home/xyz/yii hello
Ali Yousefi
  • 472
  • 4
  • 11
2

This problem is in Shared Hosting providers.

PHP is configured and installed on the server with two separate executable / binary files for CLI and CGI (FastCGI).

PHP CGI (FastCGI) /usr/bin/php

PHP CLI /usr/local/bin/php

Read More

phpshell or other tools that emulate like this, execute commands in CGI/FastCGI mode.

Cron Jobs in Shared Hosting are executed under cli mode

msoa
  • 1,339
  • 3
  • 14
  • 33