I am working on a PHP (Fat free framework) project in Linux. The project is running fine when I call it directly from the cli.
> cd /var/www/html/test/proj/source/
> php index.php controller_name/action_name/parameter1
However, I cannot run the project from a bash script. I have created a bash script with following content:
/usr/bin/php /var/www/html/test/proj/source/index.php controller_name/action_name/parameter1
I get the following error
"No routes specified" [/var/www/html/test/proj/source/index.php:LINE_NUMBER] Base->run()
I couldn't find anything about it on https://www.fatfreeframework.com
Probably it does not work because the app's root path is a different. Change the working dir with cd /var/www/html/test/proj/source/
first before calling index.php, because otherwise relative paths within the app are screwed and things like $f3->config('config.ini')
, where you might have defined the routes, isn't finding the file to load.